Code93Writer.java (zxing-zxing-3.4.0) | : | Code93Writer.java (zxing-zxing-3.4.1) | ||
---|---|---|---|---|
skipping to change at line 19 | skipping to change at line 19 | |||
* | * | |||
* Unless required by applicable law or agreed to in writing, software | * Unless required by applicable law or agreed to in writing, software | |||
* distributed under the License is distributed on an "AS IS" BASIS, | * distributed under the License is distributed on an "AS IS" BASIS, | |||
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |||
* See the License for the specific language governing permissions and | * See the License for the specific language governing permissions and | |||
* limitations under the License. | * limitations under the License. | |||
*/ | */ | |||
package com.google.zxing.oned; | package com.google.zxing.oned; | |||
import com.google.zxing.BarcodeFormat; | import com.google.zxing.BarcodeFormat; | |||
import com.google.zxing.EncodeHintType; | ||||
import com.google.zxing.WriterException; | ||||
import com.google.zxing.common.BitMatrix; | ||||
import java.util.Map; | import java.util.Collection; | |||
import java.util.Collections; | ||||
/** | /** | |||
* This object renders a CODE93 code as a BitMatrix | * This object renders a CODE93 code as a BitMatrix | |||
*/ | */ | |||
public class Code93Writer extends OneDimensionalCodeWriter { | public class Code93Writer extends OneDimensionalCodeWriter { | |||
@Override | @Override | |||
public BitMatrix encode(String contents, | protected Collection<BarcodeFormat> getSupportedWriteFormats() { | |||
BarcodeFormat format, | return Collections.singleton(BarcodeFormat.CODE_93); | |||
int width, | ||||
int height, | ||||
Map<EncodeHintType,?> hints) throws WriterException { | ||||
if (format != BarcodeFormat.CODE_93) { | ||||
throw new IllegalArgumentException("Can only encode CODE_93, but got " + f | ||||
ormat); | ||||
} | ||||
return super.encode(contents, format, width, height, hints); | ||||
} | } | |||
/** | /** | |||
* @param contents barcode contents to encode. It should not be encoded for ex tended characters. | * @param contents barcode contents to encode. It should not be encoded for ex tended characters. | |||
* @return a {@code boolean[]} of horizontal pixels (false = white, true = bla ck) | * @return a {@code boolean[]} of horizontal pixels (false = white, true = bla ck) | |||
*/ | */ | |||
@Override | @Override | |||
public boolean[] encode(String contents) { | public boolean[] encode(String contents) { | |||
contents = convertToExtended(contents); | contents = convertToExtended(contents); | |||
int length = contents.length(); | int length = contents.length(); | |||
End of changes. 4 change blocks. | ||||
14 lines changed or deleted | 5 lines changed or added |