Versions in this module Expand all Collapse all v1 v1.1.0 Sep 25, 2026 v1.0.0 Sep 21, 2026 Changes in this version + const DefaultJPEGQuality + const DigestSize + const FingerprintSize + const KCVSize + const KeySize + const MaxEncodeDimension + const MaxInputSize + const MaxJPEGQuality + const MaxSize + const MinJPEGQuality + const MinSize + const Version + var ErrEmptyInput = &Error + var ErrInputTooLarge = &Error + var ErrInvalidArgument = &Error + var ErrInvalidDigest = &Error + var ErrInvalidFingerprint = &Error + var ErrInvalidFrame = &Error + var ErrInvalidHex = &Error + var ErrInvalidImage = &Error + var ErrInvalidKey = &Error + var ErrInvalidQuality = &Error + var ErrInvalidSize = &Error + var ErrLowContrast = &Error + var White = RGB + type Background struct + func Opaque(c RGB) Background + func ParseBackground(s string) (Background, error) + func Translucent(c RGB, alpha uint8) Background + func Transparent() Background + func (b *Background) UnmarshalText(text []byte) error + func (b Background) Alpha() uint8 + func (b Background) Color() RGB + func (b Background) MarshalText() ([]byte, error) + func (b Background) String() string + type BaseDigest [DigestSize]byte + func BaseDigestFromHex(s string) (BaseDigest, error) + func BaseDigestFromText(s string) (BaseDigest, error) + func BaseDigestFromUTF8(text []byte) (BaseDigest, error) + func ImportBaseDigest(b []byte) (BaseDigest, error) + func NewBaseDigest(data []byte) (BaseDigest, error) + func (d BaseDigest) String() string + type Cell struct + Color uint8 + Figure Figure + type Code int + const CodeBufferTooSmall + const CodeEmptyInput + const CodeInputTooLarge + const CodeInvalidArgument + const CodeInvalidDigest + const CodeInvalidFingerprint + const CodeInvalidFrame + const CodeInvalidHex + const CodeInvalidImage + const CodeInvalidKey + const CodeInvalidQuality + const CodeInvalidSize + const CodeLowContrast + const CodeOK + const CodeOutOfMemory + func (c Code) String() string + type ContrastReport struct + FiguresX100 int + FrameX100 int + func MeasureContrast(opts RenderOptions, page RGB) ContrastReport + type Error struct + func (e *Error) Code() Code + func (e *Error) Error() string + type Figure uint8 + const FigureCircle + const FigureNone + const FigureSquare + const FigureTriangleDown + const FigureTriangleLeft + const FigureTriangleRight + const FigureTriangleUp + func (f Figure) String() string + type Fingerprint struct + func ImportFingerprint(b []byte, mode Mode) (Fingerprint, error) + func Keyed(d BaseDigest, key *SecretKey) (Fingerprint, error) + func Universal(d BaseDigest) Fingerprint + func (fp Fingerprint) Bytes() [FingerprintSize]byte + func (fp Fingerprint) IsZero() bool + func (fp Fingerprint) Layout() Layout + func (fp Fingerprint) Mode() Mode + func (fp Fingerprint) Tag() string + type Frame uint8 + const FrameAutomatic + const FrameBrackets + const FrameChamfered + const FrameDouble + const FrameGaps + const FrameNone + const FramePlain + const FrameRounded + const FrameThick + const FrameTicks + func ParseFrame(name string) (Frame, error) + func (f *Frame) UnmarshalText(text []byte) error + func (f Frame) MarshalText() ([]byte, error) + func (f Frame) String() string + type Image struct + Height int + Pix []byte + Width int + func Render(fp Fingerprint, size int, opts RenderOptions) (*Image, error) + func (m *Image) EncodeBMP(matte RGB) ([]byte, error) + func (m *Image) EncodeJPEG(quality int, matte RGB) ([]byte, error) + func (m *Image) EncodePNG() ([]byte, error) + func (m *Image) NRGBA() *image.NRGBA + type Layout struct + Cells [16]Cell + FrameColor RGB + Mode Mode + Palette [4]RGB + type Mode uint8 + const ModeKeyed + const ModeUniversal + func ParseMode(name string) (Mode, error) + func (m *Mode) UnmarshalText(text []byte) error + func (m Mode) MarshalText() ([]byte, error) + func (m Mode) String() string + type Opacity struct + func Alpha(alpha uint8) Opacity + func ParseOpacity(s string) (Opacity, error) + func (o *Opacity) UnmarshalText(text []byte) error + func (o Opacity) Alpha() uint8 + func (o Opacity) MarshalText() ([]byte, error) + func (o Opacity) String() string + type RGB struct + B uint8 + G uint8 + R uint8 + func ParseRGB(s string) (RGB, error) + func (c *RGB) UnmarshalText(text []byte) error + func (c RGB) MarshalText() ([]byte, error) + func (c RGB) String() string + type RenderOptions struct + Background Background + Frame Frame + FrameAlpha Opacity + Shape Shape + type SecretKey struct + func NewSecretKey(b []byte) (*SecretKey, error) + func (k *SecretKey) Close() error + func (k *SecretKey) Format(f fmt.State, verb rune) + func (k *SecretKey) KCV() [KCVSize]byte + func (k *SecretKey) String() string + type Shape uint8 + const ShapeRound + const ShapeSquare + func ParseShape(name string) (Shape, error) + func (s *Shape) UnmarshalText(text []byte) error + func (s Shape) MarshalText() ([]byte, error) + func (s Shape) String() string