Documentation ¶
Index ¶
- Constants
- func EncodeHighLevel(msg string, opts Options) ([]byte, error)
- func ErrorCorrection_EncodeECC200(codewords []byte, symbolInfo *SymbolInfo) ([]byte, error)
- func HighLevelEncoder_determineConsecutiveDigitCount(msg []byte, startpos int) int
- func HighLevelEncoder_isDigit(ch byte) bool
- func HighLevelEncoder_isExtendedASCII(ch byte) bool
- func HighLevelEncoder_lookAheadTest(msg []byte, startpos, currentMode int) int
- type ASCIIEncoder
- type Base256Encoder
- type ByteMatrix
- func (matrix *ByteMatrix) Clear(value int8)
- func (matrix *ByteMatrix) Get(x, y int) int8
- func (matrix *ByteMatrix) GetArray() [][]int8
- func (matrix *ByteMatrix) GetHeight() int
- func (matrix *ByteMatrix) GetWidth() int
- func (matrix *ByteMatrix) Set(x, y int, value int8)
- func (matrix *ByteMatrix) SetBool(x, y int, value bool)
- func (matrix *ByteMatrix) String() string
- type C40Encoder
- type DefaultPlacement
- type Dimension
- type EdifactEncoder
- type Encoder
- type EncoderContext
- func (ec *EncoderContext) GetCodewordCount() int
- func (ec *EncoderContext) GetCodewords() []byte
- func (ec *EncoderContext) GetCurrent() byte
- func (ec *EncoderContext) GetCurrentChar() byte
- func (ec *EncoderContext) GetMessage() []byte
- func (ec *EncoderContext) GetNewEncoding() int
- func (ec *EncoderContext) GetRemainingCharacters() int
- func (ec *EncoderContext) GetSymbolInfo() *SymbolInfo
- func (ec *EncoderContext) HasMoreCharacters() bool
- func (ec *EncoderContext) ResetEncoderSignal()
- func (ec *EncoderContext) ResetSymbolInfo()
- func (ec *EncoderContext) SetSizeConstraints(minSize, maxSize *Dimension)
- func (ec *EncoderContext) SetSkipAtEnd(count int)
- func (ec *EncoderContext) SetSymbolShape(shape SymbolShapeHint)
- func (ec *EncoderContext) SignalEncoderChange(encoding int)
- func (ec *EncoderContext) UpdateSymbolInfo() error
- func (ec *EncoderContext) UpdateSymbolInfoByLength(len int) error
- func (ec *EncoderContext) WriteCodeword(codeword byte)
- func (ec *EncoderContext) WriteCodewords(codewords []byte)
- type Options
- type SymbolInfo
- func (si *SymbolInfo) GetCodewordCount() int
- func (si *SymbolInfo) GetDataCapacity() int
- func (si *SymbolInfo) GetDataLengthForInterleavedBlock(index int) int
- func (si *SymbolInfo) GetErrorCodewords() int
- func (si *SymbolInfo) GetErrorLengthForInterleavedBlock(index int) int
- func (si *SymbolInfo) GetInterleavedBlockCount() int
- func (si *SymbolInfo) GetMatrixHeight() int
- func (si *SymbolInfo) GetMatrixWidth() int
- func (si *SymbolInfo) GetSymbolDataHeight() int
- func (si *SymbolInfo) GetSymbolDataWidth() int
- func (si *SymbolInfo) GetSymbolHeight() int
- func (si *SymbolInfo) GetSymbolWidth() int
- func (si *SymbolInfo) String() string
- type SymbolShapeHint
- type X12Encoder
Constants ¶
const ( // Padding character HighLevelEncoder_PAD = 129 // mode latch to C40 encodation mode HighLevelEncoder_LATCH_TO_C40 = 230 // mode latch to Base 256 encodation mode HighLevelEncoder_LATCH_TO_BASE256 = 231 // FNC1 Codeword HighLevelEncoder_FUNC1 = 232 // Upper Shift HighLevelEncoder_UPPER_SHIFT = 235 // 05 Macro HighLevelEncoder_MACRO_05 = 236 // 06 Macro HighLevelEncoder_MACRO_06 = 237 // mode latch to ANSI X.12 encodation mode HighLevelEncoder_LATCH_TO_ANSIX12 = 238 // mode latch to Text encodation mode HighLevelEncoder_LATCH_TO_TEXT = 239 // mode latch to EDIFACT encodation mode HighLevelEncoder_LATCH_TO_EDIFACT = 240 // Unlatch from C40 encodation HighLevelEncoder_C40_UNLATCH = 254 // Unlatch from X12 encodation HighLevelEncoder_X12_UNLATCH = 254 // 05 Macro header HighLevelEncoder_MACRO_05_HEADER = "[)>\u001E05\u001D" // 06 Macro header HighLevelEncoder_MACRO_06_HEADER = "[)>\u001E06\u001D" // Macro trailer HighLevelEncoder_MACRO_TRAILER = "\u001E\u0004" HighLevelEncoder_ASCII_ENCODATION = 0 HighLevelEncoder_C40_ENCODATION = 1 HighLevelEncoder_TEXT_ENCODATION = 2 HighLevelEncoder_X12_ENCODATION = 3 HighLevelEncoder_EDIFACT_ENCODATION = 4 HighLevelEncoder_BASE256_ENCODATION = 5 )
const ( SymbolShapeHint_FORCE_NONE = SymbolShapeHint(iota) SymbolShapeHint_FORCE_SQUARE SymbolShapeHint_FORCE_RECTANGLE )
Variables ¶
This section is empty.
Functions ¶
func EncodeHighLevel ¶
EncodeHighLevel Performs message encoding of a DataMatrix message using the algorithm described in annex P of ISO/IEC 16022:2000(E).
func ErrorCorrection_EncodeECC200 ¶
func ErrorCorrection_EncodeECC200(codewords []byte, symbolInfo *SymbolInfo) ([]byte, error)
createECC200 Creates the ECC200 error correction for an encoded message.
@param codewords the codewords @param symbolInfo information about the symbol to be encoded @return the codewords with interleaved error correction.
func HighLevelEncoder_determineConsecutiveDigitCount ¶
determineConsecutiveDigitCount Determines the number of consecutive characters that are encodable using numeric compaction.
@param msg the message @param startpos the start position within the message @return the requested character count
Types ¶
type ASCIIEncoder ¶
type ASCIIEncoder struct{}
type Base256Encoder ¶
type Base256Encoder struct{}
type ByteMatrix ¶
type ByteMatrix struct {
// contains filtered or unexported fields
}
func NewByteMatrix ¶
func NewByteMatrix(width, height int) *ByteMatrix
func (*ByteMatrix) Clear ¶
func (matrix *ByteMatrix) Clear(value int8)
func (*ByteMatrix) Get ¶
func (matrix *ByteMatrix) Get(x, y int) int8
func (*ByteMatrix) GetArray ¶
func (matrix *ByteMatrix) GetArray() [][]int8
func (*ByteMatrix) GetHeight ¶
func (matrix *ByteMatrix) GetHeight() int
func (*ByteMatrix) GetWidth ¶
func (matrix *ByteMatrix) GetWidth() int
func (*ByteMatrix) Set ¶
func (matrix *ByteMatrix) Set(x, y int, value int8)
func (*ByteMatrix) SetBool ¶
func (matrix *ByteMatrix) SetBool(x, y int, value bool)
func (*ByteMatrix) String ¶
func (matrix *ByteMatrix) String() string
type C40Encoder ¶
type C40Encoder struct {
// contains filtered or unexported fields
}
type DefaultPlacement ¶
type DefaultPlacement struct {
// contains filtered or unexported fields
}
func NewDefaultPlacement ¶
func NewDefaultPlacement(codewords []byte, numcols, numrows int) *DefaultPlacement
func (*DefaultPlacement) GetBit ¶
func (dp *DefaultPlacement) GetBit(col, row int) bool
func (*DefaultPlacement) Place ¶
func (dp *DefaultPlacement) Place()
type Dimension ¶
func NewDimension ¶
type EdifactEncoder ¶
type EdifactEncoder struct{}
type Encoder ¶
type Encoder interface {
// contains filtered or unexported methods
}
func NewASCIIEncoder ¶
func NewASCIIEncoder() Encoder
func NewBase256Encoder ¶
func NewBase256Encoder() Encoder
func NewC40Encoder ¶
func NewC40Encoder() Encoder
func NewEdifactEncoder ¶
func NewEdifactEncoder() Encoder
func NewTextEncoder ¶
func NewTextEncoder() Encoder
func NewX12Encoder ¶
func NewX12Encoder() Encoder
type EncoderContext ¶
type EncoderContext struct {
// contains filtered or unexported fields
}
func NewEncoderContext ¶
func NewEncoderContext(msg string) (*EncoderContext, error)
func (*EncoderContext) GetCodewordCount ¶
func (ec *EncoderContext) GetCodewordCount() int
func (*EncoderContext) GetCodewords ¶
func (ec *EncoderContext) GetCodewords() []byte
func (*EncoderContext) GetCurrent ¶
func (ec *EncoderContext) GetCurrent() byte
func (*EncoderContext) GetCurrentChar ¶
func (ec *EncoderContext) GetCurrentChar() byte
func (*EncoderContext) GetMessage ¶
func (ec *EncoderContext) GetMessage() []byte
func (*EncoderContext) GetNewEncoding ¶
func (ec *EncoderContext) GetNewEncoding() int
func (*EncoderContext) GetRemainingCharacters ¶
func (ec *EncoderContext) GetRemainingCharacters() int
func (*EncoderContext) GetSymbolInfo ¶
func (ec *EncoderContext) GetSymbolInfo() *SymbolInfo
func (*EncoderContext) HasMoreCharacters ¶
func (ec *EncoderContext) HasMoreCharacters() bool
func (*EncoderContext) ResetEncoderSignal ¶
func (ec *EncoderContext) ResetEncoderSignal()
func (*EncoderContext) ResetSymbolInfo ¶
func (ec *EncoderContext) ResetSymbolInfo()
func (*EncoderContext) SetSizeConstraints ¶
func (ec *EncoderContext) SetSizeConstraints(minSize, maxSize *Dimension)
func (*EncoderContext) SetSkipAtEnd ¶
func (ec *EncoderContext) SetSkipAtEnd(count int)
func (*EncoderContext) SetSymbolShape ¶
func (ec *EncoderContext) SetSymbolShape(shape SymbolShapeHint)
func (*EncoderContext) SignalEncoderChange ¶
func (ec *EncoderContext) SignalEncoderChange(encoding int)
func (*EncoderContext) UpdateSymbolInfo ¶
func (ec *EncoderContext) UpdateSymbolInfo() error
func (*EncoderContext) UpdateSymbolInfoByLength ¶
func (ec *EncoderContext) UpdateSymbolInfoByLength(len int) error
func (*EncoderContext) WriteCodeword ¶
func (ec *EncoderContext) WriteCodeword(codeword byte)
func (*EncoderContext) WriteCodewords ¶
func (ec *EncoderContext) WriteCodewords(codewords []byte)
type Options ¶
type Options struct { MinSize *Dimension MaxSize *Dimension Shape SymbolShapeHint Gs1 bool }
type SymbolInfo ¶
type SymbolInfo struct {
// contains filtered or unexported fields
}
func NewDataMatrixSymbolInfo144 ¶
func NewDataMatrixSymbolInfo144() *SymbolInfo
func NewSymbolInfo ¶
func NewSymbolInfo(rectangular bool, dataCapacity, errorCodewords, matrixWidth, matrixHeight, dataRegions int) *SymbolInfo
func NewSymbolInfoRS ¶
func NewSymbolInfoRS(rectangular bool, dataCapacity, errorCodewords, matrixWidth, matrixHeight, dataRegions, rsBlockData, rsBlockError int) *SymbolInfo
func SymbolInfo_Lookup ¶
func SymbolInfo_Lookup(dataCodewords int, opts Options, fail bool) (*SymbolInfo, error)
func (*SymbolInfo) GetCodewordCount ¶
func (si *SymbolInfo) GetCodewordCount() int
func (*SymbolInfo) GetDataCapacity ¶
func (si *SymbolInfo) GetDataCapacity() int
func (*SymbolInfo) GetDataLengthForInterleavedBlock ¶
func (si *SymbolInfo) GetDataLengthForInterleavedBlock(index int) int
func (*SymbolInfo) GetErrorCodewords ¶
func (si *SymbolInfo) GetErrorCodewords() int
func (*SymbolInfo) GetErrorLengthForInterleavedBlock ¶
func (si *SymbolInfo) GetErrorLengthForInterleavedBlock(index int) int
func (*SymbolInfo) GetInterleavedBlockCount ¶
func (si *SymbolInfo) GetInterleavedBlockCount() int
func (*SymbolInfo) GetMatrixHeight ¶
func (si *SymbolInfo) GetMatrixHeight() int
func (*SymbolInfo) GetMatrixWidth ¶
func (si *SymbolInfo) GetMatrixWidth() int
func (*SymbolInfo) GetSymbolDataHeight ¶
func (si *SymbolInfo) GetSymbolDataHeight() int
func (*SymbolInfo) GetSymbolDataWidth ¶
func (si *SymbolInfo) GetSymbolDataWidth() int
func (*SymbolInfo) GetSymbolHeight ¶
func (si *SymbolInfo) GetSymbolHeight() int
func (*SymbolInfo) GetSymbolWidth ¶
func (si *SymbolInfo) GetSymbolWidth() int
func (*SymbolInfo) String ¶
func (si *SymbolInfo) String() string
type SymbolShapeHint ¶
type SymbolShapeHint int
SymbolShapeHint Enumeration for DataMatrix symbol shape hint. It can be used to force square or rectangular symbols.
type X12Encoder ¶
type X12Encoder struct{}