dmtx.h   dmtx.h 
/* /*
libdmtx - Data Matrix Encoding/Decoding Library libdmtx - Data Matrix Encoding/Decoding Library
Copyright (c) 2008 Mike Laughton Copyright (C) 2008, 2009 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 519 2008-11-21 05:27:42Z mblaughton $ */ /* $Id: dmtx.h 770 2009-03-02 22:16:32Z mblaughton $ */
/** /**
* @file dmtx.h * @file dmtx.h
* @brief Main libdmtx header * @brief Main libdmtx header
*/ */
#ifndef __DMTX_H__ #ifndef __DMTX_H__
#define __DMTX_H__ #define __DMTX_H__
/* Time headers are required for DmtxTime struct below */
#include <time.h> #include <time.h>
#if defined(HAVE_SYS_TIME_H) #ifdef HAVE_SYS_TIME_H
#include <sys/time.h> #include <sys/time.h>
#endif #endif
#ifdef __cplusplus #ifdef __cplusplus
extern "C" { extern "C" {
#endif #endif
#ifndef M_PI #ifndef M_PI
#define M_PI 3.14159265358979323846 #define M_PI 3.14159265358979323846
#endif #endif
#ifndef M_PI_2 #ifndef M_PI_2
#define M_PI_2 1.57079632679489661923 #define M_PI_2 1.57079632679489661923
#endif #endif
#define DMTX_VERSION "0.6.0" #define DmtxVersion "0.7.0"
#define DMTX_FAILURE 0
#define DMTX_SUCCESS 1
#define DMTX_FALSE 0
#define DMTX_TRUE 1
#define DMTX_BAD_OFFSET -1 #define DmtxUndefined -1
#define DMTX_STATUS_NOT_SCANNED 0
#define DMTX_STATUS_VALID 1
#define DMTX_STATUS_INVALID 2
#define DMTX_DISPLAY_SQUARE 1
#define DMTX_DISPLAY_POINT 2
#define DMTX_DISPLAY_CIRCLE 3
#define DMTX_REGION_FOUND 0
#define DMTX_REGION_NOT_FOUND 1
#define DMTX_REGION_TIMEOUT 2
#define DMTX_REGION_EOF 3
#define DMTX_REGION_DROPPED_EDGE 4
#define DMTX_REGION_DROPPED_FINDER 5
#define DMTX_REGION_DROPPED_TOP 6
#define DMTX_REGION_DROPPED_RIGHT 7
#define DMTX_REGION_DROPPED_SIZE 8
#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_ON 0x07
#define DMTX_MODULE_UNSURE 0x08
#define DMTX_MODULE_ASSIGNED 0x10
#define DMTX_MODULE_VISITED 0x20
#define DMTX_MODULE_DATA 0x40
#define DMTX_FORMAT_MATRIX 0 #define DmtxModuleOff 0x00
#define DMTX_FORMAT_MOSAIC 1 #define DmtxModuleOnRed 0x01
#define DmtxModuleOnGreen 0x02
#define DMTX_SYMBOL_SQUARE_COUNT 24 #define DmtxModuleOnBlue 0x04
#define DMTX_SYMBOL_RECT_COUNT 6 #define DmtxModuleOnRGB 0x07 /* OnRed | OnGreen | OnBlue */
#define DmtxModuleOn 0x07
#define DmtxModuleUnsure 0x08
#define DmtxModuleAssigned 0x10
#define DmtxModuleVisited 0x20
#define DmtxModuleData 0x40
#define DmtxFormatMatrix 0
#define DmtxFormatMosaic 1
#define DmtxSymbolSquareCount 24
#define DmtxSymbolRectCount 6
#define DmtxPassFail unsigned int
#define DmtxPass 1
#define DmtxFail 0
#define DmtxBoolean unsigned int
#define DmtxTrue 1
#define DmtxFalse 0
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 160 skipping to change at line 146
} 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 enum { typedef enum {
DmtxPropEdgeMin, /* Encoding properties */
DmtxPropScheme = 100,
DmtxPropSizeRequest,
DmtxPropMarginSize,
DmtxPropModuleSize,
/* Decoding properties */
DmtxPropEdgeMin = 200,
DmtxPropEdgeMax, DmtxPropEdgeMax,
DmtxPropScanGap, DmtxPropScanGap,
DmtxPropSquareDevn, DmtxPropSquareDevn,
DmtxPropSymbolSize, DmtxPropSymbolSize,
DmtxPropEdgeThresh, DmtxPropEdgeThresh,
DmtxPropWidth, /* Image properties */
DmtxPropWidth = 300,
DmtxPropHeight, DmtxPropHeight,
DmtxPropArea, DmtxPropPixelPacking,
DmtxPropXmin, DmtxPropBitsPerPixel,
DmtxPropBytesPerPixel,
DmtxPropRowPadBytes,
DmtxPropRowSizeBytes,
DmtxPropImageFlip,
DmtxPropChannelCount,
/* Image modifiers */
DmtxPropXmin = 400,
DmtxPropXmax, DmtxPropXmax,
DmtxPropYmin, DmtxPropYmin,
DmtxPropYmax, DmtxPropYmax,
DmtxPropShrinkMin, DmtxPropScale
DmtxPropShrinkMax, } DmtxProperty;
DmtxPropScale,
DmtxPropScaledWidth,
DmtxPropScaledHeight,
DmtxPropScaledArea,
DmtxPropScaledXmin,
DmtxPropScaledXmax,
DmtxPropScaledYmin,
DmtxPropScaledYmax
} DmtxDecodeProperty;
typedef enum { typedef enum {
DmtxSymbolRectAuto = -3, DmtxSymbolRectAuto = -3,
DmtxSymbolSquareAuto = -2, DmtxSymbolSquareAuto = -2,
DmtxSymbolShapeAuto = -1, DmtxSymbolShapeAuto = -1,
DmtxSymbol10x10 = 0, DmtxSymbol10x10 = 0,
DmtxSymbol12x12, DmtxSymbol12x12,
DmtxSymbol14x14, DmtxSymbol14x14,
DmtxSymbol16x16, DmtxSymbol16x16,
DmtxSymbol18x18, DmtxSymbol18x18,
skipping to change at line 221 skipping to change at line 212
DmtxSymbol132x132, DmtxSymbol132x132,
DmtxSymbol144x144, DmtxSymbol144x144,
DmtxSymbol8x18, DmtxSymbol8x18,
DmtxSymbol8x32, DmtxSymbol8x32,
DmtxSymbol12x26, DmtxSymbol12x26,
DmtxSymbol12x36, DmtxSymbol12x36,
DmtxSymbol16x36, DmtxSymbol16x36,
DmtxSymbol16x48 DmtxSymbol16x48
} DmtxSymbolSize; } DmtxSymbolSize;
typedef double DmtxMatrix3[3][3]; typedef enum {
typedef unsigned char DmtxRgb[3]; /* Custom format */
DmtxPackCustom = 100,
/* 1 bpp */
DmtxPack1bppK = 200,
/* 8 bpp grayscale */
DmtxPack8bppK = 300,
/* 16 bpp formats */
DmtxPack16bppRGB = 400,
DmtxPack16bppRGBX,
DmtxPack16bppXRGB,
DmtxPack16bppBGR,
DmtxPack16bppBGRX,
DmtxPack16bppXBGR,
DmtxPack16bppYCbCr,
/* 24 bpp formats */
DmtxPack24bppRGB = 500,
DmtxPack24bppBGR,
DmtxPack24bppYCbCr,
/* 32 bpp formats */
DmtxPack32bppRGBX = 600,
DmtxPack32bppXRGB,
DmtxPack32bppBGRX,
DmtxPack32bppXBGR,
DmtxPack32bppCMYK
} DmtxPackOrder;
/** typedef enum {
* @struct DmtxColor3 DmtxFlipNone = 0x00,
* @brief DmtxColor3 DmtxFlipX = 0x01 << 0,
*/ DmtxFlipY = 0x01 << 1
typedef struct DmtxColor3_struct { } DmtxFlip;
double R;
double G; typedef double DmtxMatrix3[3][3];
double B;
} DmtxColor3;
/** /**
* @struct DmtxPixelLoc * @struct DmtxPixelLoc
* @brief DmtxPixelLoc * @brief DmtxPixelLoc
*/ */
typedef struct DmtxPixelLoc_struct { typedef struct DmtxPixelLoc_struct {
int X; int X;
int Y; int Y;
int status;
} DmtxPixelLoc; } DmtxPixelLoc;
/** /**
* @struct DmtxVector2 * @struct DmtxVector2
* @brief DmtxVector2 * @brief DmtxVector2
*/ */
typedef struct DmtxVector2_struct { typedef struct DmtxVector2_struct {
double X; double X;
double Y; double Y;
} DmtxVector2; } DmtxVector2;
/** /**
* @struct DmtxRay3
* @brief DmtxRay3
*/
typedef struct DmtxRay3_struct {
DmtxColor3 p;
DmtxColor3 c;
} DmtxRay3;
/**
* @struct DmtxRay2 * @struct DmtxRay2
* @brief DmtxRay2 * @brief DmtxRay2
*/ */
typedef struct DmtxRay2_struct { typedef struct DmtxRay2_struct {
char isDefined;
double tMin, tMax; double tMin, tMax;
DmtxVector2 p; DmtxVector2 p;
DmtxVector2 v; DmtxVector2 v;
} DmtxRay2; } DmtxRay2;
/** /**
* @struct DmtxGradient
* @brief DmtxGradient
*/
typedef struct DmtxGradient_struct {
char isDefined;
double tMin, tMax;
DmtxRay3 ray;
} DmtxGradient;
/**
* @struct DmtxImage * @struct DmtxImage
* @brief DmtxImage * @brief DmtxImage
*/ */
typedef struct DmtxImage_struct { typedef struct DmtxImage_struct {
int width; /* unscaled */ int width;
int height; /* unscaled */ int height;
int xMin; /* unscaled */ int pixelPacking;
int xMax; /* unscaled */ int bitsPerPixel;
int yMin; /* unscaled */ int bytesPerPixel;
int yMax; /* unscaled */ int rowPadBytes;
int scale; int rowSizeBytes;
int widthScaled; int imageFlip;
int heightScaled; int channelCount;
int xMinScaled; int channelStart[4];
int xMaxScaled; int bitsPerChannel[4];
int yMinScaled; unsigned char *pxl;
int yMaxScaled;
int pageCount;
unsigned char *cache;
DmtxRgb *pxl;
} DmtxImage; } DmtxImage;
/** /**
* @struct DmtxPointFlow * @struct DmtxPointFlow
* @brief DmtxPointFlow * @brief DmtxPointFlow
*/ */
typedef struct DmtxPointFlow_struct { typedef struct DmtxPointFlow_struct {
int plane; int plane;
int arrive; int arrive;
int depart; int depart;
skipping to change at line 341 skipping to change at line 329
DmtxPixelLoc locBeg; DmtxPixelLoc locBeg;
DmtxPixelLoc locPos; DmtxPixelLoc locPos;
DmtxPixelLoc locNeg; DmtxPixelLoc locNeg;
} DmtxBestLine; } DmtxBestLine;
/** /**
* @struct DmtxRegion * @struct DmtxRegion
* @brief DmtxRegion * @brief DmtxRegion
*/ */
typedef struct DmtxRegion_struct { typedef struct DmtxRegion_struct {
int found; /* DMTX_REGION_FOUND | DMTX_REGION_NOT_FO UND | DMTX_REGION_EOF */
/* Trail blazing values */ /* Trail blazing values */
int jumpToPos; /* */ int jumpToPos; /* */
int jumpToNeg; /* */ int jumpToNeg; /* */
int stepsTotal; /* */ int stepsTotal; /* */
DmtxPixelLoc finalPos; /* */ DmtxPixelLoc finalPos; /* */
DmtxPixelLoc finalNeg; /* */ DmtxPixelLoc finalNeg; /* */
DmtxPixelLoc boundMin; /* */ DmtxPixelLoc boundMin; /* */
DmtxPixelLoc boundMax; /* */ DmtxPixelLoc boundMax; /* */
DmtxPointFlow flowBegin; /* */ DmtxPointFlow flowBegin; /* */
skipping to change at line 395 skipping to change at line 382
/* Transform values */ /* Transform values */
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 */
} DmtxRegion; } DmtxRegion;
/** /**
* @struct DmtxMessage * @struct DmtxMessage
* @brief DmtxMessage * @brief DmtxMessage
*/ */
typedef struct DmtxMessage_struct { typedef struct DmtxMessage_struct {
int arraySize; /* mappingRows * mappingCols */ size_t arraySize; /* mappingRows * mappingCols */
int codeSize; /* Size of encoded data (data words + err size_t codeSize; /* Size of encoded data (data words + err
or words) */ or words) */
int outputSize; /* Size of buffer used to hold decoded da size_t outputSize; /* Size of buffer used to hold decoded da
ta */ ta */
int outputIdx; /* Internal index used to store output pr ogress */ int outputIdx; /* Internal index used to store output pr ogress */
int padCount;
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 */
} DmtxMessage; } DmtxMessage;
/** /**
* @struct DmtxScanGrid * @struct DmtxScanGrid
* @brief DmtxScanGrid * @brief DmtxScanGrid
*/ */
typedef struct DmtxScanGrid_struct { typedef struct DmtxScanGrid_struct {
skipping to change at line 433 skipping to change at line 421
int pixelTotal; /* Total pixel count within an individual cross path */ int pixelTotal; /* Total pixel count within an individual cross path */
int startPos; /* X and Y coordinate of first cross center in pattern * / int startPos; /* X and Y coordinate of first cross center in pattern * /
/* reset for each cross */ /* reset for each cross */
int pixelCount; /* Progress (pixel count) within current cross pattern * / int pixelCount; /* Progress (pixel count) within current cross pattern * /
int xCenter; /* X center of current cross pattern */ int xCenter; /* X center of current cross pattern */
int yCenter; /* Y center of current cross pattern */ int yCenter; /* Y center of current cross pattern */
} DmtxScanGrid; } DmtxScanGrid;
/** /**
* @struct DmtxTime
* @brief DmtxTime
*/
typedef struct DmtxTime_struct {
time_t sec;
unsigned long usec;
} DmtxTime;
/**
* @struct DmtxDecode * @struct DmtxDecode
* @brief DmtxDecode * @brief DmtxDecode
*/ */
typedef struct DmtxDecode_struct { typedef struct DmtxDecode_struct {
DmtxImage *image; /* Options */
DmtxScanGrid grid;
int edgeMin; int edgeMin;
int edgeMax; int edgeMax;
int scanGap; int scanGap;
double squareDevn; double squareDevn;
int sizeIdxExpected; int sizeIdxExpected;
int edgeThresh; int edgeThresh;
int shrinkMin;
int shrinkMax;
} DmtxDecode;
/** /* Image modifiers */
* @struct DmtxTime int xMin;
* @brief DmtxTime int xMax;
*/ int yMin;
typedef struct DmtxTime_struct { int yMax;
time_t sec; int scale;
unsigned long usec;
} DmtxTime; /* Internals */
unsigned char *cache;
DmtxImage *image;
DmtxScanGrid grid;
} DmtxDecode;
/** /**
* @struct DmtxEncode * @struct DmtxEncode
* @brief DmtxEncode * @brief DmtxEncode
*/ */
typedef struct DmtxEncode_struct { typedef struct DmtxEncode_struct {
int moduleSize; int method;
int marginSize; int scheme;
DmtxEncodeMethod method; int sizeIdxRequest;
DmtxSchemeEncode scheme; int marginSize;
DmtxMessage *message; int moduleSize;
DmtxImage *image; int pixelPacking;
DmtxRegion region; int imageFlip;
DmtxMatrix3 xfrm; /* XXX still necessary? */ int rowPadBytes;
DmtxMatrix3 rxfrm; /* XXX still necessary? */ DmtxMessage *message;
DmtxImage *image;
DmtxRegion region;
DmtxMatrix3 xfrm; /* XXX still necessary? */
DmtxMatrix3 rxfrm; /* XXX still necessary? */
} DmtxEncode; } DmtxEncode;
/** /**
* @struct DmtxChannel * @struct DmtxChannel
* @brief DmtxChannel * @brief DmtxChannel
*/ */
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 */
skipping to change at line 520 skipping to change at line 521
typedef struct DmtxQuadruplet_struct { typedef struct DmtxQuadruplet_struct {
unsigned char value[4]; unsigned char value[4];
} DmtxQuadruplet; } DmtxQuadruplet;
/* dmtxtime.c */ /* dmtxtime.c */
extern DmtxTime dmtxTimeNow(void); extern DmtxTime dmtxTimeNow(void);
extern DmtxTime dmtxTimeAdd(DmtxTime t, long msec); extern DmtxTime dmtxTimeAdd(DmtxTime t, long msec);
extern int dmtxTimeExceeded(DmtxTime timeout); extern int dmtxTimeExceeded(DmtxTime timeout);
/* dmtxencode.c */ /* dmtxencode.c */
extern DmtxEncode dmtxEncodeStructInit(void); extern DmtxEncode *dmtxEncodeCreate(void);
extern void dmtxEncodeStructDeInit(DmtxEncode *enc); extern DmtxPassFail dmtxEncodeDestroy(DmtxEncode **enc);
extern int dmtxEncodeDataMatrix(DmtxEncode *enc, int n, unsigned char *s, i extern DmtxPassFail dmtxEncodeSetProp(DmtxEncode *enc, int prop, int value)
nt sizeIdxRequest); ;
extern int dmtxEncodeDataMosaic(DmtxEncode *enc, int n, unsigned char *s, i extern int dmtxEncodeGetProp(DmtxEncode *enc, int prop);
nt sizeIdxRequest); extern DmtxPassFail dmtxEncodeDataMatrix(DmtxEncode *enc, int n, unsigned c
har *s);
extern DmtxPassFail dmtxEncodeDataMosaic(DmtxEncode *enc, int n, unsigned c
har *s);
/* dmtxdecode.c */ /* dmtxdecode.c */
extern DmtxDecode dmtxDecodeStructInit(DmtxImage *img); extern DmtxDecode *dmtxDecodeCreate(DmtxImage *img, int scale);
extern void dmtxDecodeStructDeInit(DmtxDecode *dec); extern DmtxPassFail dmtxDecodeDestroy(DmtxDecode **dec);
extern int dmtxDecodeSetProp(DmtxDecode *dec, int prop, int value); extern DmtxPassFail dmtxDecodeSetProp(DmtxDecode *dec, int prop, int value)
extern DmtxMessage *dmtxDecodeMatrixRegion(DmtxImage *img, DmtxRegion *reg, ;
int fix); extern int dmtxDecodeGetProp(DmtxDecode *dec, int prop);
extern DmtxMessage *dmtxDecodeMosaicRegion(DmtxImage *img, DmtxRegion *reg, extern /*@exposed@*/ unsigned char *dmtxDecodeGetCache(DmtxDecode *dec, int
int fix); x, int y);
extern DmtxMessage *dmtxMessageMalloc(int sizeIdx, int symbolFormat); extern DmtxPassFail dmtxDecodeGetPixelValue(DmtxDecode *dec, int x, int y,
extern void dmtxMessageFree(DmtxMessage **mesg); int channel, int *value);
extern DmtxMessage *dmtxDecodeMatrixRegion(DmtxDecode *dec, DmtxRegion *reg
, int fix);
extern DmtxMessage *dmtxDecodeMosaicRegion(DmtxDecode *dec, DmtxRegion *reg
, int fix);
extern unsigned char *dmtxDecodeCreateDiagnostic(DmtxDecode *dec, /*@out@*/
int *totalBytes, /*@out@*/ int *headerBytes, int style);
/* dmtxregion.c */ /* dmtxregion.c */
extern DmtxRegion dmtxDecodeFindNextRegion(DmtxDecode *decode, DmtxTime *ti extern DmtxRegion *dmtxRegionCreate(DmtxRegion *reg);
meout); extern DmtxPassFail dmtxRegionDestroy(DmtxRegion **reg);
extern DmtxRegion dmtxRegionScanPixel(DmtxDecode *decode, DmtxPixelLoc loc) extern DmtxRegion *dmtxRegionFindNext(DmtxDecode *dec, DmtxTime *timeout);
; extern DmtxRegion *dmtxRegionScanPixel(DmtxDecode *dec, int x, int y);
extern int dmtxRegionUpdateCorners(DmtxDecode *dec, DmtxRegion *reg, DmtxVe extern DmtxPassFail dmtxRegionUpdateCorners(DmtxDecode *dec, DmtxRegion *re
ctor2 p00, g, DmtxVector2 p00,
DmtxVector2 p10, DmtxVector2 p11, DmtxVector2 p01); DmtxVector2 p10, DmtxVector2 p11, DmtxVector2 p01);
extern int dmtxRegionUpdateXfrms(DmtxDecode *dec, DmtxRegion *reg); extern DmtxPassFail dmtxRegionUpdateXfrms(DmtxDecode *dec, DmtxRegion *reg)
;
/* dmtxmessage.c */
extern DmtxMessage *dmtxMessageCreate(int sizeIdx, int symbolFormat);
extern DmtxPassFail dmtxMessageDestroy(DmtxMessage **msg);
/* dmtximage.c */ /* dmtximage.c */
extern DmtxImage *dmtxImageMalloc(int width, int height); extern DmtxImage *dmtxImageCreate(unsigned char *pxl, int width, int height
extern int dmtxImageFree(DmtxImage **img); , int pack);
extern int dmtxImageSetProp(DmtxImage *img, int prop, int value); extern DmtxPassFail dmtxImageDestroy(DmtxImage **img);
extern DmtxPassFail dmtxImageSetChannel(DmtxImage *img, int channelStart, i
nt bitsPerChannel);
extern DmtxPassFail dmtxImageSetProp(DmtxImage *img, int prop, int value);
extern int dmtxImageGetProp(DmtxImage *img, int prop); extern int dmtxImageGetProp(DmtxImage *img, int prop);
extern int dmtxImageGetOffset(DmtxImage *img, int x, int y); extern int dmtxImageGetByteOffset(DmtxImage *img, int x, int y);
extern int dmtxImageSetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); extern DmtxPassFail dmtxImageGetPixelValue(DmtxImage *img, int x, int y, in
extern int dmtxImageGetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); t channel, int *value);
extern int dmtxImageGetColor(DmtxImage *img, int x, int y, int colorPlane); extern DmtxPassFail dmtxImageSetPixelValue(DmtxImage *img, int x, int y, in
extern int dmtxImageContainsInt(DmtxImage *img, int margin, int x, int y); t channel, int value);
extern int dmtxImageContainsFloat(DmtxImage *img, double x, double y); extern DmtxBoolean dmtxImageContainsInt(DmtxImage *img, int margin, int x,
int y);
extern DmtxBoolean dmtxImageContainsFloat(DmtxImage *img, double x, double
y);
/* dmtxvector2.c */ /* dmtxvector2.c */
extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, const DmtxVector2 *v2 ); extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, const DmtxVector2 *v2 );
extern DmtxVector2 *dmtxVector2Add(DmtxVector2 *vOut, const DmtxVector2 *v1 , const DmtxVector2 *v2); extern DmtxVector2 *dmtxVector2Add(/*@out@*/ DmtxVector2 *vOut, const DmtxV ector2 *v1, const DmtxVector2 *v2);
extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, const DmtxVector2 * v2); extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, const DmtxVector2 * v2);
extern DmtxVector2 *dmtxVector2Sub(DmtxVector2 *vOut, const DmtxVector2 *v1 , const DmtxVector2 *v2); extern DmtxVector2 *dmtxVector2Sub(/*@out@*/ DmtxVector2 *vOut, const DmtxV ector2 *v1, const DmtxVector2 *v2);
extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, double s); extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, double s);
extern DmtxVector2 *dmtxVector2Scale(DmtxVector2 *vOut, const DmtxVector2 * v, double s); extern DmtxVector2 *dmtxVector2Scale(/*@out@*/ DmtxVector2 *vOut, const Dmt xVector2 *v, double s);
extern double dmtxVector2Cross(const DmtxVector2 *v1, const DmtxVector2 *v2 ); extern double dmtxVector2Cross(const DmtxVector2 *v1, const DmtxVector2 *v2 );
extern double dmtxVector2Norm(DmtxVector2 *v); extern double dmtxVector2Norm(DmtxVector2 *v);
extern double dmtxVector2Dot(const DmtxVector2 *v1, const DmtxVector2 *v2); extern double dmtxVector2Dot(const DmtxVector2 *v1, const DmtxVector2 *v2);
extern double dmtxVector2Mag(const DmtxVector2 *v); extern double dmtxVector2Mag(const DmtxVector2 *v);
extern double dmtxDistanceFromRay2(const DmtxRay2 *r, const DmtxVector2 *q) ; extern double dmtxDistanceFromRay2(const DmtxRay2 *r, const DmtxVector2 *q) ;
extern double dmtxDistanceAlongRay2(const DmtxRay2 *r, const DmtxVector2 *q ); extern double dmtxDistanceAlongRay2(const DmtxRay2 *r, const DmtxVector2 *q );
extern int dmtxRay2Intersect(DmtxVector2 *point, const DmtxRay2 *p0, const extern int dmtxRay2Intersect(/*@out@*/ DmtxVector2 *point, const DmtxRay2 *
DmtxRay2 *p1); p0, const DmtxRay2 *p1);
extern int dmtxPointAlongRay2(DmtxVector2 *point, const DmtxRay2 *r, double extern DmtxPassFail dmtxPointAlongRay2(/*@out@*/ DmtxVector2 *point, const
t); DmtxRay2 *r, double t);
/* dmtxmatrix3.c */ /* dmtxmatrix3.c */
extern void dmtxMatrix3Copy(DmtxMatrix3 m0, DmtxMatrix3 m1); extern void dmtxMatrix3Copy(/*@out@*/ DmtxMatrix3 m0, DmtxMatrix3 m1);
extern void dmtxMatrix3Identity(DmtxMatrix3 m); extern void dmtxMatrix3Identity(/*@out@*/ DmtxMatrix3 m);
extern void dmtxMatrix3Translate(DmtxMatrix3 m, double tx, double ty); extern void dmtxMatrix3Translate(/*@out@*/ DmtxMatrix3 m, double tx, double
extern void dmtxMatrix3Rotate(DmtxMatrix3 m, double angle); ty);
extern void dmtxMatrix3Scale(DmtxMatrix3 m, double sx, double sy); extern void dmtxMatrix3Rotate(/*@out@*/ DmtxMatrix3 m, double angle);
extern void dmtxMatrix3Shear(DmtxMatrix3 m, double shx, double shy); extern void dmtxMatrix3Scale(/*@out@*/ DmtxMatrix3 m, double sx, double sy)
extern void dmtxMatrix3LineSkewTop(DmtxMatrix3 m, double b0, double b1, dou ;
ble sz); extern void dmtxMatrix3Shear(/*@out@*/ DmtxMatrix3 m, double shx, double sh
extern void dmtxMatrix3LineSkewTopInv(DmtxMatrix3 m, double b0, double b1, y);
double sz); extern void dmtxMatrix3LineSkewTop(/*@out@*/ DmtxMatrix3 m, double b0, doub
extern void dmtxMatrix3LineSkewSide(DmtxMatrix3 m, double b0, double b1, do le b1, double sz);
uble sz); extern void dmtxMatrix3LineSkewTopInv(/*@out@*/ DmtxMatrix3 m, double b0, d
extern void dmtxMatrix3LineSkewSideInv(DmtxMatrix3 m, double b0, double b1, ouble b1, double sz);
double sz); extern void dmtxMatrix3LineSkewSide(/*@out@*/ DmtxMatrix3 m, double b0, dou
extern void dmtxMatrix3Multiply(DmtxMatrix3 mOut, DmtxMatrix3 m0, DmtxMatri ble b1, double sz);
x3 m1); extern void dmtxMatrix3LineSkewSideInv(/*@out@*/ DmtxMatrix3 m, double b0,
double b1, double sz);
extern void dmtxMatrix3Multiply(/*@out@*/ DmtxMatrix3 mOut, DmtxMatrix3 m0,
DmtxMatrix3 m1);
extern void dmtxMatrix3MultiplyBy(DmtxMatrix3 m0, DmtxMatrix3 m1); extern void dmtxMatrix3MultiplyBy(DmtxMatrix3 m0, DmtxMatrix3 m1);
extern int dmtxMatrix3VMultiply(DmtxVector2 *vOut, DmtxVector2 *vIn, DmtxMa trix3 m); extern int dmtxMatrix3VMultiply(/*@out@*/ DmtxVector2 *vOut, DmtxVector2 *v In, DmtxMatrix3 m);
extern int dmtxMatrix3VMultiplyBy(DmtxVector2 *v, DmtxMatrix3 m); extern int dmtxMatrix3VMultiplyBy(DmtxVector2 *v, DmtxMatrix3 m);
extern void dmtxMatrix3Print(DmtxMatrix3 m); extern void dmtxMatrix3Print(DmtxMatrix3 m);
/* dmtxcolor3.c */
extern void dmtxColor3FromImage2(DmtxColor3 *color, DmtxImage *img, DmtxVec
tor2 p);
extern DmtxColor3 *dmtxColor3FromPixel(DmtxColor3 *color, DmtxRgb rgb);
extern void dmtxPixelFromColor3(DmtxRgb rgb, DmtxColor3 *color);
extern DmtxColor3 dmtxColor3AlongRay3(DmtxRay3 *ray, double dist);
extern DmtxColor3 *dmtxColor3AddTo(DmtxColor3 *v1, DmtxColor3 *v2);
extern DmtxColor3 *dmtxColor3Add(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo
r3 *v2);
extern DmtxColor3 *dmtxColor3SubFrom(DmtxColor3 *v1, DmtxColor3 *v2);
extern DmtxColor3 *dmtxColor3Sub(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxColo
r3 *v2);
extern DmtxColor3 *dmtxColor3ScaleBy(DmtxColor3 *v, double s);
extern DmtxColor3 *dmtxColor3Scale(DmtxColor3 *vOut, DmtxColor3 *v, double
s);
extern DmtxColor3 *dmtxColor3Cross(DmtxColor3 *vOut, DmtxColor3 *v1, DmtxCo
lor3 *v2);
extern double dmtxColor3Norm(DmtxColor3 *v);
extern double dmtxColor3Dot(DmtxColor3 *v1, DmtxColor3 *v2);
extern double dmtxColor3MagSquared(DmtxColor3 *v);
extern double dmtxColor3Mag(DmtxColor3 *v);
extern double dmtxDistanceFromRay3(DmtxRay3 *r, DmtxColor3 *q);
extern double dmtxDistanceAlongRay3(DmtxRay3 *r, DmtxColor3 *q);
extern int dmtxPointAlongRay3(DmtxColor3 *point, DmtxRay3 *r, double t);
/* dmtxsymbol.c */ /* dmtxsymbol.c */
extern int dmtxSymbolModuleStatus(DmtxMessage *mapping, int sizeIdx, int ro w, int col); 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 int dmtxGetBlockDataSize(int sizeIdx, int blockIdx); extern int dmtxGetBlockDataSize(int sizeIdx, int blockIdx);
extern char *dmtxVersion(void); extern char *dmtxVersion(void);
#ifdef __cplusplus #ifdef __cplusplus
} }
#endif #endif
 End of changes. 39 change blocks. 
216 lines changed or deleted 215 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/