83 if (pxl == NULL || width < 1 || height < 1) {
169 if (img == NULL || *img == NULL) {
327 *value = img->
pxl[offset + channel];
371 img->
pxl[offset + channel] = value;
390 if (x - margin >= 0 && x + margin < img->width && y - margin >= 0 && y + margin < img->height) {
408 if (x >= 0.0 && x < (
double)img->
width && y >= 0.0 && y < (
double)img->
height) {
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.
@ DmtxPropBytesPerPixel
每像素所需要的byte数
@ DmtxPropRowSizeBytes
每一行(包括填充)在内存中的总字节数
@ DmtxPropImageFlip
图像是否需要翻转,通常用于处理上下颠倒的图像 DmtxFlip
@ DmtxPropPixelPacking
图像格式类型,像素打包方式 DmtxPackOrder
@ DmtxPropRowPadBytes
每行像素在内存中的填充或对齐字节数
@ DmtxPropChannelCount
图像通道数
@ DmtxPropBitsPerPixel
每像素所需要的bit数
static int getBitsPerPixel(int pack)
根据给定的打包方式(pack)返回每个像素所占的位数
DmtxPassFail dmtxImageSetProp(DmtxImage *img, int prop, int value)
设置图像属性
DmtxPassFail dmtxImageSetChannel(DmtxImage *img, int channelStart, int bitsPerChannel)
设置图像的颜色通道信息,包括每个通道的起始位和位数。
DmtxPassFail dmtxImageDestroy(DmtxImage **img)
Free libdmtx image memory.
DmtxBoolean dmtxImageContainsInt(DmtxImage *img, int margin, int x, int y)
判断坐标 (x, y) 是否在图像范围内
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 w...
int dmtxImageGetByteOffset(DmtxImage *img, int x, int y)
根据给定的坐标 (x, y) 计算并返回图像中对应像素的字节偏移量
int dmtxImageGetProp(DmtxImage *img, int prop)
获取图像属性
DmtxPassFail dmtxImageSetPixelValue(DmtxImage *img, int x, int y, int channel, int value)
设置指定坐标、通道的像素值
DmtxBoolean dmtxImageContainsFloat(DmtxImage *img, double x, double y)
判断坐标 (x, y) 是否在图像范围内
DmtxPassFail dmtxImageGetPixelValue(DmtxImage *img, int x, int y, int channel, int *value)
获取指定坐标的像素值
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.
int imageFlip
图像是否需要翻转,通常用于处理上下颠倒的图像 DmtxFlip
int pixelPacking
图像格式类型,像素打包方式 DmtxPackOrder
int channelStart[4]
每个通道在像素数据中的起始位置(位偏移)
unsigned char * pxl
实际的像素数据缓冲区
int bytesPerPixel
每个像素的字节数
int rowPadBytes
每行像素在内存中的填充或对齐字节数
int bitsPerChannel[4]
每个通道的位数,描述每个颜色分量的精度
int channelCount
图像的通道数量,如RGB图像为3,CMYK图像为4
int rowSizeBytes
每一行(包括填充)在内存中的总字节数