qrcode-core-0.9.1: QR code library in pure Haskell

Safe HaskellNone
LanguageHaskell2010

Codec.QRCode.Intermediate

Contents

Synopsis

Generators

The results of the different generators can be appended using <>.

mixed :: ToText a => TextEncoding -> a -> Result QRSegment Source #

Encode a string using any mode that seems fit, will encode the input in parts, each as numeric, alphanumeric, kanji and text based on the contents.

Please refer to the specific documentations for details.

Should result in the shortest encoded data.

automatic :: ToText a => TextEncoding -> a -> Result QRSegment Source #

Encode a whole string using the mode with the shortest result. Will pick either numeric, alphanumeric, kanji or text based on the contents.

Please refer to the specific documentations for details.

text :: ToText a => TextEncoding -> a -> Result QRSegment Source #

Generate a segment representing the specified text data encoded as ISO-8859-1 or UTF-8 (with or without ECI) in byte mode.

Please refer to TextEncoding on what the difference is.

In case you want to encode as ISO-8859-1 and already have a [Word8] or similar you can use binary as it creates the same result.

binary :: ToBinary a => a -> QRSegment Source #

Generate a segment representing the specified binary data in byte mode.

kanji :: ToText a => a -> Result QRSegment Source #

Generate a segment representing the specified text data encoded as QR code Kanji.

Since this encoding does neither contain ASCII nor the half width katakana characters it may be impossible to encode all text in this encoding.

But it is possible to encode some of it and combine it with others like ISO-8859-1.

alphanumeric :: ToText a => a -> Result QRSegment Source #

Generate a segment representing the specified text string encoded in alphanumeric mode.

The alphanumeric encoding contains this characters: "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:".

When the input is case insensitive the chars are converted to uppercase since this alphabet contains only uppercase characters. This can be archived by applying mk to the input.

numeric :: ToNumeric a => a -> Result QRSegment Source #

Generate a segment representing the specified string of decimal digits encoded in numeric mode.

eci :: Int -> Result QRSegment Source #

Generate a segment representing an Extended Channel Interpretation (ECI) designator with the specified assignment value.

Intermediate

intermediate :: QRCodeOptions -> QRSegment -> Result QRIntermediate Source #

Convert segments into an intermediate state. This is the first point where it can be guaranteed that there will be an result. The Version and ErrorLevel is already determined at this point.

Encoder

encode :: QRIntermediate -> QRImage Source #

Convert the intermediate state into an image.

Re-Exports