Package io.itpl.qss.render
Class QRCode
- java.lang.Object
-
- io.itpl.qss.render.QRCode
-
public class QRCode extends Object
This Class represent the Logical model of the QR code and rendering of the QR Code image.
-
-
Constructor Summary
Constructors Constructor Description QRCode(String data, int version, int size)QRCode(String data, int version, int size, int errorLevel, StyleConfig style)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StyleConfiggetStyleConfig()static Graphics2Dof(BufferedImage source)Render the QRCode to the Image and return it as a BufferedImage.voidsetStyle(StyleConfig style)BufferedImagetoImage()StringtoString()
-
-
-
Constructor Detail
-
QRCode
public QRCode(String data, int version, int size) throws QREncoderException
- Throws:
QREncoderException
-
QRCode
public QRCode(String data, int version, int size, int errorLevel, StyleConfig style) throws QREncoderException
- Parameters:
data- Text Data which need to be encoded in QR Code.version- Version of the QR Code to be used.size- Size of the QR Code.errorLevel- level of Error Correction in QR Code.style- StyleConfig to define the Visual appearance of the QR Code.- Throws:
QREncoderException- in case of mistatch of given argument data.
-
-
Method Detail
-
toString
public String toString()
-
setStyle
public void setStyle(StyleConfig style)
- Parameters:
style- StyleConfig object to which will be replaced with current style.
-
getStyleConfig
public StyleConfig getStyleConfig()
- Returns:
- StyleConfig property of the QRCode object.
-
of
public static Graphics2D of(BufferedImage source)
Render the QRCode to the Image and return it as a BufferedImage.- Parameters:
source- Input Buffered Image- Returns:
- BufferedImage of the QRCode. The image will contain only QRCode, without any logo image or margins.
-
toImage
public BufferedImage toImage() throws InvalidQRConfigException
- Throws:
InvalidQRConfigException
-
-