76 int headerByteCount, outputLength, symbolRemaining;
84 DmtxAssert(headerByteCount == 1 || headerByteCount == 2);
87 if (headerByteCount == 2) {
94 if (symbolRemaining == 0) {
156 }
else if (!perfectFit && headerByteCount == 1 && outputLength > 249) {
161 }
else if (perfectFit && headerByteCount == 2) {
172 if (!perfectFit && headerByteCount == 1 && outputLength <= 249) {
177 }
else if (!perfectFit && headerByteCount == 2 && outputLength > 249) {
186 }
else if (perfectFit && headerByteCount == 1) {
210 for (i = stream->
output->
length - 1; i > chainStart; i--) {
233 for (i = chainStart; i < stream->
output->
length - 1; i++) {
254 int pseudoRandom, tmp;
256 pseudoRandom = ((149 * position) % 255) + 1;
257 tmp = value + pseudoRandom;
259 return (tmp <= 255) ? tmp : tmp - 256;
273 pseudoRandom = ((149 * idx) % 255) + 1;
274 tmp = value - pseudoRandom;
281 return (
unsigned char)tmp;
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.
int dmtxGetSymbolAttribute(int attribute, int sizeIdx)
根据规格索引返回二维码规格各个参数
void dmtxByteListPush(DmtxByteList *list, DmtxByte value, DmtxPassFail *passFail)
@ DmtxSymAttribSymbolDataWords
DmtxByte dmtxByteListPop(DmtxByteList *list, DmtxPassFail *passFail)
static void encodeNextChunkBase256(DmtxEncodeStream *stream)
static void appendValueBase256(DmtxEncodeStream *stream, DmtxByte value)
static void updateBase256ChainHeader(DmtxEncodeStream *stream, int perfectSizeIdx)
static void base256OutputChainRemoveFirst(DmtxEncodeStream *stream)
remove first element from chain, shifting all following elements back by one used for binary length c...
static void base256OutputChainInsertFirst(DmtxEncodeStream *stream)
insert element at beginning of chain, shifting all following elements forward by one used for binary ...
static void completeIfDoneBase256(DmtxEncodeStream *stream, int sizeIdxRequest)
check remaining symbol capacity and remaining codewords if the chain can finish perfectly at the end ...
static DmtxByte randomize255State(DmtxByte value, int position)
Randomize 255 state.
static unsigned char unRandomize255State(unsigned char value, int idx)
Unrandomize 255 state.
libdmtx - Data Matrix Encoding/Decoding Library Copyright 2008, 2009 Mike Laughton.
static DmtxByte streamInputAdvanceNext(DmtxEncodeStream *stream)
static void streamOutputChainAppend(DmtxEncodeStream *stream, DmtxByte value)
static void streamOutputSet(DmtxEncodeStream *stream, int index, DmtxByte value)
static void padRemainingInAscii(DmtxEncodeStream *stream, int sizeIdx)
static DmtxByte streamInputPeekNext(DmtxEncodeStream *stream)
static int findSymbolSize(int dataWords, int sizeIdxRequest)
static void streamMarkComplete(DmtxEncodeStream *stream, int sizeIdx)
#define DmtxUnlatchImplicit
static void encodeChangeScheme(DmtxEncodeStream *stream, DmtxScheme targetScheme, int unlatchType)
static int getRemainingSymbolCapacity(int outputLength, int sizeIdx)
static void appendValueAscii(DmtxEncodeStream *stream, DmtxByte value)
#define DmtxUnlatchExplicit
static void streamMarkFatal(DmtxEncodeStream *stream, int reasonIdx)
static DmtxBoolean streamInputHasNext(DmtxEncodeStream *stream)
int outputChainValueCount