libdmtx 0.7.8.7
libdmtx is a software library that enables programs to read and write Data Matrix barcodes of the modern ECC200 variety.
|
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton. More...
#include <time.h>
Go to the source code of this file.
Classes | |
struct | DmtxPixelLoc_struct |
像素坐标 More... | |
struct | DmtxVector2_struct |
二维向量 More... | |
struct | DmtxRay2_struct |
向量表示的直线(线段) More... | |
struct | DmtxByteList_struct |
struct | DmtxEncodeStream_struct |
struct | DmtxImage_struct |
struct | DmtxPointFlow_struct |
图像像素点及其梯度流动方向 More... | |
struct | DmtxBestLine_struct |
struct | DmtxRegion_struct |
二维码区域(包围框) More... | |
struct | DmtxMessage_struct |
DataMatrix编码内容 More... | |
struct | DmtxScanGrid_struct |
struct | DmtxTime_struct |
struct | DmtxDecode_struct |
struct | DmtxEncode_struct |
struct | DmtxChannel_struct |
struct | DmtxChannelGroup_struct |
struct | DmtxTriplet_struct |
struct | DmtxQuadruplet_struct |
Macros | |
#define | M_PI 3.14159265358979323846 |
#define | M_PI_2 1.57079632679489661923 |
#define | DmtxUndefined (-1) |
#define | DmtxPassFail unsigned int |
#define | DmtxPass 1 |
#define | DmtxFail 0 |
#define | DmtxBoolean unsigned int |
#define | DmtxTrue 1 |
#define | DmtxFalse 0 |
#define | DmtxFormatMatrix 0 |
#define | DmtxFormatMosaic 1 |
#define | DmtxSymbolSquareCount 24 |
正方形二维码种类个数 | |
#define | DmtxSymbolRectCount 6 |
长方形二维码种类个数 | |
#define | DmtxModuleOff 0x00 |
bit0 | |
#define | DmtxModuleOnRed 0x01 |
红 | |
#define | DmtxModuleOnGreen 0x02 |
绿 | |
#define | DmtxModuleOnBlue 0x04 |
蓝 | |
#define | DmtxModuleOnRGB 0x07 |
OnRed | OnGreen | OnBlue. | |
#define | DmtxModuleOn DmtxModuleOnRGB |
bit1 | |
#define | DmtxModuleUnsure 0x08 |
不确定 | |
#define | DmtxModuleAssigned 0x10 |
已分配 | |
#define | DmtxModuleVisited 0x20 |
已访问 | |
#define | DmtxModuleData 0x40 |
#define | dmtxLogTrace(...) |
#define | dmtxLogDebug(...) |
#define | dmtxLogInfo(...) |
#define | dmtxLogWarn(...) |
#define | dmtxLogError(...) |
#define | dmtxLogFatal(...) |
#define | IN /* 表示输入参数,指针指向的值不会修改 */ |
#define | OUT /* 表示输出参数,指针指向的值会修改,且不会读 */ |
#define | INOUT /* 表示输入输出参数,指针指向的值会修改,且会读取 */ |
Functions | |
DmtxTime | dmtxTimeNow (void) |
Generic 1 second resolution version. | |
DmtxTime | dmtxTimeAdd (DmtxTime t, long msec) |
Add milliseconds to time t. | |
int | dmtxTimeExceeded (DmtxTime timeout) |
Determine whether the received timeout has been exceeded. | |
DmtxEncode * | dmtxEncodeCreate (void) |
Initialize encode struct with default values. | |
DmtxPassFail | dmtxEncodeDestroy (DmtxEncode **enc) |
Deinitialize encode struct. | |
DmtxPassFail | dmtxEncodeSetProp (DmtxEncode *enc, int prop, int value) |
Set encoding behavior property. | |
int | dmtxEncodeGetProp (DmtxEncode *enc, int prop) |
Get encoding behavior property. | |
DmtxPassFail | dmtxEncodeDataMatrix (DmtxEncode *enc, int inputSize, unsigned char *inputString) |
Convert message into Data Matrix image. | |
DmtxPassFail | dmtxEncodeDataMosaic (DmtxEncode *enc, int inputSize, unsigned char *inputString) |
Convert message into Data Mosaic image. | |
DmtxDecode * | dmtxDecodeCreate (DmtxImage *img, int scale) |
Initialize decode struct with default values. | |
DmtxPassFail | dmtxDecodeDestroy (DmtxDecode **dec) |
Deinitialize decode struct. | |
DmtxPassFail | dmtxDecodeSetProp (DmtxDecode *dec, int prop, int value) |
Set decoding behavior property. | |
int | dmtxDecodeGetProp (DmtxDecode *dec, int prop) |
Get decoding behavior property. | |
unsigned char * | dmtxDecodeGetCache (DmtxDecode *dec, int x, int y) |
Returns xxx. | |
DmtxPassFail | dmtxDecodeGetPixelValue (DmtxDecode *dec, int x, int y, int channel, OUT int *value) |
获取图像像素 | |
DmtxMessage * | dmtxDecodeMatrixRegion (DmtxDecode *dec, DmtxRegion *reg, int fix) |
解码拟合的二维码区域 | |
DmtxMessage * | dmtxDecodePopulatedArray (int sizeIdx, INOUT DmtxMessage *msg, int fix) |
从DataMatrix数据区二进制矩阵解码,并将结果写入msg->output | |
DmtxMessage * | dmtxDecodeMosaicRegion (DmtxDecode *dec, DmtxRegion *reg, int fix) |
Convert fitted Data Mosaic region into a decoded message. | |
unsigned char * | dmtxDecodeCreateDiagnostic (DmtxDecode *dec, OUT int *totalBytes, OUT int *headerBytes, int style) |
DmtxRegion * | dmtxRegionCreate (DmtxRegion *reg) |
Create copy of existing region struct. | |
DmtxPassFail | dmtxRegionDestroy (DmtxRegion **reg) |
Destroy region struct. | |
DmtxRegion * | dmtxRegionFindNext (DmtxDecode *dec, DmtxTime *timeout) |
寻找下一个二维码区域 | |
DmtxRegion * | dmtxRegionScanPixel (DmtxDecode *dec, int x, int y) |
将坐标点(x,y)作为二维码L型框的边缘点去匹配二维码包围框 | |
DmtxPassFail | dmtxRegionUpdateCorners (DmtxDecode *dec, DmtxRegion *reg, DmtxVector2 p00, DmtxVector2 p10, DmtxVector2 p11, DmtxVector2 p01) |
DmtxPassFail | dmtxRegionUpdateXfrms (DmtxDecode *dec, DmtxRegion *reg) |
DmtxMessage * | dmtxMessageCreate (int sizeIdx, int symbolFormat) |
Allocate memory for message. | |
DmtxPassFail | dmtxMessageDestroy (DmtxMessage **msg) |
Free memory previously allocated for message. | |
DmtxImage * | dmtxImageCreate (unsigned char *pxl, int width, int height, int pack) |
libdmtx stores image data as a large one-dimensional array of packed pixels, reading from the array when scanning barcodes and writing to it when creating a barcode. | |
DmtxPassFail | dmtxImageDestroy (DmtxImage **img) |
Free libdmtx image memory. | |
DmtxPassFail | dmtxImageSetChannel (DmtxImage *img, int channelStart, int bitsPerChannel) |
设置图像的颜色通道信息,包括每个通道的起始位和位数。 | |
DmtxPassFail | dmtxImageSetProp (DmtxImage *img, int prop, int value) |
设置图像属性 | |
int | dmtxImageGetProp (DmtxImage *img, int prop) |
获取图像属性 | |
int | dmtxImageGetByteOffset (DmtxImage *img, int x, int y) |
根据给定的坐标 (x, y) 计算并返回图像中对应像素的字节偏移量 | |
DmtxPassFail | dmtxImageGetPixelValue (DmtxImage *img, int x, int y, int channel, OUT int *value) |
DmtxPassFail | dmtxImageSetPixelValue (DmtxImage *img, int x, int y, int channel, int value) |
设置指定坐标、通道的像素值 | |
DmtxBoolean | dmtxImageContainsInt (DmtxImage *img, int margin, int x, int y) |
判断坐标 (x, y) 是否在图像范围内 | |
DmtxBoolean | dmtxImageContainsFloat (DmtxImage *img, double x, double y) |
判断坐标 (x, y) 是否在图像范围内 | |
DmtxVector2 * | dmtxVector2AddTo (DmtxVector2 *v1, const DmtxVector2 *v2) |
DmtxVector2 * | dmtxVector2Add (OUT DmtxVector2 *vOut, const DmtxVector2 *v1, const DmtxVector2 *v2) |
向量相加 | |
DmtxVector2 * | dmtxVector2SubFrom (DmtxVector2 *v1, const DmtxVector2 *v2) |
DmtxVector2 * | dmtxVector2Sub (OUT DmtxVector2 *vOut, const DmtxVector2 *v1, const DmtxVector2 *v2) |
向量相减 | |
DmtxVector2 * | dmtxVector2ScaleBy (DmtxVector2 *v, double s) |
DmtxVector2 * | dmtxVector2Scale (OUT DmtxVector2 *vOut, const DmtxVector2 *v, double s) |
向量数乘 | |
double | dmtxVector2Cross (const DmtxVector2 *v1, const DmtxVector2 *v2) |
二维向量叉积 | |
double | dmtxVector2Norm (DmtxVector2 *v) |
double | dmtxVector2Dot (const DmtxVector2 *v1, const DmtxVector2 *v2) |
二维向量点积 | |
double | dmtxVector2Mag (const DmtxVector2 *v) |
二维向量的模 | |
double | dmtxDistanceFromRay2 (const DmtxRay2 *r, const DmtxVector2 *q) |
计算点到直线的垂直距离 | |
double | dmtxDistanceAlongRay2 (const DmtxRay2 *r, const DmtxVector2 *q) |
DmtxPassFail | dmtxRay2Intersect (OUT DmtxVector2 *point, const DmtxRay2 *p0, const DmtxRay2 *p1) |
判断两条直线是否相交,并计算交点。 | |
DmtxPassFail | dmtxPointAlongRay2 (OUT DmtxVector2 *point, const DmtxRay2 *r, double t) |
计算直线上特定位置的点 | |
void | dmtxMatrix3Copy (OUT DmtxMatrix3 m0, DmtxMatrix3 m1) |
复制3x3矩阵 | |
void | dmtxMatrix3Identity (OUT DmtxMatrix3 m) |
生成单位变换矩阵 | |
void | dmtxMatrix3Translate (OUT DmtxMatrix3 m, double tx, double ty) |
生成平移变换矩阵 | |
void | dmtxMatrix3Rotate (OUT DmtxMatrix3 m, double angle) |
生成旋转变换矩阵 | |
void | dmtxMatrix3Scale (OUT DmtxMatrix3 m, double sx, double sy) |
生成缩放变换矩阵 | |
void | dmtxMatrix3Shear (OUT DmtxMatrix3 m, double shx, double shy) |
生成剪切变换矩阵 | |
void | dmtxMatrix3LineSkewTop (OUT DmtxMatrix3 m, double b0, double b1, double sz) |
生成顶部线倾斜变换矩阵 | |
void | dmtxMatrix3LineSkewTopInv (OUT DmtxMatrix3 m, double b0, double b1, double sz) |
Generate top line skew transformation (inverse) | |
void | dmtxMatrix3LineSkewSide (OUT DmtxMatrix3 m, double b0, double b1, double sz) |
Generate side line skew transformation. | |
void | dmtxMatrix3LineSkewSideInv (OUT DmtxMatrix3 m, double b0, double b1, double sz) |
Generate side line skew transformation (inverse) | |
void | dmtxMatrix3Multiply (OUT DmtxMatrix3 mOut, DmtxMatrix3 m0, DmtxMatrix3 m1) |
矩阵相乘 | |
void | dmtxMatrix3MultiplyBy (INOUT DmtxMatrix3 m0, DmtxMatrix3 m1) |
矩阵相乘 | |
DmtxPassFail | dmtxMatrix3VMultiply (OUT DmtxVector2 *vOut, DmtxVector2 *vIn, DmtxMatrix3 m) |
将向量与矩阵相乘 | |
DmtxPassFail | dmtxMatrix3VMultiplyBy (INOUT DmtxVector2 *v, DmtxMatrix3 m) |
将向量与矩阵相乘 | |
void | dmtxMatrix3Print (DmtxMatrix3 m) |
Print matrix contents to STDOUT. | |
int | dmtxSymbolModuleStatus (DmtxMessage *message, int sizeIdx, int symbolRow, int symbolCol) |
receives symbol row and col and returns status DmtxModuleOn / !DmtxModuleOn (DmtxModuleOff) DmtxModuleAssigned DmtxModuleVisited DmtxModuleData / !DmtxModuleData (DmtxModuleAlignment) row and col are expressed in symbol coordinates, so (0,0) is the intersection of the "L" | |
int | dmtxGetSymbolAttribute (int attribute, int sizeIdx) |
根据规格索引返回二维码规格各个参数 | |
int | dmtxGetBlockDataSize (int sizeIdx, int blockIdx) |
Retrieve data size for a specific symbol size and block number. | |
int | getSizeIdxFromSymbolDimension (int rows, int cols) |
Retrieve symbol index from rows and columns. | |
DmtxByteList | dmtxByteListBuild (DmtxByte *storage, int capacity) |
void | dmtxByteListInit (DmtxByteList *list, int length, DmtxByte value, DmtxPassFail *passFail) |
void | dmtxByteListClear (DmtxByteList *list) |
DmtxBoolean | dmtxByteListHasCapacity (DmtxByteList *list) |
void | dmtxByteListCopy (DmtxByteList *dst, const DmtxByteList *src, DmtxPassFail *passFail) |
void | dmtxByteListPush (DmtxByteList *list, DmtxByte value, DmtxPassFail *passFail) |
DmtxByte | dmtxByteListPop (DmtxByteList *list, DmtxPassFail *passFail) |
void | dmtxByteListPrint (DmtxByteList *list, char *prefix) |
void | dmtxLog (int level, const char *file, int line, const char *fmt,...) |
void | dmtxLogSetLevel (int level) |
void | dmtxLogSetQuiet (DmtxBoolean enable) |
void | dmtxCallbackBuildMatrixRegion (DmtxCallbackBuildMatrixRegion cb) |
void | dmtxCallbackBuildMatrix (DmtxCallbackBuildMatrix cb) |
void | dmtxCallbackPlotPoint (DmtxCallbackPlotPoint cb) |
void | dmtxCallbackXfrmPlotPoint (DmtxCallbackXfrmPlotPoint cb) |
void | dmtxCallbackPlotModule (DmtxCallbackPlotModule cb) |
void | dmtxCallbackFinal (DmtxCallbackFinal cb) |
char * | dmtxVersion (void) |
Use #include to merge the individual .c source files into a single combined file during preprocessing. | |
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.
All rights reserved. Copyright 2012-2016 Vadim A. Misbakh-Soloviov. All rights reserved. Copyright 2016 Tim Zaman. 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
Main libdmtx header
Definition in file dmtx.h.
#define dmtxLogDebug | ( | ... | ) |
#define dmtxLogError | ( | ... | ) |
#define dmtxLogFatal | ( | ... | ) |
#define dmtxLogInfo | ( | ... | ) |
#define dmtxLogTrace | ( | ... | ) |
#define dmtxLogWarn | ( | ... | ) |
#define DmtxModuleOn DmtxModuleOnRGB |
typedef struct DmtxBestLine_struct DmtxBestLine |
typedef struct DmtxByteList_struct DmtxByteList |
typedef void(* DmtxCallbackBuildMatrix) (DmtxMatrix3 matrix) |
typedef void(* DmtxCallbackBuildMatrixRegion) (DmtxRegion *region) |
typedef void(* DmtxCallbackFinal) (DmtxDecode *decode, DmtxRegion *region) |
typedef void(* DmtxCallbackPlotModule) (DmtxDecode *info, DmtxRegion *region, int row, int col, float colorHue) |
typedef void(* DmtxCallbackPlotPoint) (DmtxPixelLoc loc, float colorHue, int paneNbr, int dispType) |
typedef void(* DmtxCallbackXfrmPlotPoint) (DmtxVector2 point, DmtxMatrix3 xfrm, int paneNbr, int dispType) |
typedef struct DmtxChannel_struct DmtxChannel |
typedef struct DmtxChannelGroup_struct DmtxChannelGroup |
typedef enum DmtxCornerLoc_enum DmtxCornerLoc |
typedef struct DmtxDecode_struct DmtxDecode |
typedef enum DmtxDirection_enum DmtxDirection |
typedef struct DmtxEncode_struct DmtxEncode |
typedef struct DmtxEncodeStream_struct DmtxEncodeStream |
typedef enum DmtxFlip_enum DmtxFlip |
typedef struct DmtxImage_struct DmtxImage |
typedef enum DmtxLogLevel_enum DmtxLogLevel |
typedef double DmtxMatrix3[3][3] |
typedef struct DmtxMessage_struct DmtxMessage |
DataMatrix编码内容
typedef enum DmtxPackOrder_enum DmtxPackOrder |
typedef struct DmtxPixelLoc_struct DmtxPixelLoc |
像素坐标
typedef struct DmtxPointFlow_struct DmtxPointFlow |
图像像素点及其梯度流动方向
typedef enum DmtxProperty_enum DmtxProperty |
typedef struct DmtxQuadruplet_struct DmtxQuadruplet |
typedef struct DmtxRay2_struct DmtxRay2 |
向量表示的直线(线段)
typedef struct DmtxRegion_struct DmtxRegion |
二维码区域(包围框)
typedef struct DmtxScanGrid_struct DmtxScanGrid |
typedef enum DmtxScheme_enum DmtxScheme |
typedef enum DmtxStatus_enum DmtxStatus |
typedef enum DmtxSymAttribute_enum DmtxSymAttribute |
typedef enum DmtxSymbolSize_enum DmtxSymbolSize |
typedef struct DmtxTime_struct DmtxTime |
typedef struct DmtxTriplet_struct DmtxTriplet |
typedef struct DmtxVector2_struct DmtxVector2 |
二维向量
enum DmtxCornerLoc_enum |
enum DmtxDirection_enum |
enum DmtxFlip_enum |
enum DmtxLogLevel_enum |
enum DmtxPackOrder_enum |
enum DmtxProperty_enum |
Enumerator | |
---|---|
DmtxPropScheme | |
DmtxPropSizeRequest | |
DmtxPropMarginSize | |
DmtxPropModuleSize | |
DmtxPropFnc1 | |
DmtxPropEdgeMin | |
DmtxPropEdgeMax | |
DmtxPropScanGap | |
DmtxPropSquareDevn | |
DmtxPropSymbolSize | |
DmtxPropEdgeThresh | |
DmtxPropWidth | 图像宽度 |
DmtxPropHeight | 图像高度 |
DmtxPropPixelPacking | 图像格式类型,像素打包方式 DmtxPackOrder |
DmtxPropBitsPerPixel | 每像素所需要的bit数 |
DmtxPropBytesPerPixel | 每像素所需要的byte数 |
DmtxPropRowPadBytes | 每行像素在内存中的填充或对齐字节数 |
DmtxPropRowSizeBytes | 每一行(包括填充)在内存中的总字节数 |
DmtxPropImageFlip | 图像是否需要翻转,通常用于处理上下颠倒的图像 DmtxFlip |
DmtxPropChannelCount | 图像通道数 |
DmtxPropXmin | ROI X坐标最小值(如果未设置则为0) |
DmtxPropXmax | ROI X坐标最大值(如果未设置则为图像宽度-1) |
DmtxPropYmin | ROI Y坐标最小值(如果未设置则为0) |
DmtxPropYmax | ROI Y坐标最大值(如果未设置则为图像高度-1) |
DmtxPropScale | 图像缩放比例 |
enum DmtxScheme_enum |
enum DmtxStatus_enum |
enum DmtxSymbolSize_enum |
|
extern |
Definition at line 25 of file dmtxbytelist.c.
|
extern |
Definition at line 55 of file dmtxbytelist.c.
|
extern |
Definition at line 74 of file dmtxbytelist.c.
|
extern |
Definition at line 65 of file dmtxbytelist.c.
|
extern |
Definition at line 40 of file dmtxbytelist.c.
|
extern |
Definition at line 108 of file dmtxbytelist.c.
|
extern |
Definition at line 119 of file dmtxbytelist.c.
|
extern |
Definition at line 94 of file dmtxbytelist.c.
|
extern |
Definition at line 9 of file dmtxcallback.c.
|
extern |
Definition at line 4 of file dmtxcallback.c.
|
extern |
Definition at line 29 of file dmtxcallback.c.
|
extern |
Definition at line 24 of file dmtxcallback.c.
|
extern |
Definition at line 14 of file dmtxcallback.c.
|
extern |
Definition at line 19 of file dmtxcallback.c.
|
extern |
Initialize decode struct with default values.
Definition at line 32 of file dmtxdecode.c.
|
extern |
|
extern |
|
extern |
Returns xxx.
dec | |
x | Scaled x coordinate |
y | Scaled y coordinate |
Definition at line 211 of file dmtxdecode.c.
|
extern |
获取图像像素
Definition at line 233 of file dmtxdecode.c.
|
extern |
Get decoding behavior property.
dec | |
prop |
Definition at line 166 of file dmtxdecode.c.
|
extern |
解码拟合的二维码区域
Definition at line 336 of file dmtxdecode.c.
|
extern |
Convert fitted Data Mosaic region into a decoded message.
dec | |
reg | |
fix |
Consider performing a color cube fit here to identify exact RGB of all 6 "cube-like" corners based on pixels located within region. Then force each sample pixel to the "cube-like" corner based o which one is nearest "sqrt(dr^2+dg^2+db^2)" (except sqrt is unnecessary). colorPlane = reg->flowBegin.plane;
To find RGB values of primary colors, perform something like a histogram except instead of going from black to color N, go from (127,127,127) to color. Use color bins along with distance to identify value. An additional method will be required to get actual RGB instead of just a plane in 3D.
Definition at line 436 of file dmtxdecode.c.
|
extern |
从DataMatrix数据区二进制矩阵解码,并将结果写入msg->output
[in] | sizeIdx | 数据矩阵的尺寸索引,对应不同的符号大小。 |
[in,out] | msg | 已经填充模块状态的解码消息结构体实例。 |
[in] | fix | 纠错级别指示符,指定解码时使用的错误纠正能力, 默认DmtxUndefined |
Definition at line 390 of file dmtxdecode.c.
|
extern |
Set decoding behavior property.
dec | |
prop | |
value |
Definition at line 101 of file dmtxdecode.c.
|
extern |
Definition at line 145 of file dmtxvector2.c.
|
extern |
计算点到直线的垂直距离
Definition at line 131 of file dmtxvector2.c.
|
extern |
Initialize encode struct with default values.
Definition at line 32 of file dmtxencode.c.
|
extern |
Convert message into Data Matrix image.
enc | |
inputSize | |
inputString |
Definition at line 171 of file dmtxencode.c.
|
extern |
Convert message into Data Mosaic image.
1) count how many codewords it would take to encode the whole thing 2) take ceiling N of codeword count divided by 3 3) using minimum symbol size that can accomodate N codewords: 4) create several barcodes over iterations of increasing numbers of input codewords until you go one too far 5) if codewords remain after filling R, G, and B barcodes then go back to 3 and try with next larger size 6) take the 3 different images you created and write out a new barcode
enc | |
inputSize | |
inputString |
Definition at line 259 of file dmtxencode.c.
|
extern |
|
extern |
Get encoding behavior property.
enc | |
prop |
Definition at line 146 of file dmtxencode.c.
|
extern |
Set encoding behavior property.
enc | |
prop | |
value |
Definition at line 99 of file dmtxencode.c.
|
extern |
Retrieve data size for a specific symbol size and block number.
sizeIdx | |
blockIdx |
Definition at line 118 of file dmtxsymbol.c.
|
extern |
根据规格索引返回二维码规格各个参数
[in] | attribute | 属性 DmtxSymAttribute |
[in] | sizeIdx | 规格索引 |
Definition at line 45 of file dmtxsymbol.c.
|
extern |
判断坐标 (x, y) 是否在图像范围内
[in] | img | |
[in] | x | coordinate |
[in] | y | coordinate |
Definition at line 404 of file dmtximage.c.
|
extern |
判断坐标 (x, y) 是否在图像范围内
[in] | img | |
[in] | margin | width |
[in] | x | coordinate |
[in] | y | coordinate |
Definition at line 386 of file dmtximage.c.
|
extern |
libdmtx stores image data as a large one-dimensional array of packed pixels, reading from the array when scanning barcodes and writing to it when creating a barcode.
Beyond this interaction the calling program is responsible for populating and dispatching pixels between the image array and the outside world, whether that means loading an image from a file, acquiring camera input, displaying output to a screen, saving to disk, etc...
By default, libdmtx treats the first pixel of an image array as the top-left corner of the physical image, with the final pixel landing at the bottom- right. However, if mapping a pixel buffer this way produces an inverted image the calling program can specify DmtxFlipY at image creation time to remove the inversion. This has a negligible effect on performance since it only modifies the pixel mapping math, and does not alter any pixel data.
Regardless of how an image is stored internally, all libdmtx functions consider coordinate (0,0) to mathematically represent the bottom-left pixel location of an image using a right-handed coordinate system.
libdmtx 将图像数据存储为一个大型一维数组,扫描条形码时从数组中读取,创建条形码时向数组中写入。 除了这种交互,调用程序还负责在图像数组和外部世界之间填充和调度像素, 无论是从文件中加载图像、获取摄像头输入、向屏幕显示输出、保存到磁盘等。
默认情况下,libdmtx 将图像数组的第一个像素视为物理图像的左上角,最后一个像素位于右下角。 不过,如果以这种方式映射像素缓冲区会产生反转图像,调用程序可以在创建图像时指定 DmtxFlipY 来消除反转。 这对性能的影响可以忽略不计,因为它只修改了像素映射数学,而不会改变任何像素数据。
无论图像内部如何存储,所有 libdmtx 函数都认为坐标(0,0)在数学上代表使用右手坐标系的图像左下角像素位置。
(0,HEIGHT-1) (WIDTH-1,HEIGHT-1) array pos = 0,1,2,3,...-----------+ | | | | | libdmtx | | image | | coordinates | | | | | +---------...,N-2,N-1,N = array pos (0,0) (WIDTH-1,0)
Notes:
创建一个新的图像对象
Definition at line 78 of file dmtximage.c.
|
extern |
Free libdmtx image memory.
[in] | img | pointer to img location |
Definition at line 167 of file dmtximage.c.
|
extern |
根据给定的坐标 (x, y) 计算并返回图像中对应像素的字节偏移量
Definition at line 263 of file dmtximage.c.
|
extern |
|
extern |
|
extern |
设置图像的颜色通道信息,包括每个通道的起始位和位数。
Definition at line 183 of file dmtximage.c.
|
extern |
设置指定坐标、通道的像素值
Definition at line 337 of file dmtximage.c.
|
extern |
设置图像属性
Definition at line 203 of file dmtximage.c.
|
extern |
|
extern |
|
extern |
复制3x3矩阵
该函数将一个 3x3 矩阵的内容复制到另一个矩阵。
[out] | m0 | 指向目标矩阵的指针,用于存储复制的结果 |
[in] | m1 | 指向源矩阵的指针,从中读取数据进行复制 |
Definition at line 34 of file dmtxmatrix3.c.
|
extern |
生成单位变换矩阵
| 1 0 0 |
m = | 0 1 0 | | 0 0 1 |
Transform "m" (doesn't change anything) |\
(0,1) x-—o +–+ \ (0,1) x-—o | | | \ | | | | | / | | +-—* +–+ / +-—* (0,0) (1,0) |/ (0,0) (1,0)
Definition at line 56 of file dmtxmatrix3.c.
|
extern |
Generate side line skew transformation.
[out] | m | |
[in] | b0 | |
[in] | b1 | |
[in] | sz |
Definition at line 234 of file dmtxmatrix3.c.
|
extern |
Generate side line skew transformation (inverse)
[out] | m | |
[in] | b0 | |
[in] | b1 | |
[in] | sz |
Definition at line 251 of file dmtxmatrix3.c.
|
extern |
生成顶部线倾斜变换矩阵
该函数用于创建一个变换矩阵,该矩阵用于对图像进行顶部线的倾斜变换。 这种变换通常用于校正图像中的透视失真。
[out] | m | 生成的矩阵 |
[in] | b0 | 基线起点的 y 坐标 |
[in] | b1 | 基线终点的 y 坐标 |
[in] | sz | 变换后的高度 | b1/b0 0 (b1-b0)/(sz*b0) |m = | 0 sz/b0 0 | | 0 0 1 | |
(sz,b1) o /| Transform "m" / | / | +–+ / | | | (0,b0) x | | | | | +-+ +-+ (0,sz) +-—+ \ / (0,sz) x-—o | | \ / | | | | \/ | | +-—+ +-—+ (0,0) (sz,0) (0,0) (sz,0)
Definition at line 200 of file dmtxmatrix3.c.
|
extern |
Generate top line skew transformation (inverse)
[out] | m | |
[in] | b0 | |
[in] | b1 | |
[in] | sz |
Definition at line 217 of file dmtxmatrix3.c.
|
extern |
矩阵相乘
该函数用于将两个 3x3 矩阵相乘,并将结果存储在输出矩阵中。
[out] | mOut | 指向输出矩阵的指针,用于存储乘法结果 |
[in] | m0 | 指向第一个输入矩阵的指针 |
[in] | m1 | 指向第二个输入矩阵的指针 |
Definition at line 270 of file dmtxmatrix3.c.
|
extern |
矩阵相乘
该函数用于将两个 3x3 矩阵相乘,并将结果存储在第一个矩阵中。
[in,out] | m0 | 指向第一个输入矩阵的指针,其内容将被修改为乘法的结果 |
[in] | m1 | 指向第二个输入矩阵的指针 |
Definition at line 294 of file dmtxmatrix3.c.
|
extern |
|
extern |
生成旋转变换矩阵
[out] | m | 生成的矩阵 |
[in] | angle | 旋转的角度 | cos(a) sin(a) 0 |m = | -sin(a) cos(a) 0 | | 0 0 1 | o Transform "m" / ___ / (0,1) x-—o |/ \ x * (cos(a),sin(a)) | | '– | / | | ___/ / a +-—* `+ - - - - - - (0,0) (1,0) (0,0) |
Definition at line 107 of file dmtxmatrix3.c.
|
extern |
生成缩放变换矩阵
[out] | m | 生成的矩阵 |
[in] | sx | x轴的缩放因子 |
[in] | sy | y轴的缩放因子 | sx 0 0 |m = | 0 sy 0 | | 0 0 1 | Transform "m" _____ (0,sy) x-------o (sx,sy) \ | | |(0,1) x-—o / | (0,1) +-—+ | | | / /| | | | | | \ / | | | +-—* ` +-—+–* (0,0) (1,0) (0,0) (sx,0) |
Definition at line 141 of file dmtxmatrix3.c.
|
extern |
生成剪切变换矩阵
剪切变换(shear transformation)是空间线性变换之一,是仿射变换的一种原始变换。 它指的是类似于四边形不稳定性那种性质,方形变平行四边形,任意一边都可以被拉长的过程。
XXX: 这里的X和Y方向是不是弄反了
[out] | m | 生成的矩阵 |
[in] | shx | x轴方向的剪切因子 |
[in] | shy | y轴方向的剪切因子 | 0 shy 0 |m = | shx 0 0 | | 0 0 1 | |
Definition at line 164 of file dmtxmatrix3.c.
|
extern |
生成平移变换矩阵
[out] | m | 生成的矩阵 |
[in] | tx | 沿 x 轴的平移量 |
[in] | ty | 沿 y 轴的平移量 | 1 0 0 |m = | 0 1 0 | | tx ty 1 | Transform "m" _____ (tx,1+ty) x----o (1+tx,1+ty) \ | | |(0,1) x-—o / | (0,1) +-|–+ | | | / /| | +-—* (1+tx,ty) | | \ / | | +-—* ` +-—+ (0,0) (1,0) (0,0) (1,0) |
Definition at line 82 of file dmtxmatrix3.c.
|
extern |
将向量与矩阵相乘
该函数用于将一个 3x3 矩阵与一个 2D 向量相乘,并将结果存储在输出向量中。
[out] | vOut | 指向输出向量的指针,用于存储乘法结果 |
[in] | vIn | 指向输入向量的指针 |
[in] | m | 要与向量相乘的 3x3 矩阵(仿射变换矩阵) |
Definition at line 312 of file dmtxmatrix3.c.
|
extern |
将向量与矩阵相乘
此函数将输入向量v
与给定矩阵m
相乘,并直接更新输入向量v
为乘法的结果。
[in,out] | v | 输入向量同时也是输出向量,乘法操作后存储结果。 |
[in] | m | 用于乘法运算的3x3矩阵。 |
Definition at line 338 of file dmtxmatrix3.c.
|
extern |
Allocate memory for message.
sizeIdx | |
symbolFormat | DmtxFormatMatrix | DmtxFormatMosaic |
Definition at line 30 of file dmtxmessage.c.
|
extern |
Free memory previously allocated for message.
msg |
Definition at line 87 of file dmtxmessage.c.
|
extern |
计算直线上特定位置的点
I = p + t·v
[out] | point | 点I的坐标。 |
[in] | r | 直线 |
[in] | t | 表示沿射线方向的位置参数(从射线起点开始测量的距离)。 |
Definition at line 195 of file dmtxvector2.c.
|
extern |
判断两条直线是否相交,并计算交点。
用向量叉乘求直线交点 https://www.cnblogs.com/zhb2000/p/vector-cross-product-solve-intersection.html
point | 交点坐标(如果存在) |
p0 | 第一条直线 |
p1 | 第二条直线 |
Definition at line 170 of file dmtxvector2.c.
|
extern |
Create copy of existing region struct.
Definition at line 32 of file dmtxregion.c.
|
extern |
|
extern |
寻找下一个二维码区域
dec | Pointer to DmtxDecode information struct |
timeout | 超时时间 (如果为NULL则不限时) |
Definition at line 69 of file dmtxregion.c.
|
extern |
将坐标点(x,y)作为二维码L型框的边缘点去匹配二维码包围框
Definition at line 100 of file dmtxregion.c.
|
extern |
Definition at line 421 of file dmtxregion.c.
|
extern |
Definition at line 528 of file dmtxregion.c.
|
extern |
receives symbol row and col and returns status DmtxModuleOn / !DmtxModuleOn (DmtxModuleOff) DmtxModuleAssigned DmtxModuleVisited DmtxModuleData / !DmtxModuleData (DmtxModuleAlignment) row and col are expressed in symbol coordinates, so (0,0) is the intersection of the "L"
Definition at line 30 of file dmtxplacemod.c.
Add milliseconds to time t.
t | |
msec |
Definition at line 110 of file dmtxtime.c.
|
extern |
Determine whether the received timeout has been exceeded.
timeout |
Definition at line 139 of file dmtxtime.c.
|
extern |
|
extern |
向量相加
Definition at line 37 of file dmtxvector2.c.
|
extern |
|
extern |
二维向量叉积
Definition at line 89 of file dmtxvector2.c.
|
extern |
二维向量点积
Definition at line 115 of file dmtxvector2.c.
|
extern |
二维向量的模
Definition at line 123 of file dmtxvector2.c.
|
extern |
|
extern |
向量数乘
Definition at line 79 of file dmtxvector2.c.
|
extern |
|
extern |
向量相减
Definition at line 58 of file dmtxvector2.c.
|
extern |
|
extern |
Use #include
to merge the individual .c
source files into a single combined file during preprocessing.
This allows the project to be organized in files of like-functionality while still keeping a clean namespace. Specifically, internal functions can be static without losing the ability to access them "externally" from the other source files in this list.
|
extern |
Retrieve symbol index from rows and columns.
rows | |
cols |
Definition at line 26 of file dmtxsymbol.c.