module Goban::RMQR::Encoder

Extended Modules

Defined in:

goban/rmqr/encoder.cr

Instance Method Summary

Instance Method Detail

def determine_version_and_segments(text : String, ecl : ECC::Level, strategy : SizingStrategy) : Tuple(Array(Segment), RMQR::Version) #

Returns a tuple of the optimized segments and rMQR Code version for the given text and error correction level.


[View source]
def encode_segments(segments : Array(Segment), ecl : ECC::Level, version : Version | VersionValue) #

Creates a new rMQR Code object for the given data segments, error correction level, and rMQR Code version that is large enough to contain all the data in the segments.

See QR::Encoder.encode_segments for more information.


[View source]
def encode_string(text : String, ecl : ECC::Level = ECC::Level::Medium, strategy : SizingStrategy = SizingStrategy::MinimizeArea) #

Creates a new Micro QR Code object for the given string, error correction level, and sizing strategy.

Unlike regular QR Codes and Micro QR Codes, rMQR Codes has different sizes in width and height, which means that there can be multiple versions that are optimal in terms of capacity. SizingStrategy is used to prioritize one version than the other based on whether you want the symbol to be smaller in total area, width, or height. By default, it tries to balance the width and height, keeping the total area as small as possible.

See QR::Encoder.encode_string for more information.


[View source]