libdmtx 0.7.8.7
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 2008, 2009 Mike Laughton. More...
Go to the source code of this file.
Classes | |
struct | DmtxFollow_struct |
struct | DmtxBresLine_struct |
struct | C40TextState_struct |
struct | DmtxLogEvent_struct |
Typedefs | |
typedef enum DmtxEncodeOption_enum | DmtxEncodeOption |
typedef enum DmtxRange_enum | DmtxRange |
typedef enum DmtxEdge_enum | DmtxEdge |
typedef enum DmtxMaskBit_enum | DmtxMaskBit |
typedef struct DmtxFollow_struct | DmtxFollow |
typedef struct DmtxBresLine_struct | DmtxBresLine |
typedef struct C40TextState_struct | C40TextState |
typedef struct DmtxLogEvent_struct | DmtxLogEvent |
typedef void(* | DmtxLogFn) (DmtxLogEvent *ev) |
typedef void(* | DmtxLogLockFn) (DmtxBoolean lock, void *udata) |
Enumerations | |
enum | DmtxEncodeOption_enum { DmtxEncodeNormal , DmtxEncodeCompact , DmtxEncodeFull } |
enum | DmtxRange_enum { DmtxRangeGood , DmtxRangeBad , DmtxRangeEnd } |
enum | DmtxEdge_enum { DmtxEdgeTop = 0x01 << 0 , DmtxEdgeBottom = 0x01 << 1 , DmtxEdgeLeft = 0x01 << 2 , DmtxEdgeRight = 0x01 << 3 } |
enum | DmtxMaskBit_enum { DmtxMaskBit8 = 0x01 << 0 , DmtxMaskBit7 = 0x01 << 1 , DmtxMaskBit6 = 0x01 << 2 , DmtxMaskBit5 = 0x01 << 3 , DmtxMaskBit4 = 0x01 << 4 , DmtxMaskBit3 = 0x01 << 5 , DmtxMaskBit2 = 0x01 << 6 , DmtxMaskBit1 = 0x01 << 7 } |
enum | DmtxErrorMessage { DmtxErrorUnknown , DmtxErrorUnsupportedCharacter , DmtxErrorNotOnByteBoundary , DmtxErrorIllegalParameterValue , DmtxErrorEmptyList , DmtxErrorOutOfBounds , DmtxErrorMessageTooLarge , DmtxErrorCantCompactNonDigits , DmtxErrorUnexpectedScheme , DmtxErrorIncompleteValueList } |
Functions | |
static double | rightAngleTrueness (DmtxVector2 c0, DmtxVector2 c1, DmtxVector2 c2, double angle) |
static DmtxPointFlow | matrixRegionSeekEdge (DmtxDecode *dec, DmtxPixelLoc loc0) |
static DmtxPassFail | matrixRegionOrientation (DmtxDecode *dec, DmtxRegion *reg, DmtxPointFlow flowBegin) |
static long | distanceSquared (DmtxPixelLoc a, DmtxPixelLoc b) |
static int | readModuleColor (DmtxDecode *dec, DmtxRegion *reg, int symbolRow, int symbolCol, int sizeIdx, int colorPlane) |
static DmtxPassFail | matrixRegionFindSize (DmtxDecode *dec, DmtxRegion *reg) |
static int | countJumpTally (DmtxDecode *dec, DmtxRegion *reg, int xStart, int yStart, DmtxDirection dir) |
static DmtxPointFlow | getPointFlow (DmtxDecode *dec, int colorPlane, DmtxPixelLoc loc, int arrive) |
static DmtxPointFlow | findStrongestNeighbor (DmtxDecode *dec, DmtxPointFlow center, int sign) |
static DmtxFollow | followSeek (DmtxDecode *dec, DmtxRegion *reg, int seek) |
static DmtxFollow | followSeekLoc (DmtxDecode *dec, DmtxPixelLoc loc) |
static DmtxFollow | followStep (DmtxDecode *dec, DmtxRegion *reg, DmtxFollow followBeg, int sign) |
static DmtxFollow | followStep2 (DmtxDecode *dec, DmtxFollow followBeg, int sign) |
static DmtxPassFail | trailBlazeContinuous (DmtxDecode *dec, DmtxRegion *reg, DmtxPointFlow flowBegin, int maxDiagonal) |
static int | trailBlazeGapped (DmtxDecode *dec, DmtxRegion *reg, DmtxBresLine line, int streamDir) |
static int | trailClear (DmtxDecode *dec, DmtxRegion *reg, int clearMask) |
static DmtxBestLine | findBestSolidLine (DmtxDecode *dec, DmtxRegion *reg, int step0, int step1, int streamDir, int houghAvoid) |
static DmtxBestLine | findBestSolidLine2 (DmtxDecode *dec, DmtxPixelLoc loc0, int tripSteps, int sign, int houghAvoid) |
static DmtxPassFail | findTravelLimits (DmtxDecode *dec, DmtxRegion *reg, DmtxBestLine *line) |
static DmtxPassFail | matrixRegionAlignCalibEdge (DmtxDecode *dec, DmtxRegion *reg, int edgeLoc) |
static DmtxBresLine | bresLineInit (DmtxPixelLoc loc0, DmtxPixelLoc loc1, DmtxPixelLoc locInside) |
static DmtxPassFail | bresLineGetStep (DmtxBresLine line, DmtxPixelLoc target, int *travel, int *outward) |
static DmtxPassFail | bresLineStep (DmtxBresLine *line, int travel, int outward) |
static void | tallyModuleJumps (DmtxDecode *dec, DmtxRegion *reg, INOUT int tally[][24], int xOrigin, int yOrigin, int mapWidth, int mapHeight, DmtxDirection dir) |
static DmtxPassFail | populateArrayFromMatrix (DmtxDecode *dec, DmtxRegion *reg, OUT DmtxMessage *msg) |
static DmtxPassFail | decodeDataStream (DmtxMessage *msg, int sizeIdx, unsigned char *outputStart) |
Translate encoded data stream into final output. | |
static int | getEncodationScheme (unsigned char cw) |
static void | pushOutputWord (DmtxMessage *msg, int value) |
static void | pushOutputC40TextWord (DmtxMessage *msg, C40TextState *state, int value) |
static void | pushOutputMacroHeader (DmtxMessage *msg, int macroType) |
static void | pushOutputMacroTrailer (DmtxMessage *msg) |
static unsigned char * | decodeSchemeAscii (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd) |
static unsigned char * | decodeSchemeC40Text (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd, DmtxScheme encScheme) |
static unsigned char * | decodeSchemeX12 (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd) |
static unsigned char * | decodeSchemeEdifact (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd) |
static unsigned char * | decodeSchemeBase256 (DmtxMessage *msg, unsigned char *ptr, unsigned char *dataEnd) |
static void | printPattern (DmtxEncode *encode) |
static int | encodeDataCodewords (DmtxByteList *input, DmtxByteList *output, int sizeIdxRequest, DmtxScheme scheme, int fnc1) |
static int | modulePlacementEcc200 (INOUT unsigned char *modules, OUT unsigned char *codewords, int sizeIdx, int moduleOnColor) |
static void | patternShapeStandard (unsigned char *modules, int mappingRows, int mappingCols, int row, int col, unsigned char *codeword, int moduleOnColor) |
static void | patternShapeSpecial1 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor) |
static void | patternShapeSpecial2 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor) |
static void | patternShapeSpecial3 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor) |
static void | patternShapeSpecial4 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor) |
static void | placeModule (unsigned char *modules, int mappingRows, int mappingCols, int row, int col, unsigned char *codeword, int mask, int moduleOnColor) |
static DmtxPassFail | rsEncode (DmtxMessage *message, int sizeIdx) |
static DmtxPassFail | rsDecode (unsigned char *code, int sizeIdx, int fix) |
static DmtxPassFail | rsGenPoly (DmtxByteList *gen, int errorWordCount) |
static DmtxBoolean | rsComputeSyndromes (DmtxByteList *syn, const DmtxByteList *rec, int blockErrorWords) |
static DmtxBoolean | rsFindErrorLocatorPoly (DmtxByteList *elp, const DmtxByteList *syn, int errorWordCount, int maxCorrectable) |
static DmtxBoolean | rsFindErrorLocations (DmtxByteList *loc, const DmtxByteList *elp) |
static DmtxPassFail | rsRepairErrors (DmtxByteList *rec, const DmtxByteList *loc, const DmtxByteList *elp, const DmtxByteList *syn) |
static DmtxScanGrid | initScanGrid (DmtxDecode *dec) |
static int | popGridLocation (DmtxScanGrid *grid, OUT DmtxPixelLoc *locPtr) |
static int | getGridCoordinates (DmtxScanGrid *grid, OUT DmtxPixelLoc *locPtr) |
static void | setDerivedFields (DmtxScanGrid *grid) |
static int | findSymbolSize (int dataWords, int sizeIdxRequest) |
static int | getBitsPerPixel (int pack) |
static DmtxEncodeStream | streamInit (DmtxByteList *input, DmtxByteList *output) |
static void | streamCopy (DmtxEncodeStream *dst, DmtxEncodeStream *src) |
static void | streamMarkComplete (DmtxEncodeStream *stream, int sizeIdx) |
static void | streamMarkInvalid (DmtxEncodeStream *stream, int reasonIdx) |
static void | streamMarkFatal (DmtxEncodeStream *stream, int reasonIdx) |
static void | streamOutputChainAppend (DmtxEncodeStream *stream, DmtxByte value) |
static DmtxByte | streamOutputChainRemoveLast (DmtxEncodeStream *stream) |
static void | streamOutputSet (DmtxEncodeStream *stream, int index, DmtxByte value) |
static DmtxBoolean | streamInputHasNext (DmtxEncodeStream *stream) |
static DmtxByte | streamInputPeekNext (DmtxEncodeStream *stream) |
static DmtxByte | streamInputAdvanceNext (DmtxEncodeStream *stream) |
static void | streamInputAdvancePrev (DmtxEncodeStream *stream) |
static int | encodeSingleScheme (DmtxByteList *input, DmtxByteList *output, int sizeIdxRequest, DmtxScheme scheme, int fnc1) |
static void | encodeNextChunk (DmtxEncodeStream *stream, int scheme, int subScheme, int sizeIdxRequest) |
static void | encodeChangeScheme (DmtxEncodeStream *stream, DmtxScheme targetScheme, int unlatchType) |
static int | getRemainingSymbolCapacity (int outputLength, int sizeIdx) |
static int | encodeOptimizeBest (DmtxByteList *input, DmtxByteList *output, int sizeIdxRequest, int fnc1) |
static void | streamAdvanceFromBest (DmtxEncodeStream *streamNext, DmtxEncodeStream *streamList, int targeteState, int sizeIdxRequest) |
static void | advanceAsciiCompact (DmtxEncodeStream *streamNext, DmtxEncodeStream *streamList, int state, int inputNext, int sizeIdxRequest) |
static void | advanceCTX (DmtxEncodeStream *streamNext, DmtxEncodeStream *streamList, int state, int inputNext, int ctxValueCount, int sizeIdxRequest) |
static void | advanceEdifact (DmtxEncodeStream *streamNext, DmtxEncodeStream *streamList, int state, int inputNext, int sizeIdxRequest) |
static int | getScheme (int state) |
static DmtxBoolean | validStateSwitch (int fromState, int targetState) |
static void | encodeNextChunkAscii (DmtxEncodeStream *stream, int option) |
static void | appendValueAscii (DmtxEncodeStream *stream, DmtxByte value) |
static void | completeIfDoneAscii (DmtxEncodeStream *stream, int sizeIdxRequest) |
static void | padRemainingInAscii (DmtxEncodeStream *stream, int sizeIdx) |
static DmtxByteList | encodeTmpRemainingInAscii (DmtxEncodeStream *stream, DmtxByte *storage, int capacity, DmtxPassFail *passFail) |
static DmtxByte | randomize253State (DmtxByte cwValue, int cwPosition) |
static void | encodeNextChunkCTX (DmtxEncodeStream *stream, int sizeIdxRequest) |
static void | appendValuesCTX (DmtxEncodeStream *stream, DmtxByteList *valueList) |
static void | appendUnlatchCTX (DmtxEncodeStream *stream) |
static void | completeIfDoneCTX (DmtxEncodeStream *stream, int sizeIdxRequest) |
static void | completePartialC40Text (DmtxEncodeStream *stream, DmtxByteList *valueList, int sizeIdxRequest) |
static void | completePartialX12 (DmtxEncodeStream *stream, DmtxByteList *valueList, int sizeIdxRequest) |
static DmtxBoolean | partialX12ChunkRemains (DmtxEncodeStream *stream) |
static void | pushCTXValues (DmtxByteList *valueList, DmtxByte inputValue, int targetScheme, DmtxPassFail *passFail, int fnc1) |
static DmtxBoolean | isCTX (int scheme) |
static void | shiftValueListBy3 (DmtxByteList *list, DmtxPassFail *passFail) |
static void | encodeNextChunkEdifact (DmtxEncodeStream *stream) |
static void | appendValueEdifact (DmtxEncodeStream *stream, DmtxByte value) |
static void | completeIfDoneEdifact (DmtxEncodeStream *stream, int sizeIdxRequest) |
static void | encodeNextChunkBase256 (DmtxEncodeStream *stream) |
static void | appendValueBase256 (DmtxEncodeStream *stream, DmtxByte value) |
static void | completeIfDoneBase256 (DmtxEncodeStream *stream, int sizeIdxRequest) |
static void | updateBase256ChainHeader (DmtxEncodeStream *stream, int perfectSizeIdx) |
static void | base256OutputChainInsertFirst (DmtxEncodeStream *stream) |
static void | base256OutputChainRemoveFirst (DmtxEncodeStream *stream) |
static DmtxByte | randomize255State (DmtxByte cwValue, int cwPosition) |
static unsigned char | unRandomize255State (unsigned char value, int idx) |
Variables | |
static const int | dmtxNeighborNone = 8 |
static const int | dmtxPatternX [] = {-1, 0, 1, 1, 1, 0, -1, -1} |
static const int | dmtxPatternY [] = {-1, -1, -1, 0, 1, 1, 1, 0} |
static const DmtxPointFlow | dmtxBlankEdge = {0, 0, 0, DmtxUndefined, {-1, -1}} |
static DmtxCallbackBuildMatrixRegion | cbBuildMatrixRegion = NULL |
static DmtxCallbackBuildMatrix | cbBuildMatrix = NULL |
static DmtxCallbackPlotPoint | cbPlotPoint = NULL |
static DmtxCallbackXfrmPlotPoint | cbXfrmPlotPoint = NULL |
static DmtxCallbackPlotModule | cbPlotModule = NULL |
static DmtxCallbackFinal | cbFinal = NULL |
static int | rHvX [] |
static int | rHvY [] |
static char * | dmtxErrorMessage [] |
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 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
Static header
Definition in file dmtxstatic.h.
#define CHKERR |
Definition at line 80 of file dmtxstatic.h.
#define CHKSCHEME | ( | s | ) |
Definition at line 71 of file dmtxstatic.h.
#define CHKSIZE |
Definition at line 88 of file dmtxstatic.h.
#define DmtxAlmostInfinity -1 |
Definition at line 26 of file dmtxstatic.h.
#define DmtxAlmostZero 0.000001 |
Definition at line 25 of file dmtxstatic.h.
#define DmtxAssert | ( | expr | ) |
Definition at line 96 of file dmtxstatic.h.
#define DmtxC40TextBasicSet 0 |
Definition at line 49 of file dmtxstatic.h.
#define DmtxC40TextShift1 1 |
Definition at line 50 of file dmtxstatic.h.
#define DmtxC40TextShift2 2 |
Definition at line 51 of file dmtxstatic.h.
#define DmtxC40TextShift3 3 |
Definition at line 52 of file dmtxstatic.h.
#define DmtxChannelCannotUnlatch 0x01 << 1 |
Definition at line 59 of file dmtxstatic.h.
#define DmtxChannelUnsupportedChar 0x01 << 0 |
Definition at line 58 of file dmtxstatic.h.
#define DmtxChannelValid 0x00 |
Definition at line 57 of file dmtxstatic.h.
#define DmtxUnlatchExplicit 0 |
Definition at line 54 of file dmtxstatic.h.
#define DmtxUnlatchImplicit 1 |
Definition at line 55 of file dmtxstatic.h.
#define DmtxValue05Macro 236 |
Definition at line 45 of file dmtxstatic.h.
#define DmtxValue06Macro 237 |
Definition at line 46 of file dmtxstatic.h.
#define DmtxValueAsciiPad 129 |
Definition at line 37 of file dmtxstatic.h.
#define DmtxValueAsciiUpperShift 235 |
Definition at line 38 of file dmtxstatic.h.
#define DmtxValueBase256Latch 231 |
Definition at line 32 of file dmtxstatic.h.
#define DmtxValueC40Latch 230 |
Definition at line 28 of file dmtxstatic.h.
#define DmtxValueCTXShift1 0 |
Definition at line 39 of file dmtxstatic.h.
#define DmtxValueCTXShift2 1 |
Definition at line 40 of file dmtxstatic.h.
#define DmtxValueCTXShift3 2 |
Definition at line 41 of file dmtxstatic.h.
#define DmtxValueCTXUnlatch 254 |
Definition at line 34 of file dmtxstatic.h.
#define DmtxValueECI 241 |
Definition at line 47 of file dmtxstatic.h.
#define DmtxValueEdifactLatch 240 |
Definition at line 31 of file dmtxstatic.h.
#define DmtxValueEdifactUnlatch 31 |
Definition at line 35 of file dmtxstatic.h.
#define DmtxValueFNC1 232 |
Definition at line 42 of file dmtxstatic.h.
#define DmtxValueReaderProgramming 234 |
Definition at line 44 of file dmtxstatic.h.
#define DmtxValueStructuredAppend 233 |
Definition at line 43 of file dmtxstatic.h.
#define DmtxValueTextLatch 239 |
Definition at line 29 of file dmtxstatic.h.
#define DmtxValueX12Latch 238 |
Definition at line 30 of file dmtxstatic.h.
#define ISDIGIT | ( | n | ) |
Definition at line 68 of file dmtxstatic.h.
#define max | ( | X, | |
Y ) |
Definition at line 65 of file dmtxstatic.h.
#define min | ( | X, | |
Y ) |
Definition at line 62 of file dmtxstatic.h.
typedef struct C40TextState_struct C40TextState |
typedef struct DmtxBresLine_struct DmtxBresLine |
typedef enum DmtxEdge_enum DmtxEdge |
typedef enum DmtxEncodeOption_enum DmtxEncodeOption |
typedef struct DmtxFollow_struct DmtxFollow |
typedef struct DmtxLogEvent_struct DmtxLogEvent |
typedef void(* DmtxLogFn) (DmtxLogEvent *ev) |
Definition at line 189 of file dmtxstatic.h.
typedef void(* DmtxLogLockFn) (DmtxBoolean lock, void *udata) |
Definition at line 190 of file dmtxstatic.h.
typedef enum DmtxMaskBit_enum DmtxMaskBit |
typedef enum DmtxRange_enum DmtxRange |
enum DmtxEdge_enum |
Enumerator | |
---|---|
DmtxEdgeTop | |
DmtxEdgeBottom | |
DmtxEdgeLeft | |
DmtxEdgeRight |
Definition at line 119 of file dmtxstatic.h.
Enumerator | |
---|---|
DmtxEncodeNormal | |
DmtxEncodeCompact | |
DmtxEncodeFull |
Definition at line 105 of file dmtxstatic.h.
enum DmtxErrorMessage |
Definition at line 392 of file dmtxstatic.h.
enum DmtxMaskBit_enum |
Enumerator | |
---|---|
DmtxMaskBit8 | |
DmtxMaskBit7 | |
DmtxMaskBit6 | |
DmtxMaskBit5 | |
DmtxMaskBit4 | |
DmtxMaskBit3 | |
DmtxMaskBit2 | |
DmtxMaskBit1 |
Definition at line 127 of file dmtxstatic.h.
enum DmtxRange_enum |
Enumerator | |
---|---|
DmtxRangeGood | |
DmtxRangeBad | |
DmtxRangeEnd |
Definition at line 112 of file dmtxstatic.h.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Translate encoded data stream into final output.
msg | |
sizeIdx | |
outputStart |
Definition at line 30 of file dmtxdecodescheme.c.
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
|
static |
Definition at line 360 of file dmtxstatic.h.
|
static |
Definition at line 359 of file dmtxstatic.h.
|
static |
Definition at line 364 of file dmtxstatic.h.
|
static |
Definition at line 363 of file dmtxstatic.h.
|
static |
Definition at line 361 of file dmtxstatic.h.
|
static |
Definition at line 362 of file dmtxstatic.h.
|
static |
Definition at line 357 of file dmtxstatic.h.
|
static |
Definition at line 406 of file dmtxstatic.h.
|
static |
Definition at line 354 of file dmtxstatic.h.
|
static |
Definition at line 355 of file dmtxstatic.h.
|
static |
Definition at line 356 of file dmtxstatic.h.
|
static |
Definition at line 368 of file dmtxstatic.h.
|
static |
Definition at line 380 of file dmtxstatic.h.