dmtx.h   dmtx.h 
/* /*
libdmtx - Data Matrix Encoding/Decoding Library libdmtx - Data Matrix Encoding/Decoding Library
Copyright (c) 2007 Mike Laughton Copyright (c) 2008 Mike Laughton
This library is free software; you can redistribute it and/or This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation; either License as published by the Free Software Foundation; either
version 2.1 of the License, or (at your option) any later version. version 2.1 of the License, or (at your option) any later version.
This library is distributed in the hope that it will be useful, This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Lesser General Public License for more details. Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public You should have received a copy of the GNU Lesser General Public
License along with this library; if not, write to the Free Software License along with this library; if not, write to the Free Software
Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
Contact: mike@dragonflylogic.com Contact: mike@dragonflylogic.com
*/ */
/* $Id: dmtx.h,v 1.10 2006/10/06 05:29:51 mblaughton Exp $ */ /* $Id: dmtx.h 124 2008-04-13 01:38:03Z mblaughton $ */
#ifndef __DMTX_H__ #ifndef __DMTX_H__
#define __DMTX_H__ #define __DMTX_H__
#define DMTX_FAILURE 0 #define DMTX_VERSION "0.5.0"
#define DMTX_SUCCESS 1
#define DMTX_DISPLAY_SQUARE 1 #define DMTX_FAILURE 0
#define DMTX_DISPLAY_POINT 2 #define DMTX_SUCCESS 1
#define DMTX_DISPLAY_CIRCLE 3
#define DMTX_STATUS_NOT_SCANNED 0
#define DMTX_MODULE_ON_RGB 0x07 /* ON_RED | ON_GREEN | ON_BLUE */ #define DMTX_STATUS_VALID 1
#define DMTX_MODULE_ON_RED 0x01 #define DMTX_STATUS_INVALID 2
#define DMTX_MODULE_ON_GREEN 0x02
#define DMTX_MODULE_ON_BLUE 0x04 #define DMTX_DISPLAY_SQUARE 1
#define DMTX_MODULE_ASSIGNED 0x10 #define DMTX_DISPLAY_POINT 2
#define DMTX_MODULE_VISITED 0x20 #define DMTX_DISPLAY_CIRCLE 3
#define DMTX_MODULE_DATA 0x40
#define DMTX_REGION_EOF -1
#define DMTX_SYMBOL_SQUARE_AUTO -1 #define DMTX_REGION_NOT_FOUND 0
#define DMTX_SYMBOL_SQUARE_COUNT 24 #define DMTX_REGION_FOUND 1
#define DMTX_SYMBOL_RECT_AUTO -2
#define DMTX_SYMBOL_RECT_COUNT 6 #define DMTX_MODULE_OFF 0x00
#define DMTX_MODULE_ON_RED 0x01
#define DMTX_MODULE_ON_GREEN 0x02
#define DMTX_MODULE_ON_BLUE 0x04
#define DMTX_MODULE_ON_RGB 0x07 /* ON_RED | ON_GREEN | ON_BLUE */
#define DMTX_MODULE_UNSURE 0x08 /* ON_RED | ON_GREEN | ON_BLUE */
#define DMTX_MODULE_ASSIGNED 0x10
#define DMTX_MODULE_VISITED 0x20
#define DMTX_MODULE_DATA 0x40
#define DMTX_SYMBOL_SQUARE_AUTO -1
#define DMTX_SYMBOL_SQUARE_COUNT 24
#define DMTX_SYMBOL_RECT_AUTO -2
#define DMTX_SYMBOL_RECT_COUNT 6
typedef enum { typedef enum {
DmtxDirNone = 0x00, DmtxDirNone = 0x00,
DmtxDirUp = 0x01 << 0, DmtxDirUp = 0x01 << 0,
DmtxDirLeft = 0x01 << 1, DmtxDirLeft = 0x01 << 1,
DmtxDirDown = 0x01 << 2, DmtxDirDown = 0x01 << 2,
DmtxDirRight = 0x01 << 3, DmtxDirRight = 0x01 << 3,
DmtxDirHorizontal = DmtxDirLeft | DmtxDirRight, DmtxDirHorizontal = DmtxDirLeft | DmtxDirRight,
DmtxDirVertical = DmtxDirUp | DmtxDirDown, DmtxDirVertical = DmtxDirUp | DmtxDirDown,
DmtxDirRightUp = DmtxDirRight | DmtxDirUp, DmtxDirRightUp = DmtxDirRight | DmtxDirUp,
skipping to change at line 88 skipping to change at line 100
DmtxSchemeDecodeAsciiStd, DmtxSchemeDecodeAsciiStd,
DmtxSchemeDecodeAsciiExt, DmtxSchemeDecodeAsciiExt,
DmtxSchemeDecodeC40, DmtxSchemeDecodeC40,
DmtxSchemeDecodeText, DmtxSchemeDecodeText,
DmtxSchemeDecodeX12, DmtxSchemeDecodeX12,
DmtxSchemeDecodeEdifact, DmtxSchemeDecodeEdifact,
DmtxSchemeDecodeBase256 DmtxSchemeDecodeBase256
} DmtxSchemeDecode; } DmtxSchemeDecode;
typedef enum { typedef enum {
DmtxSingleScanOnly = 0x01
} DmtxDecodeOptions;
typedef enum {
DmtxSymAttribSymbolRows, DmtxSymAttribSymbolRows,
DmtxSymAttribSymbolCols, DmtxSymAttribSymbolCols,
DmtxSymAttribDataRegionRows, DmtxSymAttribDataRegionRows,
DmtxSymAttribDataRegionCols, DmtxSymAttribDataRegionCols,
DmtxSymAttribHorizDataRegions, DmtxSymAttribHorizDataRegions,
DmtxSymAttribVertDataRegions, DmtxSymAttribVertDataRegions,
DmtxSymAttribMappingMatrixRows, DmtxSymAttribMappingMatrixRows,
DmtxSymAttribMappingMatrixCols, DmtxSymAttribMappingMatrixCols,
DmtxSymAttribDataWordLength, DmtxSymAttribDataWordLength,
DmtxSymAttribErrorWordLength, DmtxSymAttribErrorWordLength,
DmtxSymAttribInterleavedBlocks DmtxSymAttribInterleavedBlocks
} DmtxSymAttribute; } DmtxSymAttribute;
typedef enum { typedef enum {
DmtxCorner00 = 0x01 << 0, DmtxCorner00 = 0x01 << 0,
DmtxCorner10 = 0x01 << 1, DmtxCorner10 = 0x01 << 1,
DmtxCorner11 = 0x01 << 2, DmtxCorner11 = 0x01 << 2,
DmtxCorner01 = 0x01 << 3 DmtxCorner01 = 0x01 << 3
} DmtxCornerLoc; } DmtxCornerLoc;
typedef float DmtxMatrix3[3][3]; typedef double DmtxMatrix3[3][3];
typedef struct DmtxMatrix3Struct_struct { typedef struct DmtxMatrix3Struct_struct {
DmtxMatrix3 m; DmtxMatrix3 m;
} DmtxMatrix3Struct; } DmtxMatrix3Struct;
typedef struct DmtxColor3_struct { typedef struct DmtxColor3_struct {
double R; double R;
double G; double G;
double B; double B;
} DmtxColor3; } DmtxColor3;
typedef struct DmtxPixelLoc_struct {
int X;
int Y;
} DmtxPixelLoc;
typedef struct DmtxVector2_struct { typedef struct DmtxVector2_struct {
double X; double X;
double Y; double Y;
} DmtxVector2; } DmtxVector2;
typedef struct DmtxRay3_struct { typedef struct DmtxRay3_struct {
DmtxColor3 p; DmtxColor3 p;
DmtxColor3 c; DmtxColor3 c;
} DmtxRay3; } DmtxRay3;
typedef struct DmtxRay2_struct { typedef struct DmtxRay2_struct {
char isDefined; char isDefined;
float tMin, tMax; double tMin, tMax;
DmtxVector2 p; DmtxVector2 p;
DmtxVector2 v; DmtxVector2 v;
} DmtxRay2; } DmtxRay2;
typedef struct DmtxGradient_struct { typedef struct DmtxGradient_struct {
char isDefined; char isDefined;
float tMin, tMax, tMid; double tMin, tMax, tMid;
DmtxRay3 ray; DmtxRay3 ray;
DmtxColor3 color, colorPrev; /* XXX maybe these aren't appropriate varia bles for a gradient? */ DmtxColor3 color, colorPrev; /* XXX maybe these aren't appropriate varia bles for a gradient? */
} DmtxGradient; } DmtxGradient;
typedef struct DmtxPixel_struct { typedef struct DmtxPixel_struct {
unsigned char R; unsigned char R;
unsigned char G; unsigned char G;
unsigned char B; unsigned char B;
} DmtxPixel; } DmtxPixel;
typedef enum {
DmtxCompassDirNeg45 = 0x01,
DmtxCompassDir0 = 0x02,
DmtxCompassDir45 = 0x04,
DmtxCompassDir90 = 0x08
} DmtxCompassDir;
typedef struct DmtxCompassEdge_struct {
char assigned;
double magnitude; /* sqrt(R^2 + G^2 + B^2) */
DmtxColor3 intensity;
DmtxCompassDir edgeDir;
DmtxCompassDir scanDir; /* DmtxCompassDir0 | DmtxCompassDir90 */
} DmtxCompassEdge;
typedef struct DmtxImage_struct { typedef struct DmtxImage_struct {
unsigned int width; unsigned int pageCount;
unsigned int height; unsigned int width;
DmtxPixel *pxl; unsigned int height;
DmtxPixel *pxl;
DmtxCompassEdge *compass;
} DmtxImage; } DmtxImage;
typedef struct DmtxEdge_struct { typedef struct DmtxEdge_struct {
int offset; int offset;
float t; double t;
DmtxColor3 color; DmtxColor3 color;
} DmtxEdge; } DmtxEdge;
typedef struct DmtxChain_struct { typedef struct DmtxChain_struct {
float tx, ty; double tx, ty;
float phi, shx; double phi, shx;
float scx, scy; double scx, scy;
float bx0, bx1; double bx0, bx1;
float by0, by1; double by0, by1;
float sz; double sz;
} DmtxChain; } DmtxChain;
typedef struct DmtxCorners_struct { typedef struct DmtxCorners_struct {
DmtxCornerLoc known; /* combination of (DmtxCorner00 | DmtxCorner10 | Dm txCorner11 | DmtxCorner01) */ DmtxCornerLoc known; /* combination of (DmtxCorner00 | DmtxCorner10 | Dm txCorner11 | DmtxCorner01) */
DmtxVector2 c00; DmtxVector2 c00;
DmtxVector2 c10; DmtxVector2 c10;
DmtxVector2 c11; DmtxVector2 c11;
DmtxVector2 c01; DmtxVector2 c01;
} DmtxCorners; } DmtxCorners;
typedef struct DmtxMatrixRegion_struct { typedef struct DmtxRegion_struct {
int found; /* DMTX_REGION_FOUND | DMTX_REGION_NOT_FO
UND | DMTX_REGION_EOF */
DmtxGradient gradient; /* Linear blend of colors between backgro und and symbol color */ DmtxGradient gradient; /* Linear blend of colors between backgro und and symbol color */
DmtxChain chain; /* List of values that are used to build a transformation matrix */ DmtxChain chain; /* List of values that are used to build a transformation matrix */
DmtxCorners corners; /* Corners of barcode region */ DmtxCorners corners; /* Corners of barcode region */
DmtxMatrix3 raw2fit; /* 3x3 transformation from raw image to f itted barcode grid */ DmtxMatrix3 raw2fit; /* 3x3 transformation from raw image to f itted barcode grid */
DmtxMatrix3 fit2raw; /* 3x3 transformation from fitted barcode grid to raw image */ DmtxMatrix3 fit2raw; /* 3x3 transformation from fitted barcode grid to raw image */
int sizeIdx; /* Index of arrays that store Data Matrix constants */ int sizeIdx; /* Index of arrays that store Data Matrix constants */
int symbolRows; /* Number of total rows in symbol includi ng alignment patterns */ int symbolRows; /* Number of total rows in symbol includi ng alignment patterns */
int symbolCols; /* Number of total columns in symbol incl uding alignment patterns */ int symbolCols; /* Number of total columns in symbol incl uding alignment patterns */
int mappingRows; /* Number of data rows in symbol */ int mappingRows; /* Number of data rows in symbol */
int mappingCols; /* Number of data columns in symbol */ int mappingCols; /* Number of data columns in symbol */
} DmtxRegion;
typedef struct DmtxMessage_struct {
int arraySize; /* mappingRows * mappingCols */ int arraySize; /* mappingRows * mappingCols */
int codeSize; /* Size of encoded data (data words + err or words) */ int codeSize; /* Size of encoded data (data words + err or words) */
int outputSize; /* Size of buffer used to hold decoded da ta */ int outputSize; /* Size of buffer used to hold decoded da ta */
int outputIdx; /* Internal index used to store output pr ogress */ int outputIdx; /* Internal index used to store output pr ogress */
unsigned char *array; /* Pointer to internal representation of scanned Data Matrix modules */ unsigned char *array; /* Pointer to internal representation of scanned Data Matrix modules */
unsigned char *code; /* Pointer to internal storage of code wo rds (data and error) */ unsigned char *code; /* Pointer to internal storage of code wo rds (data and error) */
unsigned char *output; /* Pointer to internal storage of decoded output */ unsigned char *output; /* Pointer to internal storage of decoded output */
} DmtxMatrixRegion; } DmtxMessage;
typedef struct DmtxEdgeFollower_struct { typedef struct DmtxEdgeFollower_struct {
int slope; int slope;
int turnCount; int turnCount;
int paraOffset; int paraOffset;
float perpOffset; double perpOffset;
float tMin, tMid, tMax; double tMin, tMid, tMax;
DmtxRay3 ray; DmtxRay3 ray;
DmtxRay2 line0, line1; DmtxRay2 line0, line1;
DmtxDirection dir; DmtxDirection dir;
} DmtxEdgeFollower; } DmtxEdgeFollower;
typedef struct DmtxScanGrid_struct {
/* set once */
int minExtent; /* Smallest cross size used in scan */
int maxExtent; /* Size of bounding grid region (2^N - 1) */
int xOffset; /* Offset to obtain image X coordinate */
int yOffset; /* Offset to obtain image Y coordinate */
/* reset for each level */
int total; /* Total number of crosses at this size */
int extent; /* Length/width of cross in pixels */
int jumpSize; /* Distance in pixels between cross centers */
int pixelTotal; /* Total pixel count within an individual cross path */
int startPos; /* X and Y coordinate of first cross center in pattern *
/
/* reset for each cross */
int pixelCount; /* Progress (pixel count) within current cross pattern *
/
int xCenter; /* X center of current cross pattern */
int yCenter; /* Y center of current cross pattern */
} DmtxScanGrid;
typedef struct DmtxDecode_struct DmtxDecode; typedef struct DmtxDecode_struct DmtxDecode;
struct DmtxDecode_struct { struct DmtxDecode_struct {
int option; DmtxImage *image;
int mosaic; DmtxScanGrid grid;
int matrixCount;
DmtxMatrixRegion matrix[16];
DmtxImage image;
void (* buildMatrixCallback2)(DmtxMatrixRegion *);
void (* buildMatrixCallback3)(DmtxMatrix3);
void (* buildMatrixCallback4)(DmtxMatrix3);
void (* plotPointCallback)(DmtxVector2, int, int, int);
void (* xfrmPlotPointCallback)(DmtxVector2, DmtxMatrix3, int, int);
void (* finalCallback)(DmtxDecode *, DmtxMatrixRegion *);
void (* plotModuleCallback)(DmtxDecode *, DmtxMatrixRegion *, int, int,
DmtxColor3);
}; };
typedef struct DmtxEncode_struct { typedef struct DmtxEncode_struct {
int moduleSize; int moduleSize;
int marginSize; int marginSize;
DmtxEncodeMethod method; DmtxEncodeMethod method;
DmtxSchemeEncode scheme; DmtxSchemeEncode scheme;
DmtxImage image; DmtxMessage *message;
DmtxMatrix3 xfrm; DmtxImage *image;
DmtxMatrix3 rxfrm; DmtxRegion region;
DmtxMatrixRegion matrix; DmtxMatrix3 xfrm; /* XXX still necessary? */
DmtxMatrix3 rxfrm; /* XXX still necessary? */
} DmtxEncode; } DmtxEncode;
typedef struct DmtxChannel_struct { typedef struct DmtxChannel_struct {
DmtxSchemeEncode encScheme; /* current encodation scheme */ DmtxSchemeEncode encScheme; /* current encodation scheme */
int invalid; /* channel status (invalid if non- zero) */ int invalid; /* channel status (invalid if non- zero) */
unsigned char *inputPtr; /* pointer to current input charac ter */ unsigned char *inputPtr; /* pointer to current input charac ter */
unsigned char *inputStop; /* pointer to position after final input character */ unsigned char *inputStop; /* pointer to position after final input character */
int encodedLength; /* encoded length (units of 2/3 bi ts) */ int encodedLength; /* encoded length (units of 2/3 bi ts) */
int currentLength; /* current length (units of 2/3 bi ts) */ int currentLength; /* current length (units of 2/3 bi ts) */
int schemeStart; /* currentLength value before writ ing 1st encoded word in current scheme */ int schemeStart; /* currentLength value before writ ing 1st encoded word in current scheme */
skipping to change at line 265 skipping to change at line 310
} DmtxChannelGroup; } DmtxChannelGroup;
typedef struct DmtxTriplet_struct { typedef struct DmtxTriplet_struct {
unsigned char value[3]; unsigned char value[3];
} DmtxTriplet; } DmtxTriplet;
typedef struct DmtxQuadruplet_struct { typedef struct DmtxQuadruplet_struct {
unsigned char value[4]; unsigned char value[4];
} DmtxQuadruplet; } DmtxQuadruplet;
/* dmtxencode.c */
extern DmtxEncode dmtxEncodeStructInit(void);
extern void dmtxEncodeStructDeInit(DmtxEncode *enc);
extern int dmtxEncodeDataMatrix(DmtxEncode *enc, int n, unsigned char *s, i
nt sizeIdxRequest);
extern int dmtxEncodeDataMosaic(DmtxEncode *enc, int n, unsigned char *s, i
nt sizeIdxRequest);
/* dmtxdecode.c */
extern DmtxDecode dmtxDecodeStructInit(DmtxImage *img, DmtxPixelLoc p0, Dmt
xPixelLoc p1, int gap);
extern void dmtxDecodeStructDeInit(DmtxDecode *dec);
extern DmtxMessage *dmtxDecodeMatrixRegion(DmtxDecode *dec, DmtxRegion *reg
, int fix);
extern DmtxMessage *dmtxMessageMalloc(int sizeIdx);
extern void dmtxMessageFree(DmtxMessage **mesg);
/* dmtxregion.c */
extern DmtxRegion dmtxDecodeFindNextRegion(DmtxDecode *decode);
extern DmtxRegion dmtxScanPixel(DmtxDecode *decode, DmtxPixelLoc loc);
/* dmtximage.c */
extern DmtxImage *dmtxImageMalloc(int width, int height);
extern int dmtxImageFree(DmtxImage **img);
extern int dmtxImageGetWidth(DmtxImage *img);
extern int dmtxImageGetHeight(DmtxImage *img);
extern int dmtxImageGetOffset(DmtxImage *img, DmtxDirection dir, int lineNb
r, int offset);
extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, DmtxVector2 *v2); extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, DmtxVector2 *v2);
extern DmtxVector2 *dmtxVector2Add(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx Vector2 *v2); extern DmtxVector2 *dmtxVector2Add(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx Vector2 *v2);
extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, DmtxVector2 *v2); extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, DmtxVector2 *v2);
extern DmtxVector2 *dmtxVector2Sub(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx Vector2 *v2); extern DmtxVector2 *dmtxVector2Sub(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx Vector2 *v2);
extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, float s); extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, double s);
extern DmtxVector2 *dmtxVector2Scale(DmtxVector2 *vOut, DmtxVector2 *v, flo extern DmtxVector2 *dmtxVector2Scale(DmtxVector2 *vOut, DmtxVector2 *v, dou
at s); ble s);
extern float dmtxVector2Cross(DmtxVector2 *v1, DmtxVector2 *v2); extern double dmtxVector2Cross(DmtxVector2 *v1, DmtxVector2 *v2);
extern float dmtxVector2Norm(DmtxVector2 *v); extern int dmtxVector2Norm(DmtxVector2 *v);
extern float dmtxVector2Dot(DmtxVector2 *v1, DmtxVector2 *v2); extern double dmtxVector2Dot(DmtxVector2 *v1, DmtxVector2 *v2);
extern float dmtxVector2Mag(DmtxVector2 *v); extern double dmtxVector2Mag(DmtxVector2 *v);
extern float dmtxDistanceFromRay2(DmtxRay2 *r, DmtxVector2 *q); extern double dmtxDistanceFromRay2(DmtxRay2 *r, DmtxVector2 *q);
extern float dmtxDistanceAlongRay2(DmtxRay2 *r, DmtxVector2 *q); extern double dmtxDistanceAlongRay2(DmtxRay2 *r, DmtxVector2 *q);
extern int dmtxRay2Intersect(DmtxVector2 *point, DmtxRay2 *p0, DmtxRay2 *p1 ); extern int dmtxRay2Intersect(DmtxVector2 *point, DmtxRay2 *p0, DmtxRay2 *p1 );
extern int dmtxPointAlongRay2(DmtxVector2 *point, DmtxRay2 *r, float t); extern int dmtxPointAlongRay2(DmtxVector2 *point, DmtxRay2 *r, double t);
extern void dmtxMatrix3Copy(DmtxMatrix3 m0, DmtxMatrix3 m1); extern void dmtxMatrix3Copy(DmtxMatrix3 m0, DmtxMatrix3 m1);
extern void dmtxMatrix3Identity(DmtxMatrix3 m); extern void dmtxMatrix3Identity(DmtxMatrix3 m);
extern void dmtxMatrix3Translate(DmtxMatrix3 m, float tx, float ty); extern void dmtxMatrix3Translate(DmtxMatrix3 m, double tx, double ty);
extern void dmtxMatrix3Rotate(DmtxMatrix3 m, double angle); extern void dmtxMatrix3Rotate(DmtxMatrix3 m, double angle);
extern void dmtxMatrix3Scale(DmtxMatrix3 m, float sx, float sy); extern void dmtxMatrix3Scale(DmtxMatrix3 m, double sx, double sy);
extern void dmtxMatrix3Shear(DmtxMatrix3 m, float shx, float shy); extern void dmtxMatrix3Shear(DmtxMatrix3 m, double shx, double shy);
extern DmtxVector2 *dmtxMatrix3VMultiplyBy(DmtxVector2 *v, DmtxMatrix3 m); extern int dmtxMatrix3VMultiplyBy(DmtxVector2 *v, DmtxMatrix3 m);
extern DmtxVector2 *dmtxMatrix3VMultiply(DmtxVector2 *vOut, DmtxVector2 *vI extern int dmtxMatrix3VMultiply(DmtxVector2 *vOut, DmtxVector2 *vIn, DmtxMa
n, DmtxMatrix3 m); trix3 m);
extern void dmtxMatrix3Multiply(DmtxMatrix3 mOut, DmtxMatrix3 m0, DmtxMatri x3 m1); extern void dmtxMatrix3Multiply(DmtxMatrix3 mOut, DmtxMatrix3 m0, DmtxMatri x3 m1);
extern void dmtxMatrix3MultiplyBy(DmtxMatrix3 m0, DmtxMatrix3 m1); extern void dmtxMatrix3MultiplyBy(DmtxMatrix3 m0, DmtxMatrix3 m1);
extern void dmtxMatrix3LineSkewTop(DmtxMatrix3 m, float b0, float b1, float extern void dmtxMatrix3LineSkewTop(DmtxMatrix3 m, double b0, double b1, dou
sz); ble sz);
extern void dmtxMatrix3LineSkewTopInv(DmtxMatrix3 m, float b0, float b1, fl extern void dmtxMatrix3LineSkewTopInv(DmtxMatrix3 m, double b0, double b1,
oat sz); double sz);
extern void dmtxMatrix3LineSkewSide(DmtxMatrix3 m, float b0, float b1, floa extern void dmtxMatrix3LineSkewSide(DmtxMatrix3 m, double b0, double b1, do
t sz); uble sz);
extern void dmtxMatrix3LineSkewSideInv(DmtxMatrix3 m, float b0, float b1, f extern void dmtxMatrix3LineSkewSideInv(DmtxMatrix3 m, double b0, double b1,
loat sz); double sz);
extern void dmtxMatrix3Print(DmtxMatrix3 m); extern void dmtxMatrix3Print(DmtxMatrix3 m);
extern DmtxPixel dmtxPixelFromImage(DmtxImage *image, int x, int y); extern DmtxPixel dmtxPixelFromImage(DmtxImage *img, int x, int y);
extern void dmtxColor3FromImage2(DmtxColor3 *color, DmtxImage *image, DmtxV extern void dmtxColor3FromImage2(DmtxColor3 *color, DmtxImage *img, DmtxVec
ector2 p); tor2 p);
extern DmtxColor3 *dmtxColor3FromPixel(DmtxColor3 *color, DmtxPixel *pxl); extern DmtxColor3 *dmtxColor3FromPixel(DmtxColor3 *color, DmtxPixel *pxl);
extern void dmtxPixelFromColor3(DmtxPixel *pxl, DmtxColor3 *color); extern void dmtxPixelFromColor3(DmtxPixel *pxl, DmtxColor3 *color);
extern DmtxColor3 dmtxColor3AlongRay3(DmtxRay3 *ray, float dist); extern DmtxColor3 dmtxColor3AlongRay3(DmtxRay3 *ray, double dist);
extern DmtxColor3 *dmtxColor3AddTo(DmtxColor3 *v1, DmtxColor3 *v2); extern DmtxColor3 *dmtxColor3AddTo(DmtxColor3 *v1, DmtxColor3 *v2);
extern DmtxColor3 *dmtxColor3Add(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo r3 *v2); extern DmtxColor3 *dmtxColor3Add(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo r3 *v2);
extern DmtxColor3 *dmtxColor3SubFrom(DmtxColor3 *v1, DmtxColor3 *v2); extern DmtxColor3 *dmtxColor3SubFrom(DmtxColor3 *v1, DmtxColor3 *v2);
extern DmtxColor3 *dmtxColor3Sub(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo r3 *v2); extern DmtxColor3 *dmtxColor3Sub(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo r3 *v2);
extern DmtxColor3 *dmtxColor3ScaleBy(DmtxColor3 *v, float s); extern DmtxColor3 *dmtxColor3ScaleBy(DmtxColor3 *v, double s);
extern DmtxColor3 *dmtxColor3Scale(DmtxColor3 *vOut, DmtxColor3 *v, float s extern DmtxColor3 *dmtxColor3Scale(DmtxColor3 *vOut, DmtxColor3 *v, double
); s);
extern DmtxColor3 *dmtxColor3Cross(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxCo lor3 *v2); extern DmtxColor3 *dmtxColor3Cross(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxCo lor3 *v2);
extern float dmtxColor3Norm(DmtxColor3 *v); extern int dmtxColor3Norm(DmtxColor3 *v);
extern float dmtxColor3Dot(DmtxColor3 *v1, DmtxColor3 *v2); extern double dmtxColor3Dot(DmtxColor3 *v1, DmtxColor3 *v2);
extern float dmtxColor3Mag(DmtxColor3 *v); extern double dmtxColor3Mag(DmtxColor3 *v);
extern float dmtxDistanceFromRay3(DmtxRay3 *r, DmtxColor3 *q); extern double dmtxDistanceFromRay3(DmtxRay3 *r, DmtxColor3 *q);
extern float dmtxDistanceAlongRay3(DmtxRay3 *r, DmtxColor3 *q); extern double dmtxDistanceAlongRay3(DmtxRay3 *r, DmtxColor3 *q);
extern int dmtxPointAlongRay3(DmtxColor3 *point, DmtxRay3 *r, float t); extern int dmtxPointAlongRay3(DmtxColor3 *point, DmtxRay3 *r, double t);
extern int dmtxImageInit(DmtxImage *image);
extern int dmtxImageDeInit(DmtxImage *image);
extern int dmtxImageGetWidth(DmtxImage *image);
extern int dmtxImageGetHeight(DmtxImage *image);
extern int dmtxImageGetOffset(DmtxImage *image, DmtxDirection dir, int line
Nbr, int offset);
extern int dmtxScanLine(DmtxDecode *decode, DmtxDirection dir, int lineNbr)
;
extern void dmtxMatrixRegionDeInit(DmtxMatrixRegion *region);
extern DmtxDecode *dmtxDecodeStructCreate(void);
extern void dmtxDecodeStructDestroy(DmtxDecode **decode);
extern DmtxMatrixRegion *dmtxDecodeGetMatrix(DmtxDecode *decode, int index)
;
extern int dmtxDecodeGetMatrixCount(DmtxDecode *decode);
extern void dmtxScanStartNew(DmtxDecode *decode);
extern DmtxEncode *dmtxEncodeStructCreate(void);
extern void dmtxEncodeStructDestroy(DmtxEncode **encode);
extern int dmtxEncodeDataMatrix(DmtxEncode *encode, int inputSize, unsigned
char *inputString, int sizeIdxRequest);
extern int dmtxEncodeDataMosaic(DmtxEncode *encode, int inputSize, unsigned
char *inputString, int sizeIdxRequest);
extern void dmtxSetBuildMatrixCallback2(DmtxDecode *decode, void (* func)(D
mtxMatrixRegion *));
extern void dmtxSetBuildMatrixCallback3(DmtxDecode *decode, void (* func)(D
mtxMatrix3));
extern void dmtxSetBuildMatrixCallback4(DmtxDecode *decode, void (* func)(D
mtxMatrix3));
extern void dmtxSetPlotPointCallback(DmtxDecode *decode, void (* func)(Dmtx
Vector2, int, int, int));
extern void dmtxSetXfrmPlotPointCallback(DmtxDecode *decode, void (* func)(
DmtxVector2, DmtxMatrix3, int, int));
extern void dmtxSetFinalCallback(DmtxDecode *decode, void (* func)(DmtxDeco
de *, DmtxMatrixRegion *));
extern void dmtxSetPlotModuleCallback(DmtxDecode *decode, void (* func)(Dmt
xDecode *, DmtxMatrixRegion *, int, int, DmtxColor3));
extern int dmtxSymbolModuleStatus(DmtxMatrixRegion *region, int row, int co l); extern int dmtxSymbolModuleStatus(DmtxMessage *mapping, int sizeIdx, int ro w, int col);
extern int dmtxGetSymbolAttribute(int attribute, int sizeIdx); extern int dmtxGetSymbolAttribute(int attribute, int sizeIdx);
extern char *dmtxVersion(void);
#endif #endif
 End of changes. 32 change blocks. 
136 lines changed or deleted 174 lines changed or added

This html diff was produced by rfcdiff 1.41. The latest version is available from http://tools.ietf.org/tools/rfcdiff/