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 <assert.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "dmtx.h"
#include "dmtxstatic.h"
Go to the source code of this file.
Macros | |
#define | ISDIGIT(n) |
Functions | |
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. | |
static int | encodeDataCodewords (DmtxByteList *input, DmtxByteList *output, int sizeIdxRequest, DmtxScheme scheme, int fnc1) |
Convert input into message using specific encodation scheme. | |
static void | printPattern (DmtxEncode *enc) |
Write encoded message to image. | |
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
Base encoding logic
Definition in file dmtxencode.c.
#define ISDIGIT | ( | n | ) |
Definition at line 26 of file dmtxencode.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.
|
static |
Convert input into message using specific encodation scheme.
Future: pass DmtxEncode to this function with an error reason field, which goes to EncodeSingle... too
Definition at line 390 of file dmtxencode.c.
|
static |