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.
Loading...
Searching...
No Matches
dmtxplacemod.c File Reference

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton. More...

#include <assert.h>
#include "dmtx.h"
#include "dmtxstatic.h"

Go to the source code of this file.

Functions

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"
 
static int modulePlacementEcc200 (INOUT unsigned char *modules, OUT unsigned char *codewords, int sizeIdx, int moduleOnColor)
 通过DataMatrix数据区的二进制矩阵,根据DataMatrix的排列规则,得到码字(codewords)
 
static void patternShapeStandard (unsigned char *modules, int mappingRows, int mappingCols, int row, int col, unsigned char *codeword, int moduleOnColor)
 将标准码字放置到指定的模块位置
 
static void patternShapeSpecial1 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor)
 特殊排布1
 
static void patternShapeSpecial2 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor)
 特殊排布2
 
static void patternShapeSpecial3 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor)
 特殊排布3
 
static void patternShapeSpecial4 (unsigned char *modules, int mappingRows, int mappingCols, unsigned char *codeword, int moduleOnColor)
 特殊排布4
 
static void placeModule (unsigned char *modules, int mappingRows, int mappingCols, int row, int col, unsigned char *codeword, int mask, int moduleOnColor)
 位模块放置
 

Detailed Description

libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.

All rights reserved. Copyright 2012-2016 Vadim A. Misbakh-Soloviov. 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

Data Matrix module placement

Definition in file dmtxplacemod.c.

Function Documentation

◆ dmtxSymbolModuleStatus()

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"

Definition at line 30 of file dmtxplacemod.c.

◆ modulePlacementEcc200()

static int modulePlacementEcc200 ( INOUT unsigned char * modules,
OUT unsigned char * codewords,
int sizeIdx,
int moduleOnColor )
static

通过DataMatrix数据区的二进制矩阵,根据DataMatrix的排列规则,得到码字(codewords)

Parameters
[in,out]modulesDataMatrix数据区矩阵
[out]codewords存储码字的数组
[in]sizeIdxDataMatrix符号种类索引
[in]moduleOnColor指定模块颜色属性的标志,如红色、绿色或蓝色

Definition at line 73 of file dmtxplacemod.c.

◆ patternShapeSpecial1()

static void patternShapeSpecial1 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

特殊排布1

左下角:

|1|2|3|

右上角:

|4|5|
|6|
|7|
|8|
Parameters
modules
mappingRows
mappingCols
codeword
moduleOnColor

Definition at line 186 of file dmtxplacemod.c.

◆ patternShapeSpecial2()

static void patternShapeSpecial2 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

特殊排布2

左下角:

|1|
|2|
|3|

右上角:

|4|5|6|7|
|8|
Parameters
modules
mappingRows
mappingCols
codeword
moduleOnColor

Definition at line 221 of file dmtxplacemod.c.

◆ patternShapeSpecial3()

static void patternShapeSpecial3 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

特殊排布3

左下角:

|1|
|2|
|3|

右上角:

|4|5|
|6|
|7|
|8|
Parameters
modules
mappingRows
mappingCols
codeword
moduleOnColor

Definition at line 257 of file dmtxplacemod.c.

◆ patternShapeSpecial4()

static void patternShapeSpecial4 ( unsigned char * modules,
int mappingRows,
int mappingCols,
unsigned char * codeword,
int moduleOnColor )
static

特殊排布4

左下角:

|1|

右下角:

|2|

右上角:

|3|4|5|
|6|7|8|
Parameters
modules
mappingRows
mappingCols
codeword
moduleOnColor

Definition at line 295 of file dmtxplacemod.c.

◆ patternShapeStandard()

static void patternShapeStandard ( unsigned char * modules,
int mappingRows,
int mappingCols,
int row,
int col,
unsigned char * codeword,
int moduleOnColor )
static

将标准码字放置到指定的模块位置

|1|2|
|3|4|5|
|6|7|8|
Parameters
modules指向存储模块数据的二维数组的指针
mappingRows模块映射的行数
mappingCols模块映射的列数
row标准码字第8位所在的行坐标
col标准码字第8位所在的列坐标
codeword码字
moduleOnColor表示模块开启颜色的整数值

Definition at line 152 of file dmtxplacemod.c.

◆ placeModule()

static void placeModule ( unsigned char * modules,
int mappingRows,
int mappingCols,
int row,
int col,
unsigned char * codeword,
int mask,
int moduleOnColor )
static

位模块放置

此函数负责在Data Matrix码的模块矩阵中放置或读取单个位模块,取决于当前操作是编码还是解码过程。 它处理边界 wrap-around 逻辑,并根据给定的编码字和模块颜色更新模块状态。

Parameters
modules指向包含模块信息的一维数组,按行优先顺序排列
mappingRows数据矩阵映射区域的行数
mappingCols数据矩阵映射区域的列数
row当前处理模块的行索引
col当前处理模块的列索引
codeword指向当前处理的编码字的指针,用于解码时读取或编码时设置模块状态
mask用于位操作的掩码,帮助区分编码字中的特定位
moduleOnColor指定放置模块的颜色属性标记

Definition at line 324 of file dmtxplacemod.c.