mirror of
https://github.com/zxing/zxing.git
synced 2024-11-09 20:44:03 -08:00
Make OneDimensionalCodeWriter.encode(content, hints) public (#1659)
This method is useful for encoding Code128 with a specific code set to a bool array. As no other class overrides this method, this change only affects Code128Writer. I don't know that there's a strong argument against making this method public. With this method protected, it is necessary to first encode as a BitMatrix, extract the first row, and the convert the resulting BitArray to a bool array. This all can be avoided if the method is made public.
This commit is contained in:
parent
7880290d25
commit
57ed027468
|
@ -71,7 +71,7 @@ public final class Code128Writer extends OneDimensionalCodeWriter {
|
|||
}
|
||||
|
||||
@Override
|
||||
protected boolean[] encode(String contents, Map<EncodeHintType,?> hints) {
|
||||
public boolean[] encode(String contents, Map<EncodeHintType,?> hints) {
|
||||
|
||||
int forcedCodeSet = check(contents, hints);
|
||||
|
||||
|
|
|
@ -48,7 +48,7 @@ public abstract class OneDimensionalCodeWriter implements Writer {
|
|||
* @param hints encoding hints
|
||||
* @return a {@code boolean[]} of horizontal pixels (false = white, true = black)
|
||||
*/
|
||||
protected boolean[] encode(String contents, Map<EncodeHintType,?> hints) {
|
||||
public boolean[] encode(String contents, Map<EncodeHintType,?> hints) {
|
||||
return encode(contents);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue