QRCodeSquare

data class QRCodeSquare(dark: Boolean, row: Int, col: Int, moduleSize: Int, type: QRCodeSquareType)

Represents a single QRCode square unit. It has information about its "color" (either dark or bright), its position (row and column) and what it represents.

It can be part of a position probe (aka those big squares at the extermities), part of a position ajustment square, part of a timing pattern or just another square as any other :)

Author

Rafael Lins - g0dkar

Constructors

Link copied to clipboard
fun QRCodeSquare(dark: Boolean, row: Int, col: Int, moduleSize: Int, type: QRCodeSquareType = QRCodeSquareType.DEFAULT)

Functions

Link copied to clipboard
fun absoluteX(cellSize: Int = QRCode.DEFAULT_CELL_SIZE): Int

Calculates where is the X position where this square will be in the main QRCode image given a cellSize.

Link copied to clipboard
fun absoluteY(cellSize: Int = QRCode.DEFAULT_CELL_SIZE): Int

Calculates where is the Y position where this square will be in the main QRCode image given a cellSize.

Properties

Link copied to clipboard
val col: Int

The column (left-to-right) that this square represents.

Link copied to clipboard
var dark: Boolean

Is this a painted square?

Link copied to clipboard
val moduleSize: Int

How big is the whole QRCode matrix? (e.g. if this is "16" then this is part of a 16x16 matrix)

Link copied to clipboard
val row: Int

The row (top-to-bottom) that this square represents.

Link copied to clipboard
val type: QRCodeSquareType

What does this square represent within the QRCode?