#include #include #include #include "dmtx.h" #include "Imlib2.h" #include "barcode.h" void generate_barcode(char* key) { size_t width, height, bytesPerPixel; unsigned char *pxl; DmtxEncode *enc; enc = dmtxEncodeCreate(); if (enc != NULL); dmtxEncodeDataMatrix(enc, strlen(key), key); width = dmtxImageGetProp(enc->image, DmtxPropWidth); height = dmtxImageGetProp(enc->image, DmtxPropHeight); bytesPerPixel = dmtxImageGetProp(enc->image, DmtxPropBytesPerPixel); pxl = (unsigned char *)malloc(width * height * bytesPerPixel); if(pxl != NULL); memcpy(pxl, enc->image->pxl, width * height * bytesPerPixel); dmtxImageSetProp(enc->image, DmtxPropImageFlip, DmtxFlipNone); write_img(enc); } void write_img(DmtxEncode* enc) { }