struct Goban::Segment

Overview

Represents a segment of QR Code data that holds its data bits and encoding type.

Defined in:

goban/segment.cr
goban/segment/mode.cr
goban/segment/segmenter.cr

Constant Summary

ALPHANUMERIC_CHARS = {'0', '1', '2', '3', '4', '5', '6', '7', '8', '9', 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R', 'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z', ' ', '$', '%', '*', '+', '-', '.', '/', ':'}

Constructors

Class Method Summary

Instance Method Summary

Constructor Detail

def self.new(mode : Mode, text : String) #

Class Method Detail

def self.alphanumeric(text : String) #

Shorthand method for creating a Alphanumeric mode segment.


def self.byte(text : String) #

Shorthand method for creating a Byte mode segment.


def self.count_total_bits(segments : Array(Segment), version : AbstractQR::Version) #

Count number of bits in the given list of segments.


def self.kanji(text : String) #

Shorthand method for creating a Kanji mode segment.


def self.numeric(text : String) #

Shorthand method for creating a Numeric mode segment.


Instance Method Detail

def bit_size : Int32 #

def char_count : Int32 #

def mode : Mode #

def text : String #