struct Goban::RMQR::Version

Defined in:

goban/rmqr/version.cr

Constant Summary

ORDERED = {ORDERED_BY_AREA, ORDERED_BY_WIDTH, ORDERED_BY_HEIGHT}
ORDERED_BY_AREA = StaticArray[VersionValue::R7x43, VersionValue::R7x59, VersionValue::R7x77, VersionValue::R7x99, VersionValue::R7x139, VersionValue::R9x43, VersionValue::R9x59, VersionValue::R9x77, VersionValue::R9x99, VersionValue::R9x139, VersionValue::R11x27, VersionValue::R11x43, VersionValue::R11x59, VersionValue::R11x77, VersionValue::R11x99, VersionValue::R11x139, VersionValue::R13x27, VersionValue::R13x43, VersionValue::R13x59, VersionValue::R13x77, VersionValue::R13x99, VersionValue::R13x139, VersionValue::R15x43, VersionValue::R15x59, VersionValue::R15x77, VersionValue::R15x99, VersionValue::R15x139, VersionValue::R17x43, VersionValue::R17x59, VersionValue::R17x77, VersionValue::R17x99, VersionValue::R17x139].sort do |a, b| a_size = SymbolDimension.new(a) b_size = SymbolDimension.new(b) (a_size.width * a_size.height) <=> (b_size.width * b_size.height) end
ORDERED_BY_HEIGHT = StaticArray[VersionValue::R7x43, VersionValue::R7x59, VersionValue::R7x77, VersionValue::R7x99, VersionValue::R7x139, VersionValue::R9x43, VersionValue::R9x59, VersionValue::R9x77, VersionValue::R9x99, VersionValue::R9x139, VersionValue::R11x27, VersionValue::R11x43, VersionValue::R11x59, VersionValue::R11x77, VersionValue::R11x99, VersionValue::R11x139, VersionValue::R13x27, VersionValue::R13x43, VersionValue::R13x59, VersionValue::R13x77, VersionValue::R13x99, VersionValue::R13x139, VersionValue::R15x43, VersionValue::R15x59, VersionValue::R15x77, VersionValue::R15x99, VersionValue::R15x139, VersionValue::R17x43, VersionValue::R17x59, VersionValue::R17x77, VersionValue::R17x99, VersionValue::R17x139].sort do |a, b| a_size = SymbolDimension.new(a) b_size = SymbolDimension.new(b) cmp = a_size.height <=> b_size.height if cmp == 0 cmp = a_size.width <=> b_size.width end cmp end
ORDERED_BY_WIDTH = StaticArray[VersionValue::R7x43, VersionValue::R7x59, VersionValue::R7x77, VersionValue::R7x99, VersionValue::R7x139, VersionValue::R9x43, VersionValue::R9x59, VersionValue::R9x77, VersionValue::R9x99, VersionValue::R9x139, VersionValue::R11x27, VersionValue::R11x43, VersionValue::R11x59, VersionValue::R11x77, VersionValue::R11x99, VersionValue::R11x139, VersionValue::R13x27, VersionValue::R13x43, VersionValue::R13x59, VersionValue::R13x77, VersionValue::R13x99, VersionValue::R13x139, VersionValue::R15x43, VersionValue::R15x59, VersionValue::R15x77, VersionValue::R15x99, VersionValue::R15x139, VersionValue::R17x43, VersionValue::R17x59, VersionValue::R17x77, VersionValue::R17x99, VersionValue::R17x139].sort do |a, b| a_size = SymbolDimension.new(a) b_size = SymbolDimension.new(b) cmp = a_size.width <=> b_size.width if cmp == 0 cmp = a_size.height <=> b_size.height end cmp end
VERSION_BITS = { {Medium: {129714, 133755}, High: {258919, 942}}, {Medium: {124311, 136542}, High: {257090, 7307}}, {Medium: {121821, 142100}, High: {250376, 8897}}, {Medium: {115960, 144433}, High: {249133, 15844}}, {Medium: {112748, 149669}, High: {242105, 16752}}, {Medium: {108361, 153472}, High: {241308, 24149}}, {Medium: {104707, 158154}, High: {233686, 24607}}, {Medium: {99878, 161519}, High: {233459, 32570}}, {Medium: {98062, 167879}, High: {227035, 34322}}, {Medium: {90155, 168162}, High: {223742, 39223}}, {Medium: {89697, 175784}, High: {219060, 42877}}, {Medium: {82244, 176525}, High: {215185, 47192}}, {Medium: {81360, 183577}, High: {209925, 50380}}, {Medium: {74485, 184892}, High: {207648, 56297}}, {Medium: {72895, 191606}, High: {202090, 58787}}, {Medium: {66458, 193363}, High: {199247, 64134}}, {Medium: {61898, 196867}, High: {194591, 67798}}, {Medium: {61167, 204326}, High: {190266, 71667}}, {Medium: {53413, 204908}, High: {186736, 76217}}, {Medium: {53120, 212809}, High: {181845, 79516}}, {Medium: {45844, 213981}, High: {178881, 84488}}, {Medium: {44081, 220408}, High: {173540, 87341}}, {Medium: {37499, 221874}, High: {170926, 93031}}, {Medium: {36190, 228759}, High: {165003, 95298}}, {Medium: {29814, 230591}, High: {163235, 101738}}, {Medium: {27475, 236442}, High: {156294, 102991}}, {Medium: {21785, 239056}, High: {154828, 109573}}, {Medium: {19004, 244469}, High: {148457, 111392}}, {Medium: {13992, 247393}, High: {147325, 118708}}, {Medium: {10637, 252228}, High: {139352, 118929}}, {Medium: {6087, 255758}, High: {138770, 126683}}, {Medium: {2274, 260139}, High: {131383, 127486}} }

Constructors

Instance Method Summary

Instance methods inherited from struct Goban::AbstractQR::Version

<=>(other : Int) <=>, symbol_size symbol_size, to_i to_i, value value

Constructor Detail

def self.new(width : Int, height : Int) #

def self.new(value : VersionValue) #

def self.new(str : String) #

def self.new(value : Int) #

Instance Method Detail

def <=>(other : Int) #
Description copied from module Comparable(Int)

The comparison operator. Returns 0 if the two objects are equal, a negative number if this object is considered less than other, a positive number if this object is considered greater than other, or nil if the two objects are not comparable.

Subclasses define this method to provide class-specific ordering.

The comparison operator is usually used to sort values:

# Sort in a descending way:
[3, 1, 2].sort { |x, y| y <=> x } # => [3, 2, 1]

# Sort in an ascending way:
[3, 1, 2].sort { |x, y| x <=> y } # => [1, 2, 3]

def max_data_bits(ecl : ECC::Level) #

Maximum number of data bits that can be contained in the rMQR Code symbol of this version. This does not include the number of error correction codewords.


def max_data_codewords(ecl : ECC::Level) #

Maximum number of data codewords that can be contained in the rMQR Code symbol of this version. This does not include the number of error correction codewords.


def to_i #