QRCodeSquare

data class QRCodeSquare(    var dark: Boolean,     val row: Int,     val col: Int,     val moduleSize: Int,     val squareInfo: QRCodeSquareInfo = QRCodeSquareInfo(DEFAULT, UNKNOWN),     val rowSize: Int = 1,     val colSize: Int = 1,     val parent: QRCodeSquare? = null)(source)

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 extremities), part of a position adjustment square, part of a timing pattern or just another square as any other :)

Author

Rafael Lins - g0dkar

Constructors

Link copied to clipboard
constructor(    dark: Boolean,     row: Int,     col: Int,     moduleSize: Int,     squareInfo: QRCodeSquareInfo = QRCodeSquareInfo(DEFAULT, UNKNOWN),     rowSize: Int = 1,     colSize: Int = 1,     parent: QRCodeSquare? = null)

Properties

Link copied to clipboard
val col: Int

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

Link copied to clipboard
val colSize: Int = 1

How many actual QRCode squares this one take up? (1 = a single square, >1 = likely a probe)

Link copied to clipboard

Is this a painted square?

Link copied to clipboard

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 parent: QRCodeSquare? = null

Filled if this square is part of a larger one (like a QRCodeSquareType.POSITION_PROBE)

Link copied to clipboard
Link copied to clipboard
val row: Int

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

Link copied to clipboard
val rowSize: Int = 1

How many actual QRCode squares this one take up? (1 = a single square, >1 = likely a probe)

Link copied to clipboard

What does this square represent within the QRCode?

Functions

Link copied to clipboard
fun absoluteX(cellSize: Int = QRCodeProcessor.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 = QRCodeProcessor.DEFAULT_CELL_SIZE): Int

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

Link copied to clipboard
open operator override fun equals(other: Any?): Boolean
Link copied to clipboard
open override fun hashCode(): Int