libdmtx 0.7.8.8
libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety.
|
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2011 Mike Laughton. More...
Go to the source code of this file.
Macros | |
#define | CHKSCHEME(s) |
In this file: | |
#define | CHKERR |
#define | CHKSIZE |
Functions | |
static int | encodeSingleScheme (DmtxByteList *input, DmtxByteList *output, int sizeIdxRequest, DmtxScheme scheme, int fnc1) |
static void | encodeNextChunk (DmtxEncodeStream *stream, int scheme, int option, int sizeIdxRequest) |
This function distributes work to the equivalent scheme-specific implementation. | |
static void | encodeChangeScheme (DmtxEncodeStream *stream, DmtxScheme targetScheme, int unlatchType) |
static int | getRemainingSymbolCapacity (int outputLength, int sizeIdx) |
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2011 Mike Laughton.
All rights reserved. Copyright 2012-2016 Vadim A. Misbakh-Soloviov. All rights reserved.
See LICENSE file in the main project directory for full terms of use and distribution.
Contact: Vadim A. Misbakh-Soloviov dmtx@.nosp@m.mva..nosp@m.name Mike Laughton mike@.nosp@m.drag.nosp@m.onfly.nosp@m.logi.nosp@m.c.com
Logic for encoding in single scheme
Definition in file dmtxencodescheme.c.
#define CHKERR |
Definition at line 83 of file dmtxencodescheme.c.
#define CHKSCHEME | ( | s | ) |
In this file:
A "word" refers to a full codeword byte to be appended to the encoded output.
A "value" refers to any scheme value being appended to the output stream, regardless of how many bytes are used to represent it. Examples:
ASCII: 1 value in 1 codeword ASCII (digits): 2 values in 1 codeword C40/Text/X12: 3 values in 2 codewords C40/Text/X12 (unlatch): 1 values in 1 codeword EDIFACT: 4 values in 3 codewords Base 256: 1 value in 1 codeword
A "chunk" refers to the minimum grouping of values in a schema that must be encoded together.
ASCII: 1 value (1 codeword) in 1 chunk ASCII (digits): 2 values (1 codeword) in 1 chunk (optional) C40/Text/X12: 3 values (2 codewords) in 1 chunk C40/Text/X12 (unlatch): 1 value (1 codeword) in 1 chunk EDIFACT: 1 value (1 codeword*) in 1 chunk Base 256: 1 value (1 codeword) in 1 chunk
Each scheme implements 3 equivalent functions:
The function encodeNextChunk() (no Scheme in the name) knows which scheme- specific implementations to call based on the stream's current encodation scheme.
It's important that encodeNextChunk[Scheme] not call CompleteIfDone[Scheme] directly because some parts of the logic might want to encode a stream without allowing the padding and other extra logic that can occur when an end-of-symbol condition is triggered.
Definition at line 74 of file dmtxencodescheme.c.
#define CHKSIZE |
Definition at line 91 of file dmtxencodescheme.c.
|
static |
Definition at line 196 of file dmtxencodescheme.c.
|
static |
This function distributes work to the equivalent scheme-specific implementation.
Each of these functions will encode the next symbol input word, and in some cases this requires additional input words to be encoded as well.
Definition at line 137 of file dmtxencodescheme.c.
|
static |
Definition at line 103 of file dmtxencodescheme.c.
|
static |
Definition at line 270 of file dmtxencodescheme.c.