java.lang.Object
com.google.zxing.client.j2se.MatrixToImageConfig
Encapsulates custom configuration used in methods of
MatrixToImageWriter.Field Summary
Constructor Summary
ConstructorsConstructorDescriptionMatrixToImageConfig(int onColor, int offColor) Creates a config with the given colors.Method Summary
Modifier and TypeMethodDescription(package private) intGet the buffered image color model.intGet the color that a light module is drawn in.intGet the color that a dark module is drawn in.private static booleanhasTransparency(int argb) True when a colour is not fully opaque.
Field Details
BLACK
WHITE
onColor
private final int onColorARGB of a set module.offColor
private final int offColorARGB of an unset module.
Constructor Details
MatrixToImageConfig
MatrixToImageConfig
public MatrixToImageConfig(int onColor, int offColor) Creates a config with the given colors.- Parameters:
onColor- pixel on color, specified as an ARGB value as an intoffColor- pixel off color, specified as an ARGB value as an int
Method Details
getPixelOnColor
public int getPixelOnColor()Get the color that a dark module is drawn in.- Returns:
- the on color, as an ARGB value
getPixelOffColor
public int getPixelOffColor()Get the color that a light module is drawn in.- Returns:
- the off color, as an ARGB value
getBufferedImageColorModel
int getBufferedImageColorModel()Get the buffered image color model.- Returns:
- the color model type
hasTransparency
private static boolean hasTransparency(int argb) True when a colour is not fully opaque.- Parameters:
argb- the colour to test- Returns:
- true if its alpha channel is set