Lines Matching defs:border
172 private static BufferedImage toImage(QrCode qr, int scale, int border) {
173 return toImage(qr, scale, border, 0xFFFFFF, 0x000000);
179 * the specified module scale, border modules, and module colors.
180 * <p>For example, scale=10 and border=4 means to pad the QR Code with 4 light border
184 * @param border the number of border modules to add, which must be non-negative
189 * @throws IllegalArgumentException if the scale or border is out of range, or if
190 * {scale, border, size} cause the image dimensions to exceed Integer.MAX_VALUE
192 private static BufferedImage toImage(QrCode qr, int scale, int border, int lightColor, int darkColor) {
194 if (scale <= 0 || border < 0)
196 if (border > Integer.MAX_VALUE / 2 || qr.size + border * 2L > Integer.MAX_VALUE / scale)
197 throw new IllegalArgumentException("Scale or border too large");
199 BufferedImage result = new BufferedImage((qr.size + border * 2) * scale, (qr.size + border * 2) * scale, BufferedImage.TYPE_INT_RGB);
202 boolean color = qr.getModule(x / scale - border, y / scale - border);
218 * number of border modules. The string always uses Unix newlines (\n), regardless of the platform.
220 * @param border the number of border modules to add, which must be non-negative
225 * @throws IllegalArgumentException if the border is negative
227 private static String toSvgString(QrCode qr, int border, String lightColor, String darkColor) {
231 if (border < 0)
233 long brd = border;