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.
Loading...
Searching...
No Matches
dmtxstatic.h File Reference

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton. More...

#include <assert.h>
#include <stdio.h>
#include "dmtx.h"

Go to the source code of this file.

Classes

struct  DmtxFollow_struct
 
struct  DmtxBresLine_struct
 
struct  C40TextState_struct
 
struct  DmtxLogEvent_struct
 

Macros

#define DmtxAlmostZero   0.000001
 
#define DmtxAlmostInfinity   -1
 
#define DmtxValueC40Latch   230
 
#define DmtxValueTextLatch   239
 
#define DmtxValueX12Latch   238
 
#define DmtxValueEdifactLatch   240
 
#define DmtxValueBase256Latch   231
 
#define DmtxValueCTXUnlatch   254
 
#define DmtxValueEdifactUnlatch   31
 
#define DmtxValueAsciiPad   129
 
#define DmtxValueAsciiUpperShift   235
 
#define DmtxValueCTXShift1   0
 
#define DmtxValueCTXShift2   1
 
#define DmtxValueCTXShift3   2
 
#define DmtxValueFNC1   232
 
#define DmtxValueStructuredAppend   233
 
#define DmtxValueReaderProgramming   234
 
#define DmtxValue05Macro   236
 
#define DmtxValue06Macro   237
 
#define DmtxValueECI   241
 
#define DmtxC40TextBasicSet   0
 
#define DmtxC40TextShift1   1
 
#define DmtxC40TextShift2   2
 
#define DmtxC40TextShift3   3
 
#define DmtxUnlatchExplicit   0
 
#define DmtxUnlatchImplicit   1
 
#define DmtxChannelValid   0x00
 
#define DmtxChannelUnsupportedChar   0x01 << 0
 
#define DmtxChannelCannotUnlatch   0x01 << 1
 
#define min(X, Y)
 
#define max(X, Y)
 
#define ISDIGIT(n)
 
#define CHKSCHEME(s)
 
#define CHKERR
 
#define CHKSIZE
 
#define DmtxAssert(expr)
 

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 []
 

Detailed Description

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.

Macro Definition Documentation

◆ CHKERR

#define CHKERR
Value:
{ \
if (stream->status != DmtxStatusEncoding) { \
return; \
} \
}
@ DmtxStatusEncoding
Definition dmtx.h:80

Definition at line 80 of file dmtxstatic.h.

◆ CHKSCHEME

#define CHKSCHEME ( s)
Value:
{ \
if (stream->currentScheme != (s)) { \
streamMarkFatal(stream, DmtxErrorUnexpectedScheme); \
return; \
} \
}
@ DmtxErrorUnexpectedScheme
Definition dmtxstatic.h:402

Definition at line 71 of file dmtxstatic.h.

◆ CHKSIZE

#define CHKSIZE
Value:
{ \
if (sizeIdx == DmtxUndefined) { \
streamMarkInvalid(stream, DmtxErrorUnknown); \
return; \
} \
}
#define DmtxUndefined
Definition dmtx.h:40
@ DmtxErrorUnknown
Definition dmtxstatic.h:394

Definition at line 88 of file dmtxstatic.h.

◆ DmtxAlmostInfinity

#define DmtxAlmostInfinity   -1

Definition at line 26 of file dmtxstatic.h.

◆ DmtxAlmostZero

#define DmtxAlmostZero   0.000001

Definition at line 25 of file dmtxstatic.h.

◆ DmtxAssert

#define DmtxAssert ( expr)
Value:
do { \
assert(expr); \
if (!!(expr)) { \
} else { \
dmtxLogError("%s\n", #expr); \
} \
} while (0)

Definition at line 96 of file dmtxstatic.h.

◆ DmtxC40TextBasicSet

#define DmtxC40TextBasicSet   0

Definition at line 49 of file dmtxstatic.h.

◆ DmtxC40TextShift1

#define DmtxC40TextShift1   1

Definition at line 50 of file dmtxstatic.h.

◆ DmtxC40TextShift2

#define DmtxC40TextShift2   2

Definition at line 51 of file dmtxstatic.h.

◆ DmtxC40TextShift3

#define DmtxC40TextShift3   3

Definition at line 52 of file dmtxstatic.h.

◆ DmtxChannelCannotUnlatch

#define DmtxChannelCannotUnlatch   0x01 << 1

Definition at line 59 of file dmtxstatic.h.

◆ DmtxChannelUnsupportedChar

#define DmtxChannelUnsupportedChar   0x01 << 0

Definition at line 58 of file dmtxstatic.h.

◆ DmtxChannelValid

#define DmtxChannelValid   0x00

Definition at line 57 of file dmtxstatic.h.

◆ DmtxUnlatchExplicit

#define DmtxUnlatchExplicit   0

Definition at line 54 of file dmtxstatic.h.

◆ DmtxUnlatchImplicit

#define DmtxUnlatchImplicit   1

Definition at line 55 of file dmtxstatic.h.

◆ DmtxValue05Macro

#define DmtxValue05Macro   236

Definition at line 45 of file dmtxstatic.h.

◆ DmtxValue06Macro

#define DmtxValue06Macro   237

Definition at line 46 of file dmtxstatic.h.

◆ DmtxValueAsciiPad

#define DmtxValueAsciiPad   129

Definition at line 37 of file dmtxstatic.h.

◆ DmtxValueAsciiUpperShift

#define DmtxValueAsciiUpperShift   235

Definition at line 38 of file dmtxstatic.h.

◆ DmtxValueBase256Latch

#define DmtxValueBase256Latch   231

Definition at line 32 of file dmtxstatic.h.

◆ DmtxValueC40Latch

#define DmtxValueC40Latch   230

Definition at line 28 of file dmtxstatic.h.

◆ DmtxValueCTXShift1

#define DmtxValueCTXShift1   0

Definition at line 39 of file dmtxstatic.h.

◆ DmtxValueCTXShift2

#define DmtxValueCTXShift2   1

Definition at line 40 of file dmtxstatic.h.

◆ DmtxValueCTXShift3

#define DmtxValueCTXShift3   2

Definition at line 41 of file dmtxstatic.h.

◆ DmtxValueCTXUnlatch

#define DmtxValueCTXUnlatch   254

Definition at line 34 of file dmtxstatic.h.

◆ DmtxValueECI

#define DmtxValueECI   241

Definition at line 47 of file dmtxstatic.h.

◆ DmtxValueEdifactLatch

#define DmtxValueEdifactLatch   240

Definition at line 31 of file dmtxstatic.h.

◆ DmtxValueEdifactUnlatch

#define DmtxValueEdifactUnlatch   31

Definition at line 35 of file dmtxstatic.h.

◆ DmtxValueFNC1

#define DmtxValueFNC1   232

Definition at line 42 of file dmtxstatic.h.

◆ DmtxValueReaderProgramming

#define DmtxValueReaderProgramming   234

Definition at line 44 of file dmtxstatic.h.

◆ DmtxValueStructuredAppend

#define DmtxValueStructuredAppend   233

Definition at line 43 of file dmtxstatic.h.

◆ DmtxValueTextLatch

#define DmtxValueTextLatch   239

Definition at line 29 of file dmtxstatic.h.

◆ DmtxValueX12Latch

#define DmtxValueX12Latch   238

Definition at line 30 of file dmtxstatic.h.

◆ ISDIGIT

#define ISDIGIT ( n)
Value:
(n > 47 && n < 58)

Definition at line 68 of file dmtxstatic.h.

◆ max

#define max ( X,
Y )
Value:
(((X) > (Y)) ? (X) : (Y))

Definition at line 65 of file dmtxstatic.h.

◆ min

#define min ( X,
Y )
Value:
(((X) < (Y)) ? (X) : (Y))

Definition at line 62 of file dmtxstatic.h.

Typedef Documentation

◆ C40TextState

◆ DmtxBresLine

typedef struct DmtxBresLine_struct DmtxBresLine

◆ DmtxEdge

typedef enum DmtxEdge_enum DmtxEdge

◆ DmtxEncodeOption

◆ DmtxFollow

typedef struct DmtxFollow_struct DmtxFollow

◆ DmtxLogEvent

◆ DmtxLogFn

typedef void(* DmtxLogFn) (DmtxLogEvent *ev)

Definition at line 189 of file dmtxstatic.h.

◆ DmtxLogLockFn

typedef void(* DmtxLogLockFn) (DmtxBoolean lock, void *udata)

Definition at line 190 of file dmtxstatic.h.

◆ DmtxMaskBit

◆ DmtxRange

typedef enum DmtxRange_enum DmtxRange

Enumeration Type Documentation

◆ DmtxEdge_enum

Enumerator
DmtxEdgeTop 
DmtxEdgeBottom 
DmtxEdgeLeft 
DmtxEdgeRight 

Definition at line 119 of file dmtxstatic.h.

◆ DmtxEncodeOption_enum

Enumerator
DmtxEncodeNormal 
DmtxEncodeCompact 
DmtxEncodeFull 

Definition at line 105 of file dmtxstatic.h.

◆ DmtxErrorMessage

Enumerator
DmtxErrorUnknown 
DmtxErrorUnsupportedCharacter 
DmtxErrorNotOnByteBoundary 
DmtxErrorIllegalParameterValue 
DmtxErrorEmptyList 
DmtxErrorOutOfBounds 
DmtxErrorMessageTooLarge 
DmtxErrorCantCompactNonDigits 
DmtxErrorUnexpectedScheme 
DmtxErrorIncompleteValueList 

Definition at line 392 of file dmtxstatic.h.

◆ DmtxMaskBit_enum

Enumerator
DmtxMaskBit8 
DmtxMaskBit7 
DmtxMaskBit6 
DmtxMaskBit5 
DmtxMaskBit4 
DmtxMaskBit3 
DmtxMaskBit2 
DmtxMaskBit1 

Definition at line 127 of file dmtxstatic.h.

◆ DmtxRange_enum

Enumerator
DmtxRangeGood 
DmtxRangeBad 
DmtxRangeEnd 

Definition at line 112 of file dmtxstatic.h.

Function Documentation

◆ advanceAsciiCompact()

static void advanceAsciiCompact ( DmtxEncodeStream * streamNext,
DmtxEncodeStream * streamList,
int state,
int inputNext,
int sizeIdxRequest )
static

◆ advanceCTX()

static void advanceCTX ( DmtxEncodeStream * streamNext,
DmtxEncodeStream * streamList,
int state,
int inputNext,
int ctxValueCount,
int sizeIdxRequest )
static

◆ advanceEdifact()

static void advanceEdifact ( DmtxEncodeStream * streamNext,
DmtxEncodeStream * streamList,
int state,
int inputNext,
int sizeIdxRequest )
static

◆ appendUnlatchCTX()

static void appendUnlatchCTX ( DmtxEncodeStream * stream)
static

◆ appendValueAscii()

static void appendValueAscii ( DmtxEncodeStream * stream,
DmtxByte value )
static

◆ appendValueBase256()

static void appendValueBase256 ( DmtxEncodeStream * stream,
DmtxByte value )
static

◆ appendValueEdifact()

static void appendValueEdifact ( DmtxEncodeStream * stream,
DmtxByte value )
static

◆ appendValuesCTX()

static void appendValuesCTX ( DmtxEncodeStream * stream,
DmtxByteList * valueList )
static

◆ base256OutputChainInsertFirst()

static void base256OutputChainInsertFirst ( DmtxEncodeStream * stream)
static

◆ base256OutputChainRemoveFirst()

static void base256OutputChainRemoveFirst ( DmtxEncodeStream * stream)
static

◆ bresLineGetStep()

static DmtxPassFail bresLineGetStep ( DmtxBresLine line,
DmtxPixelLoc target,
int * travel,
int * outward )
static

◆ bresLineInit()

static DmtxBresLine bresLineInit ( DmtxPixelLoc loc0,
DmtxPixelLoc loc1,
DmtxPixelLoc locInside )
static

◆ bresLineStep()

static DmtxPassFail bresLineStep ( DmtxBresLine * line,
int travel,
int outward )
static

◆ completeIfDoneAscii()

static void completeIfDoneAscii ( DmtxEncodeStream * stream,
int sizeIdxRequest )
static

◆ completeIfDoneBase256()

static void completeIfDoneBase256 ( DmtxEncodeStream * stream,
int sizeIdxRequest )
static

◆ completeIfDoneCTX()

static void completeIfDoneCTX ( DmtxEncodeStream * stream,
int sizeIdxRequest )
static

◆ completeIfDoneEdifact()

static void completeIfDoneEdifact ( DmtxEncodeStream * stream,
int sizeIdxRequest )
static

◆ completePartialC40Text()

static void completePartialC40Text ( DmtxEncodeStream * stream,
DmtxByteList * valueList,
int sizeIdxRequest )
static

◆ completePartialX12()

static void completePartialX12 ( DmtxEncodeStream * stream,
DmtxByteList * valueList,
int sizeIdxRequest )
static

◆ countJumpTally()

static int countJumpTally ( DmtxDecode * dec,
DmtxRegion * reg,
int xStart,
int yStart,
DmtxDirection dir )
static

◆ decodeDataStream()

static DmtxPassFail decodeDataStream ( DmtxMessage * msg,
int sizeIdx,
unsigned char * outputStart )
static

Translate encoded data stream into final output.

Parameters
msg
sizeIdx
outputStart
Returns
void

Definition at line 30 of file dmtxdecodescheme.c.

◆ decodeSchemeAscii()

static unsigned char * decodeSchemeAscii ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

◆ decodeSchemeBase256()

static unsigned char * decodeSchemeBase256 ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

◆ decodeSchemeC40Text()

static unsigned char * decodeSchemeC40Text ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd,
DmtxScheme encScheme )
static

◆ decodeSchemeEdifact()

static unsigned char * decodeSchemeEdifact ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

◆ decodeSchemeX12()

static unsigned char * decodeSchemeX12 ( DmtxMessage * msg,
unsigned char * ptr,
unsigned char * dataEnd )
static

◆ distanceSquared()

static long distanceSquared ( DmtxPixelLoc a,
DmtxPixelLoc b )
static

◆ encodeChangeScheme()

static void encodeChangeScheme ( DmtxEncodeStream * stream,
DmtxScheme targetScheme,
int unlatchType )
static

◆ encodeDataCodewords()

static int encodeDataCodewords ( DmtxByteList * input,
DmtxByteList * output,
int sizeIdxRequest,
DmtxScheme scheme,
int fnc1 )
static

◆ encodeNextChunk()

static void encodeNextChunk ( DmtxEncodeStream * stream,
int scheme,
int subScheme,
int sizeIdxRequest )
static

◆ encodeNextChunkAscii()

static void encodeNextChunkAscii ( DmtxEncodeStream * stream,
int option )
static

◆ encodeNextChunkBase256()

static void encodeNextChunkBase256 ( DmtxEncodeStream * stream)
static

◆ encodeNextChunkCTX()

static void encodeNextChunkCTX ( DmtxEncodeStream * stream,
int sizeIdxRequest )
static

◆ encodeNextChunkEdifact()

static void encodeNextChunkEdifact ( DmtxEncodeStream * stream)
static

◆ encodeOptimizeBest()

static int encodeOptimizeBest ( DmtxByteList * input,
DmtxByteList * output,
int sizeIdxRequest,
int fnc1 )
static

◆ encodeSingleScheme()

static int encodeSingleScheme ( DmtxByteList * input,
DmtxByteList * output,
int sizeIdxRequest,
DmtxScheme scheme,
int fnc1 )
static

◆ encodeTmpRemainingInAscii()

static DmtxByteList encodeTmpRemainingInAscii ( DmtxEncodeStream * stream,
DmtxByte * storage,
int capacity,
DmtxPassFail * passFail )
static

◆ findBestSolidLine()

static DmtxBestLine findBestSolidLine ( DmtxDecode * dec,
DmtxRegion * reg,
int step0,
int step1,
int streamDir,
int houghAvoid )
static

◆ findBestSolidLine2()

static DmtxBestLine findBestSolidLine2 ( DmtxDecode * dec,
DmtxPixelLoc loc0,
int tripSteps,
int sign,
int houghAvoid )
static

◆ findStrongestNeighbor()

static DmtxPointFlow findStrongestNeighbor ( DmtxDecode * dec,
DmtxPointFlow center,
int sign )
static

◆ findSymbolSize()

static int findSymbolSize ( int dataWords,
int sizeIdxRequest )
static

◆ findTravelLimits()

static DmtxPassFail findTravelLimits ( DmtxDecode * dec,
DmtxRegion * reg,
DmtxBestLine * line )
static

◆ followSeek()

static DmtxFollow followSeek ( DmtxDecode * dec,
DmtxRegion * reg,
int seek )
static

◆ followSeekLoc()

static DmtxFollow followSeekLoc ( DmtxDecode * dec,
DmtxPixelLoc loc )
static

◆ followStep()

static DmtxFollow followStep ( DmtxDecode * dec,
DmtxRegion * reg,
DmtxFollow followBeg,
int sign )
static

◆ followStep2()

static DmtxFollow followStep2 ( DmtxDecode * dec,
DmtxFollow followBeg,
int sign )
static

◆ getBitsPerPixel()

static int getBitsPerPixel ( int pack)
static

◆ getEncodationScheme()

static int getEncodationScheme ( unsigned char cw)
static

◆ getGridCoordinates()

static int getGridCoordinates ( DmtxScanGrid * grid,
OUT DmtxPixelLoc * locPtr )
static

◆ getPointFlow()

static DmtxPointFlow getPointFlow ( DmtxDecode * dec,
int colorPlane,
DmtxPixelLoc loc,
int arrive )
static

◆ getRemainingSymbolCapacity()

static int getRemainingSymbolCapacity ( int outputLength,
int sizeIdx )
static

◆ getScheme()

static int getScheme ( int state)
static

◆ initScanGrid()

static DmtxScanGrid initScanGrid ( DmtxDecode * dec)
static

◆ isCTX()

static DmtxBoolean isCTX ( int scheme)
static

◆ matrixRegionAlignCalibEdge()

static DmtxPassFail matrixRegionAlignCalibEdge ( DmtxDecode * dec,
DmtxRegion * reg,
int edgeLoc )
static

◆ matrixRegionFindSize()

static DmtxPassFail matrixRegionFindSize ( DmtxDecode * dec,
DmtxRegion * reg )
static

◆ matrixRegionOrientation()

static DmtxPassFail matrixRegionOrientation ( DmtxDecode * dec,
DmtxRegion * reg,
DmtxPointFlow flowBegin )
static

◆ matrixRegionSeekEdge()

static DmtxPointFlow matrixRegionSeekEdge ( DmtxDecode * dec,
DmtxPixelLoc loc0 )
static

◆ modulePlacementEcc200()

static int modulePlacementEcc200 ( INOUT unsigned char * modules,
OUT unsigned char * codewords,
int sizeIdx,
int moduleOnColor )
static

◆ padRemainingInAscii()

static void padRemainingInAscii ( DmtxEncodeStream * stream,
int sizeIdx )
static

◆ partialX12ChunkRemains()

static DmtxBoolean partialX12ChunkRemains ( DmtxEncodeStream * stream)
static

◆ patternShapeSpecial1()

static void patternShapeSpecial1 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

◆ patternShapeSpecial2()

static void patternShapeSpecial2 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

◆ patternShapeSpecial3()

static void patternShapeSpecial3 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

◆ patternShapeSpecial4()

static void patternShapeSpecial4 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

◆ patternShapeStandard()

static void patternShapeStandard ( unsigned char * modules,
int mappingRows,
int mappingCols,
int row,
int col,
unsigned char * codeword,
int moduleOnColor )
static

◆ placeModule()

static void placeModule ( unsigned char * modules,
int mappingRows,
int mappingCols,
int row,
int col,
unsigned char * codeword,
int mask,
int moduleOnColor )
static

◆ popGridLocation()

static int popGridLocation ( DmtxScanGrid * grid,
OUT DmtxPixelLoc * locPtr )
static

◆ populateArrayFromMatrix()

static DmtxPassFail populateArrayFromMatrix ( DmtxDecode * dec,
DmtxRegion * reg,
OUT DmtxMessage * msg )
static

◆ printPattern()

static void printPattern ( DmtxEncode * encode)
static

◆ pushCTXValues()

static void pushCTXValues ( DmtxByteList * valueList,
DmtxByte inputValue,
int targetScheme,
DmtxPassFail * passFail,
int fnc1 )
static

◆ pushOutputC40TextWord()

static void pushOutputC40TextWord ( DmtxMessage * msg,
C40TextState * state,
int value )
static

◆ pushOutputMacroHeader()

static void pushOutputMacroHeader ( DmtxMessage * msg,
int macroType )
static

◆ pushOutputMacroTrailer()

static void pushOutputMacroTrailer ( DmtxMessage * msg)
static

◆ pushOutputWord()

static void pushOutputWord ( DmtxMessage * msg,
int value )
static

◆ randomize253State()

static DmtxByte randomize253State ( DmtxByte cwValue,
int cwPosition )
static

◆ randomize255State()

static DmtxByte randomize255State ( DmtxByte cwValue,
int cwPosition )
static

◆ readModuleColor()

static int readModuleColor ( DmtxDecode * dec,
DmtxRegion * reg,
int symbolRow,
int symbolCol,
int sizeIdx,
int colorPlane )
static

◆ rightAngleTrueness()

static double rightAngleTrueness ( DmtxVector2 c0,
DmtxVector2 c1,
DmtxVector2 c2,
double angle )
static

◆ rsComputeSyndromes()

static DmtxBoolean rsComputeSyndromes ( DmtxByteList * syn,
const DmtxByteList * rec,
int blockErrorWords )
static

◆ rsDecode()

static DmtxPassFail rsDecode ( unsigned char * code,
int sizeIdx,
int fix )
static

◆ rsEncode()

static DmtxPassFail rsEncode ( DmtxMessage * message,
int sizeIdx )
static

◆ rsFindErrorLocations()

static DmtxBoolean rsFindErrorLocations ( DmtxByteList * loc,
const DmtxByteList * elp )
static

◆ rsFindErrorLocatorPoly()

static DmtxBoolean rsFindErrorLocatorPoly ( DmtxByteList * elp,
const DmtxByteList * syn,
int errorWordCount,
int maxCorrectable )
static

◆ rsGenPoly()

static DmtxPassFail rsGenPoly ( DmtxByteList * gen,
int errorWordCount )
static

◆ rsRepairErrors()

static DmtxPassFail rsRepairErrors ( DmtxByteList * rec,
const DmtxByteList * loc,
const DmtxByteList * elp,
const DmtxByteList * syn )
static

◆ setDerivedFields()

static void setDerivedFields ( DmtxScanGrid * grid)
static

◆ shiftValueListBy3()

static void shiftValueListBy3 ( DmtxByteList * list,
DmtxPassFail * passFail )
static

◆ streamAdvanceFromBest()

static void streamAdvanceFromBest ( DmtxEncodeStream * streamNext,
DmtxEncodeStream * streamList,
int targeteState,
int sizeIdxRequest )
static

◆ streamCopy()

static void streamCopy ( DmtxEncodeStream * dst,
DmtxEncodeStream * src )
static

◆ streamInit()

static DmtxEncodeStream streamInit ( DmtxByteList * input,
DmtxByteList * output )
static

◆ streamInputAdvanceNext()

static DmtxByte streamInputAdvanceNext ( DmtxEncodeStream * stream)
static

◆ streamInputAdvancePrev()

static void streamInputAdvancePrev ( DmtxEncodeStream * stream)
static

◆ streamInputHasNext()

static DmtxBoolean streamInputHasNext ( DmtxEncodeStream * stream)
static

◆ streamInputPeekNext()

static DmtxByte streamInputPeekNext ( DmtxEncodeStream * stream)
static

◆ streamMarkComplete()

static void streamMarkComplete ( DmtxEncodeStream * stream,
int sizeIdx )
static

◆ streamMarkFatal()

static void streamMarkFatal ( DmtxEncodeStream * stream,
int reasonIdx )
static

◆ streamMarkInvalid()

static void streamMarkInvalid ( DmtxEncodeStream * stream,
int reasonIdx )
static

◆ streamOutputChainAppend()

static void streamOutputChainAppend ( DmtxEncodeStream * stream,
DmtxByte value )
static

◆ streamOutputChainRemoveLast()

static DmtxByte streamOutputChainRemoveLast ( DmtxEncodeStream * stream)
static

◆ streamOutputSet()

static void streamOutputSet ( DmtxEncodeStream * stream,
int index,
DmtxByte value )
static

◆ tallyModuleJumps()

static void tallyModuleJumps ( DmtxDecode * dec,
DmtxRegion * reg,
INOUT int tally[][24],
int xOrigin,
int yOrigin,
int mapWidth,
int mapHeight,
DmtxDirection dir )
static

◆ trailBlazeContinuous()

static DmtxPassFail trailBlazeContinuous ( DmtxDecode * dec,
DmtxRegion * reg,
DmtxPointFlow flowBegin,
int maxDiagonal )
static

◆ trailBlazeGapped()

static int trailBlazeGapped ( DmtxDecode * dec,
DmtxRegion * reg,
DmtxBresLine line,
int streamDir )
static

◆ trailClear()

static int trailClear ( DmtxDecode * dec,
DmtxRegion * reg,
int clearMask )
static

◆ unRandomize255State()

static unsigned char unRandomize255State ( unsigned char value,
int idx )
static

◆ updateBase256ChainHeader()

static void updateBase256ChainHeader ( DmtxEncodeStream * stream,
int perfectSizeIdx )
static

◆ validStateSwitch()

static DmtxBoolean validStateSwitch ( int fromState,
int targetState )
static

Variable Documentation

◆ cbBuildMatrix

DmtxCallbackBuildMatrix cbBuildMatrix = NULL
static

Definition at line 360 of file dmtxstatic.h.

◆ cbBuildMatrixRegion

DmtxCallbackBuildMatrixRegion cbBuildMatrixRegion = NULL
static

Definition at line 359 of file dmtxstatic.h.

◆ cbFinal

DmtxCallbackFinal cbFinal = NULL
static

Definition at line 364 of file dmtxstatic.h.

◆ cbPlotModule

DmtxCallbackPlotModule cbPlotModule = NULL
static

Definition at line 363 of file dmtxstatic.h.

◆ cbPlotPoint

DmtxCallbackPlotPoint cbPlotPoint = NULL
static

Definition at line 361 of file dmtxstatic.h.

◆ cbXfrmPlotPoint

DmtxCallbackXfrmPlotPoint cbXfrmPlotPoint = NULL
static

Definition at line 362 of file dmtxstatic.h.

◆ dmtxBlankEdge

const DmtxPointFlow dmtxBlankEdge = {0, 0, 0, DmtxUndefined, {-1, -1}}
static

Definition at line 357 of file dmtxstatic.h.

◆ dmtxErrorMessage

char* dmtxErrorMessage[]
static
Initial value:
= {"Unknown error",
"Unsupported character",
"Not on byte boundary",
"Illegal parameter value",
"Encountered empty list",
"Out of bounds",
"Message too large",
"Can't compact non-digits",
"Encountered unexpected scheme",
"Encountered incomplete value list"}

Definition at line 406 of file dmtxstatic.h.

◆ dmtxNeighborNone

const int dmtxNeighborNone = 8
static

Definition at line 354 of file dmtxstatic.h.

◆ dmtxPatternX

const int dmtxPatternX[] = {-1, 0, 1, 1, 1, 0, -1, -1}
static

Definition at line 355 of file dmtxstatic.h.

◆ dmtxPatternY

const int dmtxPatternY[] = {-1, -1, -1, 0, 1, 1, 1, 0}
static

Definition at line 356 of file dmtxstatic.h.

◆ rHvX

int rHvX[]
static
Initial value:
= {
256, 256, 256, 256, 255, 255, 255, 254, 254, 253, 252, 251, 250, 249, 248, 247, 246, 245,
243, 242, 241, 239, 237, 236, 234, 232, 230, 228, 226, 224, 222, 219, 217, 215, 212, 210,
207, 204, 202, 199, 196, 193, 190, 187, 184, 181, 178, 175, 171, 168, 165, 161, 158, 154,
150, 147, 143, 139, 136, 132, 128, 124, 120, 116, 112, 108, 104, 100, 96, 92, 88, 83,
79, 75, 71, 66, 62, 58, 53, 49, 44, 40, 36, 31, 27, 22, 18, 13, 9, 4,
0, -4, -9, -13, -18, -22, -27, -31, -36, -40, -44, -49, -53, -58, -62, -66, -71, -75,
-79, -83, -88, -92, -96, -100, -104, -108, -112, -116, -120, -124, -128, -132, -136, -139, -143, -147,
-150, -154, -158, -161, -165, -168, -171, -175, -178, -181, -184, -187, -190, -193, -196, -199, -202, -204,
-207, -210, -212, -215, -217, -219, -222, -224, -226, -228, -230, -232, -234, -236, -237, -239, -241, -242,
-243, -245, -246, -247, -248, -249, -250, -251, -252, -253, -254, -254, -255, -255, -255, -256, -256, -256}

Definition at line 368 of file dmtxstatic.h.

◆ rHvY

int rHvY[]
static
Initial value:
= {0, 4, 9, 13, 18, 22, 27, 31, 36, 40, 44, 49, 53, 58, 62, 66, 71, 75, 79, 83,
88, 92, 96, 100, 104, 108, 112, 116, 120, 124, 128, 132, 136, 139, 143, 147, 150, 154, 158, 161,
165, 168, 171, 175, 178, 181, 184, 187, 190, 193, 196, 199, 202, 204, 207, 210, 212, 215, 217, 219,
222, 224, 226, 228, 230, 232, 234, 236, 237, 239, 241, 242, 243, 245, 246, 247, 248, 249, 250, 251,
252, 253, 254, 254, 255, 255, 255, 256, 256, 256, 256, 256, 256, 256, 255, 255, 255, 254, 254, 253,
252, 251, 250, 249, 248, 247, 246, 245, 243, 242, 241, 239, 237, 236, 234, 232, 230, 228, 226, 224,
222, 219, 217, 215, 212, 210, 207, 204, 202, 199, 196, 193, 190, 187, 184, 181, 178, 175, 171, 168,
165, 161, 158, 154, 150, 147, 143, 139, 136, 132, 128, 124, 120, 116, 112, 108, 104, 100, 96, 92,
88, 83, 79, 75, 71, 66, 62, 58, 53, 49, 44, 40, 36, 31, 27, 22, 18, 13, 9, 4}

Definition at line 380 of file dmtxstatic.h.