package com.JUtils.QRCode; import java.awt.image.BufferedImage; /** * */ public final class MatrixToImageConfig { public static final int BLACK = 0xFF000000; public static final int WHITE = 0xFFFFFFFF; private final int onColor; private final int offColor; /** * Creates a default config with on color {@link #BLACK} and off color {@link #WHITE}, generating normal * black-on-white barcodes. */ public MatrixToImageConfig() { this(BLACK, WHITE); } /** * @param onColor pixel on color, specified as an ARGB value as an int * @param offColor pixel off color, specified as an ARGB value as an int */ public MatrixToImageConfig(int onColor, int offColor) { this.onColor = onColor; this.offColor = offColor; } public int getPixelOnColor() { return onColor; } public int getPixelOffColor() { return offColor; } int getBufferedImageColorModel() { // Use faster BINARY if colors match default // return onColor == BLACK && offColor == WHITE ? BufferedImage.TYPE_BYTE_BINARY : BufferedImage.TYPE_INT_RGB; return BufferedImage.TYPE_INT_ARGB; } }
最近下载更多
lee123321 LV22
2023年12月19日
初心不负丶方得始终 LV10
2023年4月21日
爱情戴罪的羔羊 LV7
2022年9月17日
guojun LV10
2022年8月17日
iizuidaima LV11
2022年8月11日
13940562934 LV22
2022年7月19日
姜广坤 LV14
2022年5月20日
crosa_Don LV18
2022年4月1日
nbzhou2013 LV14
2022年3月18日
charles1256 LV11
2021年12月20日
最近浏览更多
sky1044 LV1
2月19日
lee123321 LV22
2023年12月19日
shiaomon
2023年12月15日
暂无贡献等级
3334004690 LV3
2023年11月1日
lilu0226 LV7
2023年10月29日
飘逸的云 LV1
2023年7月6日
初心不负丶方得始终 LV10
2023年4月21日
微信网友_6411404521459712
2023年3月30日
暂无贡献等级
wuziayng1232 LV10
2023年2月21日
小白queen LV1
2022年12月22日