Package io.itpl.qss.render
Class FinderElement
- java.lang.Object
-
- io.itpl.qss.render.FinderElement
-
public class FinderElement extends Object
// Finder Patters are the Square blocks that exists on three corner of QR code (Top-Left, Top-Right and Bottom-Left). QR scanner use them to detect the oriantation of the QR Code. The Finder Patterns has a Size of 7 modules irrespective of the QR version. they are buit as three components; Outer block : 7 modules Innter block : 5 modules Finder ball : 3 modules The Finder Pattern need to be rendered in ratio of 1:1:3:1:1 (each module column/row), so that scnner can detect them.
-
-
Field Summary
Fields Modifier and Type Field Description static StringALIASintballWidthintballXintballYstatic intFINDER_SIZEQR Code Finder Pattern Size is fixed as 7 module irrespective of verion of the QR.intfinderWidthintinnerFrameWidthintinnerFrameXintinnerFrameYintouterFrameXintouterFrameYfloatscaleOne module may need more then 1 pixel depending on the qr size.
-
Constructor Summary
Constructors Constructor Description FinderElement(int _version, int _size, int location)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description booleancontains(int x, int y)Rendering the QR Code data must not overlap the Functional Patterns of the QR Code.StyleConfiggetStyleConfig()voidsetStyle(StyleConfig style)static voidtest(String[] args)BufferedImagetoCircleImage()BufferedImagetoHexagoneImage()BufferedImagetoImage()BufferedImagetoOppRoundCornerSquare()BufferedImagetoRightCircleImage()BufferedImagetoRoundedCornerSquare()BufferedImagetoSquareImage()StringtoString()
-
-
-
Field Detail
-
scale
public float scale
One module may need more then 1 pixel depending on the qr size. scale determine the no's of pixels in each module.
-
FINDER_SIZE
public static final int FINDER_SIZE
QR Code Finder Pattern Size is fixed as 7 module irrespective of verion of the QR.- See Also:
- Constant Field Values
-
ALIAS
public static final String ALIAS
- See Also:
- Constant Field Values
-
finderWidth
public int finderWidth
-
outerFrameX
public int outerFrameX
-
outerFrameY
public int outerFrameY
-
innerFrameX
public int innerFrameX
-
innerFrameY
public int innerFrameY
-
innerFrameWidth
public int innerFrameWidth
-
ballX
public int ballX
-
ballY
public int ballY
-
ballWidth
public int ballWidth
-
-
Method Detail
-
toImage
public BufferedImage toImage() throws InvalidQRConfigException
- Throws:
InvalidQRConfigException
-
toSquareImage
public BufferedImage toSquareImage()
-
toRoundedCornerSquare
public BufferedImage toRoundedCornerSquare()
-
toOppRoundCornerSquare
public BufferedImage toOppRoundCornerSquare()
-
toCircleImage
public BufferedImage toCircleImage()
-
toRightCircleImage
public BufferedImage toRightCircleImage()
-
toHexagoneImage
public BufferedImage toHexagoneImage()
-
contains
public boolean contains(int x, int y)Rendering the QR Code data must not overlap the Functional Patterns of the QR Code. This method helps to determine for if provided location (x,y) is part of the FinderElement or not.- Parameters:
x- position 'x' of the QR data module. (from the encoded byte[][] data)y- position 'y' of the QR data module. (from the encoded byte[][] data)- Returns:
- true if the provided (x,y) are part of the FinderElement, else return False.
-
setStyle
public void setStyle(StyleConfig style)
-
getStyleConfig
public StyleConfig getStyleConfig()
-
test
public static void test(String[] args)
-
-