dmtx.h | dmtx.h | |||
---|---|---|---|---|
skipping to change at line 23 | skipping to change at line 23 | |||
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 418 2008-09-04 19:22:15Z mblaughton $ */ | /* $Id: dmtx.h 519 2008-11-21 05:27:42Z 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__ | |||
#include <time.h> | ||||
#if defined(HAVE_SYS_TIME_H) | ||||
#include <sys/time.h> | ||||
#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.5.2" | #define DMTX_VERSION "0.6.0" | |||
#define DMTX_FAILURE 0 | #define DMTX_FAILURE 0 | |||
#define DMTX_SUCCESS 1 | #define DMTX_SUCCESS 1 | |||
#define DMTX_FALSE 0 | #define DMTX_FALSE 0 | |||
#define DMTX_TRUE 1 | #define DMTX_TRUE 1 | |||
#define DMTX_BAD_OFFSET -1 | ||||
#define DMTX_STATUS_NOT_SCANNED 0 | #define DMTX_STATUS_NOT_SCANNED 0 | |||
#define DMTX_STATUS_VALID 1 | #define DMTX_STATUS_VALID 1 | |||
#define DMTX_STATUS_INVALID 2 | #define DMTX_STATUS_INVALID 2 | |||
#define DMTX_DISPLAY_SQUARE 1 | #define DMTX_DISPLAY_SQUARE 1 | |||
#define DMTX_DISPLAY_POINT 2 | #define DMTX_DISPLAY_POINT 2 | |||
#define DMTX_DISPLAY_CIRCLE 3 | #define DMTX_DISPLAY_CIRCLE 3 | |||
#define DMTX_REGION_FOUND 0 | #define DMTX_REGION_FOUND 0 | |||
#define DMTX_REGION_NOT_FOUND 1 | #define DMTX_REGION_NOT_FOUND 1 | |||
#define DMTX_REGION_TIMEOUT 2 | #define DMTX_REGION_TIMEOUT 2 | |||
#define DMTX_REGION_EOF 3 | #define DMTX_REGION_EOF 3 | |||
#define DMTX_REGION_DROPPED_EDGE 4 | #define DMTX_REGION_DROPPED_EDGE 4 | |||
#define DMTX_REGION_DROPPED_1ST 5 | #define DMTX_REGION_DROPPED_FINDER 5 | |||
#define DMTX_REGION_DROPPED_2ND 6 | #define DMTX_REGION_DROPPED_TOP 6 | |||
#define DMTX_REGION_DROPPED_RIGHT 7 | #define DMTX_REGION_DROPPED_RIGHT 7 | |||
#define DMTX_REGION_DROPPED_TOP 8 | #define DMTX_REGION_DROPPED_SIZE 8 | |||
#define DMTX_REGION_DROPPED_SIZE 9 | ||||
#define DMTX_MODULE_OFF 0x00 | #define DMTX_MODULE_OFF 0x00 | |||
#define DMTX_MODULE_ON_RED 0x01 | #define DMTX_MODULE_ON_RED 0x01 | |||
#define DMTX_MODULE_ON_GREEN 0x02 | #define DMTX_MODULE_ON_GREEN 0x02 | |||
#define DMTX_MODULE_ON_BLUE 0x04 | #define DMTX_MODULE_ON_BLUE 0x04 | |||
#define DMTX_MODULE_ON_RGB 0x07 /* ON_RED | ON_GREEN | ON_BLUE */ | #define DMTX_MODULE_ON_RGB 0x07 /* ON_RED | ON_GREEN | ON_BLUE */ | |||
#define DMTX_MODULE_ON 0x07 | #define DMTX_MODULE_ON 0x07 | |||
#define DMTX_MODULE_UNSURE 0x08 | #define DMTX_MODULE_UNSURE 0x08 | |||
#define DMTX_MODULE_ASSIGNED 0x10 | #define DMTX_MODULE_ASSIGNED 0x10 | |||
#define DMTX_MODULE_VISITED 0x20 | #define DMTX_MODULE_VISITED 0x20 | |||
#define DMTX_MODULE_DATA 0x40 | #define DMTX_MODULE_DATA 0x40 | |||
#define DMTX_FORMAT_MATRIX 0 | #define DMTX_FORMAT_MATRIX 0 | |||
#define DMTX_FORMAT_MOSAIC 1 | #define DMTX_FORMAT_MOSAIC 1 | |||
#define DMTX_SYMBOL_SQUARE_AUTO -1 | ||||
#define DMTX_SYMBOL_SQUARE_COUNT 24 | #define DMTX_SYMBOL_SQUARE_COUNT 24 | |||
#define DMTX_SYMBOL_RECT_AUTO -2 | ||||
#define DMTX_SYMBOL_RECT_COUNT 6 | #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, | |||
skipping to change at line 155 | skipping to change at line 160 | |||
} 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 { | |||
DmtxPropShrinkMin, | DmtxPropEdgeMin, | |||
DmtxPropShrinkMax, | DmtxPropEdgeMax, | |||
DmtxPropEdgeThresh, | ||||
DmtxPropSquareDevn, | ||||
DmtxPropScanGap, | DmtxPropScanGap, | |||
DmtxPropSquareDevn, | ||||
DmtxPropSymbolSize, | ||||
DmtxPropEdgeThresh, | ||||
DmtxPropWidth, | DmtxPropWidth, | |||
DmtxPropHeight, | DmtxPropHeight, | |||
DmtxPropArea, | DmtxPropArea, | |||
DmtxPropXmin, | DmtxPropXmin, | |||
DmtxPropXmax, | DmtxPropXmax, | |||
DmtxPropYmin, | DmtxPropYmin, | |||
DmtxPropYmax, | DmtxPropYmax, | |||
DmtxPropShrinkMin, | ||||
DmtxPropShrinkMax, | ||||
DmtxPropScale, | DmtxPropScale, | |||
DmtxPropScaledWidth, | DmtxPropScaledWidth, | |||
DmtxPropScaledHeight, | DmtxPropScaledHeight, | |||
DmtxPropScaledArea, | DmtxPropScaledArea, | |||
DmtxPropScaledXmin, | DmtxPropScaledXmin, | |||
DmtxPropScaledXmax, | DmtxPropScaledXmax, | |||
DmtxPropScaledYmin, | DmtxPropScaledYmin, | |||
DmtxPropScaledYmax | DmtxPropScaledYmax | |||
} DmtxDecodeProperty; | } DmtxDecodeProperty; | |||
typedef enum { | ||||
DmtxSymbolRectAuto = -3, | ||||
DmtxSymbolSquareAuto = -2, | ||||
DmtxSymbolShapeAuto = -1, | ||||
DmtxSymbol10x10 = 0, | ||||
DmtxSymbol12x12, | ||||
DmtxSymbol14x14, | ||||
DmtxSymbol16x16, | ||||
DmtxSymbol18x18, | ||||
DmtxSymbol20x20, | ||||
DmtxSymbol22x22, | ||||
DmtxSymbol24x24, | ||||
DmtxSymbol26x26, | ||||
DmtxSymbol32x32, | ||||
DmtxSymbol36x36, | ||||
DmtxSymbol40x40, | ||||
DmtxSymbol44x44, | ||||
DmtxSymbol48x48, | ||||
DmtxSymbol52x52, | ||||
DmtxSymbol64x64, | ||||
DmtxSymbol72x72, | ||||
DmtxSymbol80x80, | ||||
DmtxSymbol88x88, | ||||
DmtxSymbol96x96, | ||||
DmtxSymbol104x104, | ||||
DmtxSymbol120x120, | ||||
DmtxSymbol132x132, | ||||
DmtxSymbol144x144, | ||||
DmtxSymbol8x18, | ||||
DmtxSymbol8x32, | ||||
DmtxSymbol12x26, | ||||
DmtxSymbol12x36, | ||||
DmtxSymbol16x36, | ||||
DmtxSymbol16x48 | ||||
} DmtxSymbolSize; | ||||
typedef double DmtxMatrix3[3][3]; | typedef double DmtxMatrix3[3][3]; | |||
typedef unsigned char DmtxRgb[3]; | typedef unsigned char DmtxRgb[3]; | |||
/** | /** | |||
* @struct DmtxColor3 | * @struct DmtxColor3 | |||
* @brief DmtxColor3 | * @brief DmtxColor3 | |||
*/ | */ | |||
typedef struct DmtxColor3_struct { | typedef struct DmtxColor3_struct { | |||
double R; | double R; | |||
double G; | double G; | |||
skipping to change at line 235 | skipping to change at line 279 | |||
DmtxVector2 p; | DmtxVector2 p; | |||
DmtxVector2 v; | DmtxVector2 v; | |||
} DmtxRay2; | } DmtxRay2; | |||
/** | /** | |||
* @struct DmtxGradient | * @struct DmtxGradient | |||
* @brief DmtxGradient | * @brief DmtxGradient | |||
*/ | */ | |||
typedef struct DmtxGradient_struct { | typedef struct DmtxGradient_struct { | |||
char isDefined; | char isDefined; | |||
double tMin, tMax, tMid; | double tMin, tMax; | |||
DmtxRay3 ray; | DmtxRay3 ray; | |||
DmtxColor3 color, colorPrev; /* XXX maybe these aren't appropriate varia bles for a gradient? */ | ||||
} DmtxGradient; | } DmtxGradient; | |||
typedef enum { | ||||
DmtxCompassDirNone = 0x00, | ||||
DmtxCompassDirNeg45 = 0x01, | ||||
DmtxCompassDir0 = 0x02, | ||||
DmtxCompassDir45 = 0x04, | ||||
DmtxCompassDir90 = 0x08, | ||||
DmtxCompassDirOrtho = DmtxCompassDir0 | DmtxCompassDir90, | ||||
DmtxCompassDirAll = DmtxCompassDirNeg45 | DmtxCompassDir0 | DmtxCompas | ||||
sDir45 | DmtxCompassDir90 | ||||
} DmtxCompassDir; | ||||
/** | ||||
* @struct DmtxCompassEdge | ||||
* @brief DmtxCompassEdge | ||||
*/ | ||||
typedef struct DmtxCompassEdge_struct { | ||||
char dirsTested; | ||||
char maxDirAll; | ||||
char maxDirOrtho; | ||||
double magnitude; /* sqrt(R^2 + G^2 + B^2) */ | ||||
DmtxColor3 intensity; | ||||
} DmtxCompassEdge; | ||||
/** | /** | |||
* @struct DmtxImage | * @struct DmtxImage | |||
* @brief DmtxImage | * @brief DmtxImage | |||
*/ | */ | |||
typedef struct DmtxImage_struct { | typedef struct DmtxImage_struct { | |||
int width; /* unscaled */ | int width; /* unscaled */ | |||
int height; /* unscaled */ | int height; /* unscaled */ | |||
int xMin; /* unscaled */ | int xMin; /* unscaled */ | |||
int xMax; /* unscaled */ | int xMax; /* unscaled */ | |||
int yMin; /* unscaled */ | int yMin; /* unscaled */ | |||
int yMax; /* unscaled */ | int yMax; /* unscaled */ | |||
int scale; | int scale; | |||
int widthScaled; | int widthScaled; | |||
int heightScaled; | int heightScaled; | |||
int xMinScaled; | int xMinScaled; | |||
int xMaxScaled; | int xMaxScaled; | |||
int yMinScaled; | int yMinScaled; | |||
int yMaxScaled; | int yMaxScaled; | |||
int pageCount; | int pageCount; | |||
unsigned char *cache; | ||||
DmtxRgb *pxl; | DmtxRgb *pxl; | |||
DmtxCompassEdge *compass; | ||||
} DmtxImage; | } DmtxImage; | |||
/** | /** | |||
* @struct DmtxEdge | * @struct DmtxPointFlow | |||
* @brief DmtxEdge | * @brief DmtxPointFlow | |||
*/ | */ | |||
typedef struct DmtxEdge_struct { | typedef struct DmtxPointFlow_struct { | |||
int offset; | int plane; | |||
double t; | int arrive; | |||
DmtxColor3 color; | int depart; | |||
} DmtxEdge; | int mag; | |||
DmtxPixelLoc loc; | ||||
/** | } DmtxPointFlow; | |||
* @struct DmtxChain | ||||
* @brief DmtxChain | /** | |||
*/ | * @struct DmtxBestLine | |||
typedef struct DmtxChain_struct { | * @brief DmtxBestLine | |||
double tx, ty; | */ | |||
double phi, shx; | typedef struct DmtxBestLine_struct { | |||
double scx, scy; | int angle; | |||
double bx0, bx1; | int hOffset; | |||
double by0, by1; | int mag; | |||
double sz; | int stepBeg; | |||
} DmtxChain; | int stepPos; | |||
int stepNeg; | ||||
/** | int distSq; | |||
* @struct DmtxCorners | double devn; | |||
* @brief DmtxCorners | DmtxPixelLoc locBeg; | |||
*/ | DmtxPixelLoc locPos; | |||
typedef struct DmtxCorners_struct { | DmtxPixelLoc locNeg; | |||
DmtxCornerLoc known; /* combination of (DmtxCorner00 | DmtxCorner10 | Dm | } DmtxBestLine; | |||
txCorner11 | DmtxCorner01) */ | ||||
DmtxVector2 c00; | ||||
DmtxVector2 c10; | ||||
DmtxVector2 c11; | ||||
DmtxVector2 c01; | ||||
} DmtxCorners; | ||||
/** | /** | |||
* @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 */ | 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 */ | /* Trail blazing values */ | |||
DmtxChain chain; /* List of values that are used to build | int jumpToPos; /* */ | |||
a transformation matrix */ | int jumpToNeg; /* */ | |||
DmtxCorners corners; /* Corners of barcode region */ | int stepsTotal; /* */ | |||
DmtxMatrix3 raw2fit; /* 3x3 transformation from raw image to f | DmtxPixelLoc finalPos; /* */ | |||
itted barcode grid */ | DmtxPixelLoc finalNeg; /* */ | |||
DmtxMatrix3 fit2raw; /* 3x3 transformation from fitted barcode | DmtxPixelLoc boundMin; /* */ | |||
grid to raw image */ | DmtxPixelLoc boundMax; /* */ | |||
DmtxPointFlow flowBegin; /* */ | ||||
/* Orientation values */ | ||||
int polarity; /* */ | ||||
int stepR; | ||||
int stepT; | ||||
DmtxPixelLoc locR; /* remove if stepR works above */ | ||||
DmtxPixelLoc locT; /* remove if stepT works above */ | ||||
/* Region fitting values */ | ||||
int leftKnown; /* known == 1; unknown == 0 */ | ||||
int leftAngle; /* hough angle of left edge */ | ||||
DmtxPixelLoc leftLoc; /* known (arbitrary) location on left edg | ||||
e */ | ||||
DmtxBestLine leftLine; /* */ | ||||
int bottomKnown; /* known == 1; unknown == 0 */ | ||||
int bottomAngle; /* hough angle of bottom edge */ | ||||
DmtxPixelLoc bottomLoc; /* known (arbitrary) location on bottom e | ||||
dge */ | ||||
DmtxBestLine bottomLine; /* */ | ||||
int topKnown; /* known == 1; unknown == 0 */ | ||||
int topAngle; /* hough angle of top edge */ | ||||
DmtxPixelLoc topLoc; /* known (arbitrary) location on top edge | ||||
*/ | ||||
int rightKnown; /* known == 1; unknown == 0 */ | ||||
int rightAngle; /* hough angle of right edge */ | ||||
DmtxPixelLoc rightLoc; /* known (arbitrary) location on right ed | ||||
ge */ | ||||
/* Region calibration values */ | ||||
int onColor; /* */ | ||||
int offColor; /* */ | ||||
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 */ | |||
/* Transform values */ | ||||
DmtxMatrix3 raw2fit; /* 3x3 transformation from raw image to f | ||||
itted barcode grid */ | ||||
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 */ | 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 */ | |||
skipping to change at line 387 | skipping to change at line 439 | |||
int yCenter; /* Y center of current cross pattern */ | int yCenter; /* Y center of current cross pattern */ | |||
} DmtxScanGrid; | } DmtxScanGrid; | |||
/** | /** | |||
* @struct DmtxDecode | * @struct DmtxDecode | |||
* @brief DmtxDecode | * @brief DmtxDecode | |||
*/ | */ | |||
typedef struct DmtxDecode_struct { | typedef struct DmtxDecode_struct { | |||
DmtxImage *image; | DmtxImage *image; | |||
DmtxScanGrid grid; | DmtxScanGrid grid; | |||
int edgeMin; | ||||
int edgeMax; | ||||
int scanGap; | ||||
double squareDevn; | ||||
int sizeIdxExpected; | ||||
int edgeThresh; | ||||
int shrinkMin; | int shrinkMin; | |||
int shrinkMax; | int shrinkMax; | |||
int edgeThresh; | ||||
double squareDevn; | ||||
int scanGap; | ||||
} DmtxDecode; | } DmtxDecode; | |||
/** | /** | |||
* @struct DmtxTime | * @struct DmtxTime | |||
* @brief DmtxTime | * @brief DmtxTime | |||
*/ | */ | |||
typedef struct DmtxTime_struct { | typedef struct DmtxTime_struct { | |||
time_t sec; | time_t sec; | |||
unsigned long usec; | unsigned long usec; | |||
} DmtxTime; | } DmtxTime; | |||
skipping to change at line 415 | skipping to change at line 470 | |||
* @brief DmtxEncode | * @brief DmtxEncode | |||
*/ | */ | |||
typedef struct DmtxEncode_struct { | typedef struct DmtxEncode_struct { | |||
int moduleSize; | int moduleSize; | |||
int marginSize; | int marginSize; | |||
DmtxEncodeMethod method; | DmtxEncodeMethod method; | |||
DmtxSchemeEncode scheme; | DmtxSchemeEncode scheme; | |||
DmtxMessage *message; | DmtxMessage *message; | |||
DmtxImage *image; | DmtxImage *image; | |||
DmtxRegion region; | DmtxRegion region; | |||
DmtxMatrix3 xfrm; /* XXX still necessary? */ | DmtxMatrix3 xfrm; /* XXX still necessary? */ | |||
DmtxMatrix3 rxfrm; /* 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) */ | |||
skipping to change at line 481 | skipping to change at line 536 | |||
extern DmtxDecode dmtxDecodeStructInit(DmtxImage *img); | extern DmtxDecode dmtxDecodeStructInit(DmtxImage *img); | |||
extern void dmtxDecodeStructDeInit(DmtxDecode *dec); | extern void dmtxDecodeStructDeInit(DmtxDecode *dec); | |||
extern int dmtxDecodeSetProp(DmtxDecode *dec, int prop, int value); | extern int dmtxDecodeSetProp(DmtxDecode *dec, int prop, int value); | |||
extern DmtxMessage *dmtxDecodeMatrixRegion(DmtxImage *img, DmtxRegion *reg, int fix); | extern DmtxMessage *dmtxDecodeMatrixRegion(DmtxImage *img, DmtxRegion *reg, int fix); | |||
extern DmtxMessage *dmtxDecodeMosaicRegion(DmtxImage *img, DmtxRegion *reg, int fix); | extern DmtxMessage *dmtxDecodeMosaicRegion(DmtxImage *img, DmtxRegion *reg, int fix); | |||
extern DmtxMessage *dmtxMessageMalloc(int sizeIdx, int symbolFormat); | extern DmtxMessage *dmtxMessageMalloc(int sizeIdx, int symbolFormat); | |||
extern void dmtxMessageFree(DmtxMessage **mesg); | extern void dmtxMessageFree(DmtxMessage **mesg); | |||
/* dmtxregion.c */ | /* dmtxregion.c */ | |||
extern DmtxRegion dmtxDecodeFindNextRegion(DmtxDecode *decode, DmtxTime *ti meout); | extern DmtxRegion dmtxDecodeFindNextRegion(DmtxDecode *decode, DmtxTime *ti meout); | |||
extern DmtxRegion dmtxScanPixel(DmtxDecode *decode, DmtxPixelLoc loc); | extern DmtxRegion dmtxRegionScanPixel(DmtxDecode *decode, DmtxPixelLoc loc) | |||
; | ||||
extern int dmtxRegionUpdateCorners(DmtxDecode *dec, DmtxRegion *reg, DmtxVe | ||||
ctor2 p00, | ||||
DmtxVector2 p10, DmtxVector2 p11, DmtxVector2 p01); | ||||
extern int dmtxRegionUpdateXfrms(DmtxDecode *dec, DmtxRegion *reg); | ||||
/* dmtximage.c */ | /* dmtximage.c */ | |||
extern DmtxImage *dmtxImageMalloc(int width, int height); | extern DmtxImage *dmtxImageMalloc(int width, int height); | |||
extern int dmtxImageFree(DmtxImage **img); | extern int dmtxImageFree(DmtxImage **img); | |||
extern int dmtxImageSetProp(DmtxImage *img, int prop, int value); | extern int 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 dmtxImageGetOffset(DmtxImage *img, int x, int y); | |||
extern int dmtxImageSetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); | extern int dmtxImageSetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); | |||
extern int dmtxImageGetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); | extern int dmtxImageGetRgb(DmtxImage *img, int x, int y, DmtxRgb rgb); | |||
extern int dmtxImageGetColor(DmtxImage *img, int x, int y, int colorPlane); | ||||
extern int dmtxImageContainsInt(DmtxImage *img, int margin, int x, int y); | extern int dmtxImageContainsInt(DmtxImage *img, int margin, int x, int y); | |||
extern int dmtxImageContainsFloat(DmtxImage *img, double x, double y); | extern int dmtxImageContainsFloat(DmtxImage *img, double x, double y); | |||
/* dmtxvector2.c */ | /* dmtxvector2.c */ | |||
extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, DmtxVector2 *v2); | extern DmtxVector2 *dmtxVector2AddTo(DmtxVector2 *v1, const DmtxVector2 *v2 | |||
extern DmtxVector2 *dmtxVector2Add(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx | ); | |||
Vector2 *v2); | extern DmtxVector2 *dmtxVector2Add(DmtxVector2 *vOut, const DmtxVector2 *v1 | |||
extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, DmtxVector2 *v2); | , const DmtxVector2 *v2); | |||
extern DmtxVector2 *dmtxVector2Sub(DmtxVector2 *vOut, DmtxVector2 *v1, Dmtx | extern DmtxVector2 *dmtxVector2SubFrom(DmtxVector2 *v1, const DmtxVector2 * | |||
Vector2 *v2); | v2); | |||
extern DmtxVector2 *dmtxVector2Sub(DmtxVector2 *vOut, const DmtxVector2 *v1 | ||||
, const DmtxVector2 *v2); | ||||
extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, double s); | extern DmtxVector2 *dmtxVector2ScaleBy(DmtxVector2 *v, double s); | |||
extern DmtxVector2 *dmtxVector2Scale(DmtxVector2 *vOut, DmtxVector2 *v, dou | extern DmtxVector2 *dmtxVector2Scale(DmtxVector2 *vOut, const DmtxVector2 * | |||
ble s); | v, double s); | |||
extern double dmtxVector2Cross(DmtxVector2 *v1, DmtxVector2 *v2); | extern double dmtxVector2Cross(const DmtxVector2 *v1, const DmtxVector2 *v2 | |||
); | ||||
extern double dmtxVector2Norm(DmtxVector2 *v); | extern double dmtxVector2Norm(DmtxVector2 *v); | |||
extern double dmtxVector2Dot(DmtxVector2 *v1, DmtxVector2 *v2); | extern double dmtxVector2Dot(const DmtxVector2 *v1, const DmtxVector2 *v2); | |||
extern double dmtxVector2Mag(DmtxVector2 *v); | extern double dmtxVector2Mag(const DmtxVector2 *v); | |||
extern double dmtxDistanceFromRay2(DmtxRay2 *r, DmtxVector2 *q); | extern double dmtxDistanceFromRay2(const DmtxRay2 *r, const DmtxVector2 *q) | |||
extern double dmtxDistanceAlongRay2(DmtxRay2 *r, DmtxVector2 *q); | ; | |||
extern int dmtxRay2Intersect(DmtxVector2 *point, DmtxRay2 *p0, DmtxRay2 *p1 | extern double dmtxDistanceAlongRay2(const DmtxRay2 *r, const DmtxVector2 *q | |||
); | ); | |||
extern int dmtxPointAlongRay2(DmtxVector2 *point, DmtxRay2 *r, double t); | extern int dmtxRay2Intersect(DmtxVector2 *point, const DmtxRay2 *p0, const | |||
DmtxRay2 *p1); | ||||
extern int dmtxPointAlongRay2(DmtxVector2 *point, const DmtxRay2 *r, double | ||||
t); | ||||
/* dmtxmatrix3.c */ | /* dmtxmatrix3.c */ | |||
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, double tx, double 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, double sx, double sy); | extern void dmtxMatrix3Scale(DmtxMatrix3 m, double sx, double sy); | |||
extern void dmtxMatrix3Shear(DmtxMatrix3 m, double shx, double shy); | extern void dmtxMatrix3Shear(DmtxMatrix3 m, double shx, double shy); | |||
extern void dmtxMatrix3LineSkewTop(DmtxMatrix3 m, double b0, double b1, dou ble sz); | extern void dmtxMatrix3LineSkewTop(DmtxMatrix3 m, double b0, double b1, dou ble sz); | |||
extern void dmtxMatrix3LineSkewTopInv(DmtxMatrix3 m, double b0, double b1, double sz); | extern void dmtxMatrix3LineSkewTopInv(DmtxMatrix3 m, double b0, double b1, double sz); | |||
skipping to change at line 541 | skipping to change at line 600 | |||
extern DmtxColor3 dmtxColor3AlongRay3(DmtxRay3 *ray, double 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, double s); | extern DmtxColor3 *dmtxColor3ScaleBy(DmtxColor3 *v, double s); | |||
extern DmtxColor3 *dmtxColor3Scale(DmtxColor3 *vOut, DmtxColor3 *v, double 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 double dmtxColor3Norm(DmtxColor3 *v); | extern double dmtxColor3Norm(DmtxColor3 *v); | |||
extern double dmtxColor3Dot(DmtxColor3 *v1, DmtxColor3 *v2); | extern double dmtxColor3Dot(DmtxColor3 *v1, DmtxColor3 *v2); | |||
extern double dmtxColor3Mag(DmtxColor3 *v); | ||||
extern double dmtxColor3MagSquared(DmtxColor3 *v); | extern double dmtxColor3MagSquared(DmtxColor3 *v); | |||
extern double dmtxColor3Mag(DmtxColor3 *v); | ||||
extern double dmtxDistanceFromRay3(DmtxRay3 *r, DmtxColor3 *q); | extern double dmtxDistanceFromRay3(DmtxRay3 *r, DmtxColor3 *q); | |||
extern double dmtxDistanceAlongRay3(DmtxRay3 *r, DmtxColor3 *q); | extern double dmtxDistanceAlongRay3(DmtxRay3 *r, DmtxColor3 *q); | |||
extern int dmtxPointAlongRay3(DmtxColor3 *point, DmtxRay3 *r, double t); | 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); | |||
End of changes. 31 change blocks. | ||||
102 lines changed or deleted | 169 lines changed or added | |||