Package com.core.util.qrcode.decorator
Class ImageOverlay
- java.lang.Object
-
- com.core.util.qrcode.decorator.ImageOverlay
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.Float
DEFAULT_OVERLAY_TO_QRCODE_RATIO
static java.lang.Float
DEFAULT_OVERLAY_TRANSPARENCY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static Decorator<java.awt.image.BufferedImage>
addImageOverlay(java.awt.image.BufferedImage overlay, java.lang.Float overlayTransparency, java.lang.Float overlayToQRCodeRatio)
java.awt.image.BufferedImage
decorate(java.awt.image.BufferedImage qrcode)
-
-
-
Method Detail
-
addImageOverlay
public static Decorator<java.awt.image.BufferedImage> addImageOverlay(java.awt.image.BufferedImage overlay, java.lang.Float overlayTransparency, java.lang.Float overlayToQRCodeRatio)
- Parameters:
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 .20- Throws:
java.lang.IllegalArgumentException
- - if the overlay is null
-
-