|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.google.zxing.oned.OneDimensionalCodeWriter
public abstract class OneDimensionalCodeWriter
Encapsulates functionality and implementation that is common to one-dimensional barcodes.
Constructor Summary | |
---|---|
protected |
OneDimensionalCodeWriter(int sidesMargin)
|
Method Summary | |
---|---|
protected static int |
appendPattern(byte[] target,
int pos,
int[] pattern,
int startColor)
Appends the given pattern to the target array starting at pos. |
abstract byte[] |
encode(java.lang.String contents)
Encode the contents to byte array expression of one-dimensional barcode. |
BitMatrix |
encode(java.lang.String contents,
BarcodeFormat format,
int width,
int height)
Encode a barcode using the default settings. |
BitMatrix |
encode(java.lang.String contents,
BarcodeFormat format,
int width,
int height,
java.util.Map<EncodeHintType,?> hints)
Encode the contents following specified format. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
protected OneDimensionalCodeWriter(int sidesMargin)
Method Detail |
---|
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height) throws WriterException
Writer
encode
in interface Writer
contents
- The contents to encode in the barcodeformat
- The barcode format to generatewidth
- The preferred width in pixelsheight
- The preferred height in pixels
WriterException
public BitMatrix encode(java.lang.String contents, BarcodeFormat format, int width, int height, java.util.Map<EncodeHintType,?> hints) throws WriterException
width
and height
are required size. This method may return bigger size
BitMatrix
when specified size is too small. The user can set both width
and
height
to zero to get minimum size barcode. If negative value is set to width
or height
, IllegalArgumentException
is thrown.
encode
in interface Writer
contents
- The contents to encode in the barcodeformat
- The barcode format to generatewidth
- The preferred width in pixelsheight
- The preferred height in pixelshints
- Additional parameters to supply to the encoder
WriterException
protected static int appendPattern(byte[] target, int pos, int[] pattern, int startColor)
startColor
- starting color - 0 for white, 1 for black
public abstract byte[] encode(java.lang.String contents)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |