public class ImageOverlay extends Object implements Decorator<BufferedImage>
| Modifier and Type | Field and Description |
|---|---|
static Float |
DEFAULT_OVERLAY_TO_QRCODE_RATIO |
static Float |
DEFAULT_OVERLAY_TRANSPARENCY |
| Modifier and Type | Method and Description |
|---|---|
static Decorator<BufferedImage> |
addImageOverlay(BufferedImage overlay,
Float overlayTransparency,
Float overlayToQRCodeRatio) |
BufferedImage |
decorate(BufferedImage qrcode) |
public static final Float DEFAULT_OVERLAY_TRANSPARENCY
public static final Float DEFAULT_OVERLAY_TO_QRCODE_RATIO
public static Decorator<BufferedImage> addImageOverlay(BufferedImage overlay, Float overlayTransparency, Float overlayToQRCodeRatio)
overlay - - the image to be over rendered on top of the qrcodeoverlayTransparency - - the overlays transparency from 0..1 where one is no transparency.
Default is set to 1overlayToQRCodeRatio - - Specifies the ratio between the overlay image and the QRCode in percentage like 0.20 = 20%.
Overlays should as a guide not take up more 25% of the QRCode or else the readability of the code could be compromised
Default is set to 25%
It's safe to add a overlay that takes up more than 25%, if the transparency is less than .20IllegalArgumentException - - if the overlay is nullpublic BufferedImage decorate(BufferedImage qrcode)
decorate in interface Decorator<BufferedImage>Copyright © 2020. All rights reserved.