Safe Haskell | None |
---|---|
Language | Haskell2010 |
Synopsis
- encode :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage
- encodeAutomatic :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage
- encodeText :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage
- encodeBinary :: ToBinary a => QRCodeOptions -> a -> Maybe QRImage
- encodeKanji :: ToText a => QRCodeOptions -> a -> Maybe QRImage
- encodeAlphanumeric :: ToText a => QRCodeOptions -> a -> Maybe QRImage
- encodeNumeric :: ToNumeric a => QRCodeOptions -> a -> Maybe QRImage
- module Codec.QRCode.Data.QRCodeOptions
- module Codec.QRCode.Data.ErrorLevel
- module Codec.QRCode.Data.Mask
- module Codec.QRCode.Data.TextEncoding
- module Codec.QRCode.Data.ToInput
- module Codec.QRCode.Data.QRImage
Encoders
encode :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage Source #
Encode a string into an QR code using any mode that seems fit, will encode the input in parts, each as
encodeNumeric
, encodeAlphanumeric
, encodeKanji
and encodeText
based on the contents.
Please refer to the specific documentations for details.
Should result in the shortest encoded data.
encodeAutomatic :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage Source #
Encode a whole string into an QR code using the mode with the shortest result.
Will pick either encodeNumeric
, encodeAlphanumeric
, encodeKanji
or encodeText
based on the contents.
Please refer to the specific documentations for details.
encodeText :: ToText a => QRCodeOptions -> TextEncoding -> a -> Maybe QRImage Source #
Generate a QR code 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 encodeBinary
as it creates the same result.
encodeBinary :: ToBinary a => QRCodeOptions -> a -> Maybe QRImage Source #
Generate a QR code representing the specified binary data in byte mode.
encodeKanji :: ToText a => QRCodeOptions -> a -> Maybe QRImage Source #
Generate a QR code 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.
encodeAlphanumeric :: ToText a => QRCodeOptions -> a -> Maybe QRImage Source #
Generate a QR code 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.
encodeNumeric :: ToNumeric a => QRCodeOptions -> a -> Maybe QRImage Source #
Generate a QR code representing the specified string of decimal digits encoded in numeric mode.
Re-Exports
module Codec.QRCode.Data.ErrorLevel
module Codec.QRCode.Data.Mask
module Codec.QRCode.Data.ToInput
module Codec.QRCode.Data.QRImage