Merge branch 'master' of ssh://git.code.sf.net/p/zint/code

This commit is contained in:
Harald Oehlmann 2020-04-06 18:40:03 +02:00
commit b0ada6438a
16 changed files with 1671 additions and 192 deletions

View File

@ -74,6 +74,46 @@ INTERNAL int bmp_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
for (column = 0; column < symbol->bitmap_width; column++) { for (column = 0; column < symbol->bitmap_width; column++) {
i = (3 * column) + (row * row_size); i = (3 * column) + (row * row_size);
switch (*(pixelbuf + (symbol->bitmap_width * (symbol->bitmap_height - row - 1)) + column)) { switch (*(pixelbuf + (symbol->bitmap_width * (symbol->bitmap_height - row - 1)) + column)) {
case 'W': // White
bitmap[i] = 255;
bitmap[i + 1] = 255;
bitmap[i + 2] = 255;
break;
case 'C': // Cyan
bitmap[i] = 255;
bitmap[i + 1] = 255;
bitmap[i + 2] = 0;
break;
case 'B': // Blue
bitmap[i] = 255;
bitmap[i + 1] = 0;
bitmap[i + 2] = 0;
break;
case 'M': // Magenta
bitmap[i] = 255;
bitmap[i + 1] = 0;
bitmap[i + 2] = 255;
break;
case 'R': // Red
bitmap[i] = 0;
bitmap[i + 1] = 0;
bitmap[i + 2] = 255;
break;
case 'Y': // Yellow
bitmap[i] = 0;
bitmap[i + 1] = 255;
bitmap[i + 2] = 255;
break;
case 'G': // Green
bitmap[i] = 0;
bitmap[i + 1] = 255;
bitmap[i + 2] = 0;
break;
case 'K': // Black
bitmap[i] = 0;
bitmap[i + 1] = 0;
bitmap[i + 2] = 0;
break;
case '1': case '1':
bitmap[i] = fgblu; bitmap[i] = fgblu;
bitmap[i + 1] = fggrn; bitmap[i + 1] = fggrn;

View File

@ -152,7 +152,11 @@ INTERNAL int ustrchr_cnt(const unsigned char string[], const size_t length, cons
/* Return true (1) if a module is dark/black, otherwise false (0) */ /* Return true (1) if a module is dark/black, otherwise false (0) */
INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) { INTERNAL int module_is_set(const struct zint_symbol *symbol, const int y_coord, const int x_coord) {
return (symbol->encoded_data[y_coord][x_coord / 7] >> (x_coord % 7)) & 1; if (symbol->symbology == BARCODE_ULTRA) {
return symbol->encoded_data[y_coord][x_coord];
} else {
return (symbol->encoded_data[y_coord][x_coord / 7] >> (x_coord % 7)) & 1;
}
} }
/* Set a module to dark/black */ /* Set a module to dark/black */

View File

@ -42,6 +42,51 @@
#include "common.h" #include "common.h"
#include "emf.h" #include "emf.h"
int colour_to_red(int colour) {
int return_val = 0;
switch(colour) {
case 0: // White
case 3: // Magenta
case 4: // Red
case 5: // Yellow
return_val = 255;
break;
}
return return_val;
}
int colour_to_green(int colour) {
int return_val = 0;
switch(colour) {
case 0: // White
case 1: // Cyan
case 5: // Yellow
case 6: // Green
return_val = 255;
break;
}
return return_val;
}
int colour_to_blue(int colour) {
int return_val = 0;
switch(colour) {
case 0: // White
case 1: // Cyan
case 2: // Blue
case 3: // Magenta
return_val = 255;
break;
}
return return_val;
}
static int count_rectangles(struct zint_symbol *symbol) { static int count_rectangles(struct zint_symbol *symbol) {
int rectangles = 0; int rectangles = 0;
struct zint_vector_rect *rect; struct zint_vector_rect *rect;
@ -137,6 +182,8 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
int string_count, this_text; int string_count, this_text;
int bytecount, recordcount; int bytecount, recordcount;
float radius; float radius;
int colours_used = 0;
int rectangle_count_bycolour[8];
unsigned char *this_string[6]; unsigned char *this_string[6];
uint32_t spacing; uint32_t spacing;
@ -151,8 +198,10 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
emr_eof_t emr_eof; emr_eof_t emr_eof;
emr_createbrushindirect_t emr_createbrushindirect_fg; emr_createbrushindirect_t emr_createbrushindirect_fg;
emr_createbrushindirect_t emr_createbrushindirect_bg; emr_createbrushindirect_t emr_createbrushindirect_bg;
emr_createbrushindirect_t emr_createbrushindirect_colour[8]; // Used for colour symbols only
emr_selectobject_t emr_selectobject_fgbrush; emr_selectobject_t emr_selectobject_fgbrush;
emr_selectobject_t emr_selectobject_bgbrush; emr_selectobject_t emr_selectobject_bgbrush;
emr_selectobject_t emr_selectobject_colour[8]; // Used for colour symbols only
emr_createpen_t emr_createpen; emr_createpen_t emr_createpen;
emr_selectobject_t emr_selectobject_pen; emr_selectobject_t emr_selectobject_pen;
emr_rectangle_t background; emr_rectangle_t background;
@ -191,7 +240,24 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
hexagon = (emr_polygon_t*) _alloca(hexagon_count * sizeof (emr_polygon_t)); hexagon = (emr_polygon_t*) _alloca(hexagon_count * sizeof (emr_polygon_t));
text = (emr_exttextoutw_t*) _alloca(string_count * sizeof (emr_exttextoutw_t)); text = (emr_exttextoutw_t*) _alloca(string_count * sizeof (emr_exttextoutw_t));
#endif #endif
//Calculate how many coloured rectangles
if (symbol->symbology == BARCODE_ULTRA) {
for (i = 0; i < 8; i++) {
rectangle_count_bycolour[i] = 0;
}
rect = symbol->vector->rectangles;
this_rectangle = 0;
while (rect) {
if (rectangle_count_bycolour[rect->colour] == 0) {
colours_used++;
}
rectangle_count_bycolour[rect->colour]++;
rect = rect->next;
}
}
/* Header */ /* Header */
emr_header.type = 0x00000001; // EMR_HEADER emr_header.type = 0x00000001; // EMR_HEADER
emr_header.size = 88; // Assuming no additional data in header emr_header.size = 88; // Assuming no additional data in header
@ -218,21 +284,9 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
recordcount = 1; recordcount = 1;
/* Create Brushes */ /* Create Brushes */
emr_createbrushindirect_fg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
emr_createbrushindirect_fg.size = 24;
emr_createbrushindirect_fg.ih_brush = 1;
emr_createbrushindirect_fg.log_brush.brush_style = 0x0000; // BS_SOLID
emr_createbrushindirect_fg.log_brush.color.red = fgred;
emr_createbrushindirect_fg.log_brush.color.green = fggrn;
emr_createbrushindirect_fg.log_brush.color.blue = fgblu;
emr_createbrushindirect_fg.log_brush.color.reserved = 0;
emr_createbrushindirect_fg.log_brush.brush_hatch = 0x0006; // HS_SOLIDCLR
bytecount += 24;
recordcount++;
emr_createbrushindirect_bg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT emr_createbrushindirect_bg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
emr_createbrushindirect_bg.size = 24; emr_createbrushindirect_bg.size = 24;
emr_createbrushindirect_bg.ih_brush = 2; emr_createbrushindirect_bg.ih_brush = 1;
emr_createbrushindirect_bg.log_brush.brush_style = 0x0000; // BS_SOLID emr_createbrushindirect_bg.log_brush.brush_style = 0x0000; // BS_SOLID
emr_createbrushindirect_bg.log_brush.color.red = bgred; emr_createbrushindirect_bg.log_brush.color.red = bgred;
emr_createbrushindirect_bg.log_brush.color.green = bggrn; emr_createbrushindirect_bg.log_brush.color.green = bggrn;
@ -242,22 +296,60 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
bytecount += 24; bytecount += 24;
recordcount++; recordcount++;
emr_selectobject_fgbrush.type = 0x00000025; // EMR_SELECTOBJECT if (symbol->symbology == BARCODE_ULTRA) {
emr_selectobject_fgbrush.size = 12; for (i = 0; i < 8; i++) {
emr_selectobject_fgbrush.ih_object = 1; emr_createbrushindirect_colour[i].type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
bytecount += 12; emr_createbrushindirect_colour[i].size = 24;
recordcount++; emr_createbrushindirect_colour[i].ih_brush = 2 + i;
emr_createbrushindirect_colour[i].log_brush.brush_style = 0x0000; // BS_SOLID
emr_createbrushindirect_colour[i].log_brush.color.red = colour_to_red(i);
emr_createbrushindirect_colour[i].log_brush.color.green = colour_to_green(i);
emr_createbrushindirect_colour[i].log_brush.color.blue = colour_to_blue(i);
emr_createbrushindirect_colour[i].log_brush.color.reserved = 0;
emr_createbrushindirect_colour[i].log_brush.brush_hatch = 0x0006; // HS_SOLIDCLR
}
bytecount += colours_used * 24;
recordcount += colours_used;
} else {
emr_createbrushindirect_fg.type = 0x00000027; // EMR_CREATEBRUSHINDIRECT
emr_createbrushindirect_fg.size = 24;
emr_createbrushindirect_fg.ih_brush = 2;
emr_createbrushindirect_fg.log_brush.brush_style = 0x0000; // BS_SOLID
emr_createbrushindirect_fg.log_brush.color.red = fgred;
emr_createbrushindirect_fg.log_brush.color.green = fggrn;
emr_createbrushindirect_fg.log_brush.color.blue = fgblu;
emr_createbrushindirect_fg.log_brush.color.reserved = 0;
emr_createbrushindirect_fg.log_brush.brush_hatch = 0x0006; // HS_SOLIDCLR
bytecount += 24;
recordcount++;
}
emr_selectobject_bgbrush.type = 0x00000025; // EMR_SELECTOBJECT emr_selectobject_bgbrush.type = 0x00000025; // EMR_SELECTOBJECT
emr_selectobject_bgbrush.size = 12; emr_selectobject_bgbrush.size = 12;
emr_selectobject_bgbrush.ih_object = 2; emr_selectobject_bgbrush.ih_object = 1;
bytecount += 12; bytecount += 12;
recordcount++; recordcount++;
if (symbol->symbology == BARCODE_ULTRA) {
for (i = 0; i < 8; i++) {
emr_selectobject_colour[i].type = 0x00000025; // EMR_SELECTOBJECT
emr_selectobject_colour[i].size = 12;
emr_selectobject_colour[i].ih_object = 2 + i;
}
bytecount += colours_used * 12;
recordcount += colours_used;
} else {
emr_selectobject_fgbrush.type = 0x00000025; // EMR_SELECTOBJECT
emr_selectobject_fgbrush.size = 12;
emr_selectobject_fgbrush.ih_object = 2;
bytecount += 12;
recordcount++;
}
/* Create Pens */ /* Create Pens */
emr_createpen.type = 0x00000026; // EMR_CREATEPEN emr_createpen.type = 0x00000026; // EMR_CREATEPEN
emr_createpen.size = 28; emr_createpen.size = 28;
emr_createpen.ih_pen = 3; emr_createpen.ih_pen = 10;
emr_createpen.log_pen.pen_style = 0x00000005; // PS_NULL emr_createpen.log_pen.pen_style = 0x00000005; // PS_NULL
emr_createpen.log_pen.width.x = 1; emr_createpen.log_pen.width.x = 1;
emr_createpen.log_pen.width.y = 0; // ignored emr_createpen.log_pen.width.y = 0; // ignored
@ -270,7 +362,7 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
emr_selectobject_pen.type = 0x00000025; // EMR_SELECTOBJECT emr_selectobject_pen.type = 0x00000025; // EMR_SELECTOBJECT
emr_selectobject_pen.size = 12; emr_selectobject_pen.size = 12;
emr_selectobject_pen.ih_object = 3; emr_selectobject_pen.ih_object = 10;
bytecount += 12; bytecount += 12;
recordcount++; recordcount++;
@ -460,8 +552,18 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
fwrite(&emr_header, sizeof (emr_header_t), 1, emf_file); fwrite(&emr_header, sizeof (emr_header_t), 1, emf_file);
fwrite(&emr_createbrushindirect_fg, sizeof (emr_createbrushindirect_t), 1, emf_file);
fwrite(&emr_createbrushindirect_bg, sizeof (emr_createbrushindirect_t), 1, emf_file); fwrite(&emr_createbrushindirect_bg, sizeof (emr_createbrushindirect_t), 1, emf_file);
if (symbol->symbology == BARCODE_ULTRA) {
for (i = 0; i < 8; i++) {
if (rectangle_count_bycolour[i]) {
fwrite(&emr_createbrushindirect_colour[i], sizeof (emr_createbrushindirect_t), 1, emf_file);
}
}
} else {
fwrite(&emr_createbrushindirect_fg, sizeof (emr_createbrushindirect_t), 1, emf_file);
}
fwrite(&emr_createpen, sizeof (emr_createpen_t), 1, emf_file); fwrite(&emr_createpen, sizeof (emr_createpen_t), 1, emf_file);
if (symbol->vector->strings) { if (symbol->vector->strings) {
@ -472,11 +574,29 @@ INTERNAL int emf_plot(struct zint_symbol *symbol) {
fwrite(&emr_selectobject_pen, sizeof (emr_selectobject_t), 1, emf_file); fwrite(&emr_selectobject_pen, sizeof (emr_selectobject_t), 1, emf_file);
fwrite(&background, sizeof (emr_rectangle_t), 1, emf_file); fwrite(&background, sizeof (emr_rectangle_t), 1, emf_file);
fwrite(&emr_selectobject_fgbrush, sizeof (emr_selectobject_t), 1, emf_file); if (symbol->symbology == BARCODE_ULTRA) {
for(i = 0; i < 8; i++) {
if (rectangle_count_bycolour[i]) {
fwrite(&emr_selectobject_colour[i], sizeof (emr_selectobject_t), 1, emf_file);
// Rectangles rect = symbol->vector->rectangles;
for (i = 0; i < rectangle_count; i++) { this_rectangle = 0;
fwrite(&rectangle[i], sizeof (emr_rectangle_t), 1, emf_file); while (rect) {
if (rect->colour == i) {
fwrite(&rectangle[this_rectangle], sizeof (emr_rectangle_t), 1, emf_file);
}
this_rectangle++;
rect = rect->next;
}
}
}
} else {
fwrite(&emr_selectobject_fgbrush, sizeof (emr_selectobject_t), 1, emf_file);
// Rectangles
for (i = 0; i < rectangle_count; i++) {
fwrite(&rectangle[i], sizeof (emr_rectangle_t), 1, emf_file);
}
} }
// Hexagons // Hexagons

View File

@ -124,24 +124,69 @@ INTERNAL int pcx_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
for (column = 0; column < symbol->bitmap_width; column++) { for (column = 0; column < symbol->bitmap_width; column++) {
switch (colour) { switch (colour) {
case 0: case 0:
if (pixelbuf[(row * symbol->bitmap_width) + column] == '1') { switch(pixelbuf[(row * symbol->bitmap_width) + column]) {
rle_row[column] = fgred; case 'W': // White
} else { case 'M': // Magenta
rle_row[column] = bgred; case 'R': // Red
case 'Y': // Yellow
rle_row[column] = 255;
break;
case 'C': // Cyan
case 'B': // Blue
case 'G': // Green
case 'K': // Black
rle_row[column] = 0;
break;
case '1':
rle_row[column] = fgred;
break;
default:
rle_row[column] = bgred;
break;
} }
break; break;
case 1: case 1:
if (pixelbuf[(row * symbol->bitmap_width) + column] == '1') { switch(pixelbuf[(row * symbol->bitmap_width) + column]) {
rle_row[column] = fggrn; case 'W': // White
} else { case 'C': // Cyan
rle_row[column] = bggrn; case 'Y': // Yellow
case 'G': // Green
rle_row[column] = 255;
break;
case 'B': // Blue
case 'M': // Magenta
case 'R': // Red
case 'K': // Black
rle_row[column] = 0;
break;
case '1':
rle_row[column] = fggrn;
break;
default:
rle_row[column] = bggrn;
break;
} }
break; break;
case 2: case 2:
if (pixelbuf[(row * symbol->bitmap_width) + column] == '1') { switch(pixelbuf[(row * symbol->bitmap_width) + column]) {
rle_row[column] = fgblu; case 'W': // White
} else { case 'C': // Cyan
rle_row[column] = bgblu; case 'B': // Blue
case 'M': // Magenta
rle_row[column] = 255;
break;
case 'R': // Red
case 'Y': // Yellow
case 'G': // Green
case 'K': // Black
rle_row[column] = 0;
break;
case '1':
rle_row[column] = fgblu;
break;
default:
rle_row[column] = bgblu;
break;
} }
break; break;
} }

View File

@ -159,6 +159,46 @@ INTERNAL int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
for (column = 0; column < symbol->bitmap_width; column++) { for (column = 0; column < symbol->bitmap_width; column++) {
i = column * 3; i = column * 3;
switch (*(pixelbuf + (symbol->bitmap_width * row) + column)) { switch (*(pixelbuf + (symbol->bitmap_width * row) + column)) {
case 'W': // White
outdata[i] = 255;
outdata[i + 1] = 255;
outdata[i + 2] = 255;
break;
case 'C': // Cyan
outdata[i] = 0;
outdata[i + 1] = 255;
outdata[i + 2] = 255;
break;
case 'B': // Blue
outdata[i] = 0;
outdata[i + 1] = 0;
outdata[i + 2] = 255;
break;
case 'M': // Magenta
outdata[i] = 255;
outdata[i + 1] = 0;
outdata[i + 2] = 255;
break;
case 'R': // Red
outdata[i] = 255;
outdata[i + 1] = 0;
outdata[i + 2] = 0;
break;
case 'Y': // Yellow
outdata[i] = 255;
outdata[i + 1] = 255;
outdata[i + 2] = 0;
break;
case 'G': // Green
outdata[i] = 0;
outdata[i + 1] = 255;
outdata[i + 2] = 0;
break;
case 'K': // Black
outdata[i] = 0;
outdata[i + 1] = 0;
outdata[i + 2] = 0;
break;
case '1': case '1':
outdata[i] = fgred; outdata[i] = fgred;
outdata[i + 1] = fggrn; outdata[i + 1] = fggrn;

View File

@ -38,6 +38,69 @@
#include <math.h> #include <math.h>
#include "common.h" #include "common.h"
void colour_to_pscolor(int option, int colour, char* output) {
strcpy(output, "");
if ((option & CMYK_COLOUR) == 0) {
// Use RGB colour space
switch(colour) {
case 0: // White
strcat(output, "1.00 1.00 1.00");
break;
case 1: // Cyan
strcat(output, "0.00 1.00 1.00");
break;
case 2: // Blue
strcat(output, "0.00 0.00 1.00");
break;
case 3: // Magenta
strcat(output, "1.00 0.00 1.00");
break;
case 4: // Red
strcat(output, "1.00 0.00 0.00");
break;
case 5: // Yellow
strcat(output, "1.00 1.00 0.00");
break;
case 6: // Green
strcat(output, "0.00 1.00 0.00");
break;
default: // Black
strcat(output, "0.00 0.00 0.00");
break;
}
strcat(output, " setrgbcolor");
} else {
// Use CMYK colour space
switch(colour) {
case 0: // White
strcat(output, "0.00 0.00 0.00 0.00");
break;
case 1: // Cyan
strcat(output, "1.00 0.00 0.00 0.00");
break;
case 2: // Blue
strcat(output, "1.00 1.00 0.00 0.00");
break;
case 3: // Magenta
strcat(output, "0.00 1.00 0.00 0.00");
break;
case 4: // Red
strcat(output, "0.00 1.00 1.00 0.00");
break;
case 5: // Yellow
strcat(output, "0.00 0.00 1.00 0.00");
break;
case 6: // Green
strcat(output, "1.00 0.00 1.00 0.00");
break;
default: // Black
strcat(output, "0.00 0.00 0.00 1.00");
break;
}
strcat(output, " setcmykcolor");
}
}
INTERNAL int ps_plot(struct zint_symbol *symbol) { INTERNAL int ps_plot(struct zint_symbol *symbol) {
FILE *feps; FILE *feps;
int fgred, fggrn, fgblu, bgred, bggrn, bgblu; int fgred, fggrn, fgblu, bgred, bggrn, bgblu;
@ -47,6 +110,8 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) {
int error_number = 0; int error_number = 0;
float ax, ay, bx, by, cx, cy, dx, dy, ex, ey, fx, fy; float ax, ay, bx, by, cx, cy, dx, dy, ex, ey, fx, fy;
float radius; float radius;
int colour_index, colour_rect_counter;
char ps_color[30];
struct zint_vector_rect *rect; struct zint_vector_rect *rect;
struct zint_vector_hexagon *hex; struct zint_vector_hexagon *hex;
@ -153,18 +218,40 @@ INTERNAL int ps_plot(struct zint_symbol *symbol) {
fprintf(feps, "%.2f 0.00 TB 0.00 %.2f TR\n", symbol->vector->height, symbol->vector->width); fprintf(feps, "%.2f 0.00 TB 0.00 %.2f TR\n", symbol->vector->height, symbol->vector->width);
fprintf(feps, "TE\n"); fprintf(feps, "TE\n");
if ((symbol->output_options & CMYK_COLOUR) == 0) { if (symbol->symbology != BARCODE_ULTRA) {
fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink); if ((symbol->output_options & CMYK_COLOUR) == 0) {
} else { fprintf(feps, "%.2f %.2f %.2f setrgbcolor\n", red_ink, green_ink, blue_ink);
fprintf(feps, "%.2f %.2f %.2f %.2f setcmykcolor\n", cyan_ink, magenta_ink, yellow_ink, black_ink); } else {
fprintf(feps, "%.2f %.2f %.2f %.2f setcmykcolor\n", cyan_ink, magenta_ink, yellow_ink, black_ink);
}
} }
// Rectangles // Rectangles
rect = symbol->vector->rectangles; if (symbol->symbology == BARCODE_ULTRA) {
while (rect) { for (colour_index = 0; colour_index <= 7; colour_index++) {
fprintf(feps, "%.2f %.2f TB %.2f %.2f TR\n", rect->height, (symbol->vector->height - rect->y) - rect->height, rect->x, rect->width); colour_rect_counter = 0;
fprintf(feps, "TE\n"); rect = symbol->vector->rectangles;
rect = rect->next; while (rect) {
if (rect->colour == colour_index) {
if (colour_rect_counter == 0) {
//Set new colour
colour_to_pscolor(symbol->output_options, colour_index, ps_color);
fprintf(feps, "%s\n", ps_color);
}
colour_rect_counter++;
fprintf(feps, "%.2f %.2f TB %.2f %.2f TR\n", rect->height, (symbol->vector->height - rect->y) - rect->height, rect->x, rect->width);
fprintf(feps, "TE\n");
}
rect = rect->next;
}
}
} else {
rect = symbol->vector->rectangles;
while (rect) {
fprintf(feps, "%.2f %.2f TB %.2f %.2f TR\n", rect->height, (symbol->vector->height - rect->y) - rect->height, rect->x, rect->width);
fprintf(feps, "TE\n");
rect = rect->next;
}
} }
// Hexagons // Hexagons

View File

@ -47,6 +47,9 @@
#define SSET "0123456789ABCDEF" #define SSET "0123456789ABCDEF"
#define DEFAULT_INK '1'
#define DEFAULT_PAPER '0'
#ifndef NO_PNG #ifndef NO_PNG
INTERNAL int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf); INTERNAL int png_pixel_plot(struct zint_symbol *symbol, char *pixelbuf);
#endif /* NO_PNG */ #endif /* NO_PNG */
@ -55,6 +58,8 @@ INTERNAL int pcx_pixel_plot(struct zint_symbol *symbol, char *pixelbuf);
INTERNAL int gif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf); INTERNAL int gif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf);
INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf); INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf);
static const char ultra_colour[] = "WCBMRYGK";
static void buffer_plot(struct zint_symbol *symbol, char *pixelbuf) { static void buffer_plot(struct zint_symbol *symbol, char *pixelbuf) {
/* Place pixelbuffer into symbol */ /* Place pixelbuffer into symbol */
int fgred, fggrn, fgblu, bgred, bggrn, bgblu; int fgred, fggrn, fgblu, bgred, bggrn, bgblu;
@ -73,12 +78,52 @@ static void buffer_plot(struct zint_symbol *symbol, char *pixelbuf) {
for (column = 0; column < symbol->bitmap_width; column++) { for (column = 0; column < symbol->bitmap_width; column++) {
i = ((row * symbol->bitmap_width) + column) * 3; i = ((row * symbol->bitmap_width) + column) * 3;
switch (*(pixelbuf + (symbol->bitmap_width * row) + column)) { switch (*(pixelbuf + (symbol->bitmap_width * row) + column)) {
case '1': case 'W': // White
symbol->bitmap[i] = 255;
symbol->bitmap[i + 1] = 255;
symbol->bitmap[i + 2] = 255;
break;
case 'C': // Cyan
symbol->bitmap[i] = 0;
symbol->bitmap[i + 1] = 255;
symbol->bitmap[i + 2] = 255;
break;
case 'B': // Blue
symbol->bitmap[i] = 0;
symbol->bitmap[i + 1] = 0;
symbol->bitmap[i + 2] = 255;
break;
case 'M': // Magenta
symbol->bitmap[i] = 255;
symbol->bitmap[i + 1] = 0;
symbol->bitmap[i + 2] = 255;
break;
case 'R': // Red
symbol->bitmap[i] = 255;
symbol->bitmap[i + 1] = 0;
symbol->bitmap[i + 2] = 0;
break;
case 'Y': // Yellow
symbol->bitmap[i] = 255;
symbol->bitmap[i + 1] = 255;
symbol->bitmap[i + 2] = 0;
break;
case 'G': // Green
symbol->bitmap[i] = 0;
symbol->bitmap[i + 1] = 255;
symbol->bitmap[i + 2] = 0;
break;
case 'K': // Black
symbol->bitmap[i] = 0;
symbol->bitmap[i + 1] = 0;
symbol->bitmap[i + 2] = 0;
break;
case DEFAULT_INK:
symbol->bitmap[i] = fgred; symbol->bitmap[i] = fgred;
symbol->bitmap[i + 1] = fggrn; symbol->bitmap[i + 1] = fggrn;
symbol->bitmap[i + 2] = fgblu; symbol->bitmap[i + 2] = fgblu;
break; break;
default: default: // DEFAULT_PAPER
symbol->bitmap[i] = bgred; symbol->bitmap[i] = bgred;
symbol->bitmap[i + 1] = bggrn; symbol->bitmap[i + 1] = bggrn;
symbol->bitmap[i + 2] = bgblu; symbol->bitmap[i + 2] = bgblu;
@ -207,7 +252,7 @@ static int save_raster_image_to_file(struct zint_symbol *symbol, int image_heigh
return error_number; return error_number;
} }
static void draw_bar(char *pixelbuf, int xpos, int xlen, int ypos, int ylen, int image_width, int image_height) { static void draw_bar(char *pixelbuf, int xpos, int xlen, int ypos, int ylen, int image_width, int image_height, char fill) {
/* Draw a rectangle */ /* Draw a rectangle */
int i, j, png_ypos; int i, j, png_ypos;
@ -217,7 +262,7 @@ static void draw_bar(char *pixelbuf, int xpos, int xlen, int ypos, int ylen, int
for (i = (xpos); i < (xpos + xlen); i++) { for (i = (xpos); i < (xpos + xlen); i++) {
for (j = (png_ypos); j < (png_ypos + ylen); j++) { for (j = (png_ypos); j < (png_ypos + ylen); j++) {
*(pixelbuf + (image_width * j) + i) = '1'; *(pixelbuf + (image_width * j) + i) = fill;
} }
} }
} }
@ -246,13 +291,13 @@ static void draw_bullseye(char *pixelbuf, int image_width, int image_height, int
x = 16.0 * scaler; x = 16.0 * scaler;
y = 16.5 * scaler; y = 16.5 * scaler;
} }
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (4.571 * scaler) + 1, '1'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (4.571 * scaler) + 1, DEFAULT_INK);
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (3.779 * scaler) + 1, '0'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (3.779 * scaler) + 1, DEFAULT_PAPER);
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (2.988 * scaler) + 1, '1'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (2.988 * scaler) + 1, DEFAULT_INK);
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (2.196 * scaler) + 1, '0'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (2.196 * scaler) + 1, DEFAULT_PAPER);
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (1.394 * scaler) + 1, '1'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (1.394 * scaler) + 1, DEFAULT_INK);
draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (0.602 * scaler) + 1, '0'); draw_circle(pixelbuf, image_width, image_height, x + xoffset, y + yoffset, (0.602 * scaler) + 1, DEFAULT_PAPER);
} }
static void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon, int hexagon_size, int xposn, int yposn) { static void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon, int hexagon_size, int xposn, int yposn) {
@ -261,8 +306,8 @@ static void draw_hexagon(char *pixelbuf, int image_width, char *scaled_hexagon,
for (i = 0; i < hexagon_size; i++) { for (i = 0; i < hexagon_size; i++) {
for (j = 0; j < hexagon_size; j++) { for (j = 0; j < hexagon_size; j++) {
if (scaled_hexagon[(i * hexagon_size) + j] == '1') { if (scaled_hexagon[(i * hexagon_size) + j] == DEFAULT_INK) {
*(pixelbuf + (image_width * i) + (image_width * yposn) + xposn + j) = '1'; *(pixelbuf + (image_width * i) + (image_width * yposn) + xposn + j) = DEFAULT_INK;
} }
} }
} }
@ -313,7 +358,7 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo
for (y = 0; y < max_y; y++) { for (y = 0; y < max_y; y++) {
for (x = 0; x < max_x; x++) { for (x = 0; x < max_x; x++) {
if (small_font[(glyph_no * 9) + y] & (0x10 >> x)) { if (small_font[(glyph_no * 9) + y] & (0x10 >> x)) {
*(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = '1'; *(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = DEFAULT_INK;
} }
} }
} }
@ -339,11 +384,11 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo
int extra_dot = 0; int extra_dot = 0;
for (x = 0; x < 7; x++) { for (x = 0; x < 7; x++) {
if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) { if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) {
*pixelPtr = '1'; *pixelPtr = DEFAULT_INK;
extra_dot = 1; extra_dot = 1;
} else { } else {
if (extra_dot) { if (extra_dot) {
*pixelPtr = '1'; *pixelPtr = DEFAULT_INK;
} }
extra_dot = 0; extra_dot = 0;
@ -353,7 +398,7 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo
} }
if (extra_dot) { if (extra_dot) {
*pixelPtr = '1'; *pixelPtr = DEFAULT_INK;
} }
linePtr += image_width; linePtr += image_width;
@ -376,7 +421,7 @@ static void draw_letter(char *pixelbuf, unsigned char letter, int xposn, int ypo
for (y = 0; y < max_y; y++) { for (y = 0; y < max_y; y++) {
for (x = 0; x < 7; x++) { for (x = 0; x < 7; x++) {
if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) { if (ascii_font[(glyph_no * 14) + y] & (0x40 >> x)) {
*(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = '1'; *(pixelbuf + (y * image_width) + (yposn * image_width) + xposn + x) = DEFAULT_INK;
} }
} }
} }
@ -424,7 +469,7 @@ static void plot_hexline(char *scaled_hexagon, int hexagon_size, float start_x,
float this_x = start_x + ((float)i * inc_x); float this_x = start_x + ((float)i * inc_x);
float this_y = start_y + ((float)i * inc_y); float this_y = start_y + ((float)i * inc_y);
if (((this_x >= 0) && (this_x < hexagon_size)) && ((this_y >= 0) && (this_y < hexagon_size))) { if (((this_x >= 0) && (this_x < hexagon_size)) && ((this_y >= 0) && (this_y < hexagon_size))) {
scaled_hexagon[(hexagon_size * (int)this_y) + (int)this_x] = '1'; scaled_hexagon[(hexagon_size * (int)this_y) + (int)this_x] = DEFAULT_INK;
} }
} }
} }
@ -468,17 +513,17 @@ static void plot_hexagon(char *scaled_hexagon, int hexagon_size) {
/* Fill hexagon */ /* Fill hexagon */
for (line = 0; line < hexagon_size; line++) { for (line = 0; line < hexagon_size; line++) {
char ink = '0'; char ink = DEFAULT_PAPER;
for (i = 0; i < hexagon_size; i++) { for (i = 0; i < hexagon_size; i++) {
if (scaled_hexagon[(hexagon_size * line) + i] == '1') { if (scaled_hexagon[(hexagon_size * line) + i] == DEFAULT_INK) {
if (i < (hexagon_size / 2)) { if (i < (hexagon_size / 2)) {
ink = '1'; ink = DEFAULT_INK;
} else { } else {
ink = '0'; ink = DEFAULT_PAPER;
} }
} }
if (ink == '1') { if (ink == DEFAULT_INK) {
scaled_hexagon[(hexagon_size * line) + i] = ink; scaled_hexagon[(hexagon_size * line) + i] = ink;
} }
} }
@ -506,7 +551,7 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, in
return ZINT_ERROR_ENCODING_PROBLEM; return ZINT_ERROR_ENCODING_PROBLEM;
} else { } else {
for (i = 0; i < (image_width * image_height); i++) { for (i = 0; i < (image_width * image_height); i++) {
*(pixelbuf + i) = '0'; *(pixelbuf + i) = DEFAULT_PAPER;
} }
} }
@ -518,7 +563,7 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, in
return ZINT_ERROR_ENCODING_PROBLEM; return ZINT_ERROR_ENCODING_PROBLEM;
} else { } else {
for (i = 0; i < (hexagon_size * hexagon_size); i++) { for (i = 0; i < (hexagon_size * hexagon_size); i++) {
*(scaled_hexagon + i) = '0'; *(scaled_hexagon + i) = DEFAULT_PAPER;
} }
} }
@ -548,14 +593,14 @@ static int plot_raster_maxicode(struct zint_symbol *symbol, int rotate_angle, in
if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) { if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) {
/* boundary bars */ /* boundary bars */
draw_bar(pixelbuf, 0, image_width, 0, symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, 0, image_width, 0, symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 0, image_width, 300 + (symbol->border_width * 2), symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, 0, image_width, 300 + (symbol->border_width * 2), symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
} }
if (symbol->output_options & BARCODE_BOX) { if (symbol->output_options & BARCODE_BOX) {
/* side bars */ /* side bars */
draw_bar(pixelbuf, 0, symbol->border_width * 2, 0, image_height, image_width, image_height); draw_bar(pixelbuf, 0, symbol->border_width * 2, 0, image_height, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 300 + ((symbol->border_width + symbol->whitespace_width + symbol->whitespace_width) * 2), symbol->border_width * 2, 0, image_height, image_width, image_height); draw_bar(pixelbuf, 300 + ((symbol->border_width + symbol->whitespace_width + symbol->whitespace_width) * 2), symbol->border_width * 2, 0, image_height, image_width, image_height, DEFAULT_INK);
} }
error_number = save_raster_image_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle, data_type); error_number = save_raster_image_to_file(symbol, image_height, image_width, pixelbuf, rotate_angle, data_type);
@ -630,7 +675,7 @@ static int plot_raster_dotty(struct zint_symbol *symbol, int rotate_angle, int d
return ZINT_ERROR_ENCODING_PROBLEM; return ZINT_ERROR_ENCODING_PROBLEM;
} else { } else {
for (i = 0; i < (scale_width * scale_height); i++) { for (i = 0; i < (scale_width * scale_height); i++) {
*(scaled_pixelbuf + i) = '0'; *(scaled_pixelbuf + i) = DEFAULT_PAPER;
} }
} }
@ -642,7 +687,7 @@ static int plot_raster_dotty(struct zint_symbol *symbol, int rotate_angle, int d
(int) ((i + xoffset) * scaler) + (scaler / 2.0), (int) ((i + xoffset) * scaler) + (scaler / 2.0),
(int) ((r + yoffset) * scaler) + (scaler / 2.0), (int) ((r + yoffset) * scaler) + (scaler / 2.0),
(symbol->dot_size / 2.0) * scaler, (symbol->dot_size / 2.0) * scaler,
'1'); DEFAULT_INK);
} }
} }
} }
@ -796,7 +841,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
return ZINT_ERROR_ENCODING_PROBLEM; return ZINT_ERROR_ENCODING_PROBLEM;
} else { } else {
for (i = 0; i < (image_width * image_height); i++) { for (i = 0; i < (image_width * image_height); i++) {
*(pixelbuf + i) = '0'; *(pixelbuf + i) = DEFAULT_PAPER;
} }
} }
@ -815,6 +860,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
int plot_yposn; int plot_yposn;
int plot_height; int plot_height;
int this_row = symbol->rows - r - 1; /* invert r otherwise plots upside down */ int this_row = symbol->rows - r - 1; /* invert r otherwise plots upside down */
int module_fill;
row_posn += row_height; row_posn += row_height;
plot_yposn = next_yposn; plot_yposn = next_yposn;
if (symbol->row_height[this_row] == 0) { if (symbol->row_height[this_row] == 0) {
@ -826,30 +872,27 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
plot_height = next_yposn - plot_yposn; plot_height = next_yposn - plot_yposn;
i = 0; i = 0;
if (module_is_set(symbol, this_row, 0)) {
latch = 1;
} else {
latch = 0;
}
do { do {
module_fill = module_is_set(symbol, this_row, i);
block_width = 0; block_width = 0;
do { do {
block_width++; block_width++;
} while ((i + block_width < symbol->width) && module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i)); } while ((i + block_width < symbol->width) && module_is_set(symbol, this_row, i + block_width) == module_is_set(symbol, this_row, i));
if ((addon_latch == 0) && (r == 0) && (i > main_width)) { if ((addon_latch == 0) && (r == 0) && (i > main_width)) {
plot_height = (int) (row_height - 5.0); plot_height = (int) (row_height - 5.0);
plot_yposn = (int) (row_posn - 5.0); plot_yposn = (int) (row_posn - 5.0);
addon_text_posn = row_posn + row_height - 8.0; addon_text_posn = row_posn + row_height - 8.0;
addon_latch = 1; addon_latch = 1;
} }
if (latch == 1) { if (module_fill) {
/* a bar */ /* a bar */
draw_bar(pixelbuf, (i + xoffset) * 2, block_width * 2, plot_yposn * 2, plot_height * 2, image_width, image_height); if (symbol->symbology == BARCODE_ULTRA) {
latch = 0; draw_bar(pixelbuf, (i + xoffset) * 2, block_width * 2, plot_yposn * 2, plot_height * 2, image_width, image_height, ultra_colour[module_fill]);
} else { } else {
/* a space */ draw_bar(pixelbuf, (i + xoffset) * 2, block_width * 2, plot_yposn * 2, plot_height * 2, image_width, image_height, DEFAULT_INK);
latch = 1; }
} }
i += block_width; i += block_width;
@ -865,12 +908,12 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
case 8: /* EAN-8 */ case 8: /* EAN-8 */
case 11: case 11:
case 14: case 14:
draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (32 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (32 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (34 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (34 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (64 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (64 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (66 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (66 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
textpart[i] = local_text[i]; textpart[i] = local_text[i];
} }
@ -900,12 +943,12 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
case 13: /* EAN 13 */ case 13: /* EAN 13 */
case 16: case 16:
case 19: case 19:
draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (92 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (92 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (94 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (94 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
textpart[0] = local_text[0]; textpart[0] = local_text[0];
textpart[1] = '\0'; textpart[1] = '\0';
@ -951,7 +994,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
} while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i)); } while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i));
if (latch == 1) { if (latch == 1) {
/* a bar */ /* a bar */
draw_bar(pixelbuf, (i + xoffset - comp_offset) * 2, block_width * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (i + xoffset - comp_offset) * 2, block_width * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
latch = 0; latch = 0;
} else { } else {
/* a space */ /* a space */
@ -959,8 +1002,8 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
} }
i += block_width; i += block_width;
} while (i < 11 + comp_offset); } while (i < 11 + comp_offset);
draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
latch = 1; latch = 1;
i = 85 + comp_offset; i = 85 + comp_offset;
do { do {
@ -970,7 +1013,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
} while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i)); } while ((i + block_width < symbol->width) && module_is_set(symbol, symbol->rows - 1, i + block_width) == module_is_set(symbol, symbol->rows - 1, i));
if (latch == 1) { if (latch == 1) {
/* a bar */ /* a bar */
draw_bar(pixelbuf, (i + xoffset - comp_offset) * 2, block_width * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (i + xoffset - comp_offset) * 2, block_width * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
latch = 0; latch = 0;
} else { } else {
/* a space */ /* a space */
@ -1013,11 +1056,11 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
} else if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CHK) } else if ((symbol->symbology == BARCODE_UPCE) || (symbol->symbology == BARCODE_UPCE_CHK)
|| (symbol->symbology == BARCODE_UPCE_CC)) { || (symbol->symbology == BARCODE_UPCE_CC)) {
/* guard bar extensions and text formatting for UPCE */ /* guard bar extensions and text formatting for UPCE */
draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (0 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (2 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (46 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (48 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (50 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height); draw_bar(pixelbuf, (50 + xoffset) * 2, 1 * 2, (4 + (int) yoffset) * 2, 5 * 2, image_width, image_height, DEFAULT_INK);
textpart[0] = local_text[0]; textpart[0] = local_text[0];
textpart[1] = '\0'; textpart[1] = '\0';
@ -1053,23 +1096,23 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) { if ((symbol->output_options & BARCODE_BOX) || (symbol->output_options & BARCODE_BIND)) {
/* boundary bars */ /* boundary bars */
if (symbol->symbology != BARCODE_CODABLOCKF) { if (symbol->symbology != BARCODE_CODABLOCKF) {
draw_bar(pixelbuf, 0, (symbol->width + xoffset + xoffset) * 2, textoffset * 2, symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, 0, (symbol->width + xoffset + xoffset) * 2, textoffset * 2, symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, 0, (symbol->width + xoffset + xoffset) * 2, (textoffset + symbol->height + symbol->border_width) * 2, symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, 0, (symbol->width + xoffset + xoffset) * 2, (textoffset + symbol->height + symbol->border_width) * 2, symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
} else { } else {
draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, textoffset * 2, symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, textoffset * 2, symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, (textoffset + symbol->height + symbol->border_width) * 2, symbol->border_width * 2, image_width, image_height); draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, (textoffset + symbol->height + symbol->border_width) * 2, symbol->border_width * 2, image_width, image_height, DEFAULT_INK);
} }
if ((symbol->output_options & BARCODE_BIND) != 0) { if ((symbol->output_options & BARCODE_BIND) != 0) {
if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) { if ((symbol->rows > 1) && (is_stackable(symbol->symbology) == 1)) {
/* row binding */ /* row binding */
if (symbol->symbology != BARCODE_CODABLOCKF) { if (symbol->symbology != BARCODE_CODABLOCKF) {
for (r = 1; r < symbol->rows; r++) { for (r = 1; r < symbol->rows; r++) {
draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, ((r * row_height) + textoffset + yoffset - 1) * 2, 2 * 2, image_width, image_height); draw_bar(pixelbuf, xoffset * 2, symbol->width * 2, ((r * row_height) + textoffset + yoffset - 1) * 2, 2 * 2, image_width, image_height, DEFAULT_INK);
} }
} else { } else {
for (r = 1; r < symbol->rows; r++) { for (r = 1; r < symbol->rows; r++) {
/* Avoid 11-module start and stop chars */ /* Avoid 11-module start and stop chars */
draw_bar(pixelbuf, (xoffset + 11) * 2 , (symbol->width - 22) * 2, ((r * row_height) + textoffset + yoffset - 1) * 2, 2 * 2, image_width, image_height); draw_bar(pixelbuf, (xoffset + 11) * 2 , (symbol->width - 22) * 2, ((r * row_height) + textoffset + yoffset - 1) * 2, 2 * 2, image_width, image_height, DEFAULT_INK);
} }
} }
} }
@ -1078,8 +1121,8 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
if (symbol->output_options & BARCODE_BOX) { if (symbol->output_options & BARCODE_BOX) {
/* side bars */ /* side bars */
draw_bar(pixelbuf, 0, symbol->border_width * 2, textoffset * 2, (symbol->height + (2 * symbol->border_width)) * 2, image_width, image_height); draw_bar(pixelbuf, 0, symbol->border_width * 2, textoffset * 2, (symbol->height + (2 * symbol->border_width)) * 2, image_width, image_height, DEFAULT_INK);
draw_bar(pixelbuf, (symbol->width + xoffset + xoffset - symbol->border_width) * 2, symbol->border_width * 2, textoffset * 2, (symbol->height + (2 * symbol->border_width)) * 2, image_width, image_height); draw_bar(pixelbuf, (symbol->width + xoffset + xoffset - symbol->border_width) * 2, symbol->border_width * 2, textoffset * 2, (symbol->height + (2 * symbol->border_width)) * 2, image_width, image_height, DEFAULT_INK);
} }
/* Put the human readable text at the bottom */ /* Put the human readable text at the bottom */
@ -1102,7 +1145,7 @@ static int plot_raster_default(struct zint_symbol *symbol, int rotate_angle, int
return ZINT_ERROR_ENCODING_PROBLEM; return ZINT_ERROR_ENCODING_PROBLEM;
} else { } else {
for (i = 0; i < (scale_width * scale_height); i++) { for (i = 0; i < (scale_width * scale_height); i++) {
*(scaled_pixelbuf + i) = '0'; *(scaled_pixelbuf + i) = DEFAULT_PAPER;
} }
} }

View File

@ -41,6 +41,35 @@
#include "common.h" #include "common.h"
void pick_colour(int colour, char colour_code[]) {
switch(colour) {
case 0: // White
strcpy(colour_code, "ffffff");
break;
case 1: // Cyan
strcpy(colour_code, "00ffff");
break;
case 2: // Blue
strcpy(colour_code, "0000ff");
break;
case 3: // Magenta
strcpy(colour_code, "ff00ff");
break;
case 4: // Red
strcpy(colour_code, "ff0000");
break;
case 5: // Yellow
strcpy(colour_code, "ffff00");
break;
case 6: // Green
strcpy(colour_code, "00ff00");
break;
default: // Black
strcpy(colour_code, "000000");
break;
}
}
static void make_html_friendly(unsigned char * string, char * html_version) { static void make_html_friendly(unsigned char * string, char * html_version) {
/* Converts text to use HTML entity codes */ /* Converts text to use HTML entity codes */
@ -98,6 +127,8 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) {
struct zint_vector_circle *circle; struct zint_vector_circle *circle;
struct zint_vector_string *string; struct zint_vector_string *string;
char colour_code[7];
#ifdef _MSC_VER #ifdef _MSC_VER
char* html_string; char* html_string;
#endif #endif
@ -153,7 +184,12 @@ INTERNAL int svg_plot(struct zint_symbol *symbol) {
rect = symbol->vector->rectangles; rect = symbol->vector->rectangles;
while (rect) { while (rect) {
fprintf(fsvg, " <rect x=\"%.2f\" y=\"%.2f\" width=\"%.2f\" height=\"%.2f\" />\n", rect->x, rect->y, rect->width, rect->height); if (rect->colour == -1) {
fprintf(fsvg, " <rect x=\"%.2f\" y=\"%.2f\" width=\"%.2f\" height=\"%.2f\" />\n", rect->x, rect->y, rect->width, rect->height);
} else {
pick_colour(rect->colour, colour_code);
fprintf(fsvg, " <rect x=\"%.2f\" y=\"%.2f\" width=\"%.2f\" height=\"%.2f\" fill=\"#%s\" />\n", rect->x, rect->y, rect->width, rect->height, colour_code);
}
rect = rect->next; rect = rect->next;
} }

View File

@ -76,16 +76,16 @@ INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
if ((symbol->bitmap_height % rows_per_strip) != 0) { if ((symbol->bitmap_height % rows_per_strip) != 0) {
strip_count++; strip_count++;
} }
if (rows_per_strip > symbol->bitmap_height) { if (rows_per_strip > symbol->bitmap_height) {
rows_per_strip = symbol->bitmap_height; rows_per_strip = symbol->bitmap_height;
} }
if (strip_count == 1) { if (strip_count == 1) {
rows_per_strip = (rows_per_strip / 2) + 1; rows_per_strip = (rows_per_strip / 2) + 1;
strip_count++; strip_count++;
} }
#ifndef _MSC_VER #ifndef _MSC_VER
uint32_t strip_offset[strip_count]; uint32_t strip_offset[strip_count];
uint32_t strip_bytes[strip_count]; uint32_t strip_bytes[strip_count];
@ -140,24 +140,67 @@ INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
fwrite(&header, sizeof(tiff_header_t), 1, tif_file); fwrite(&header, sizeof(tiff_header_t), 1, tif_file);
free_memory += sizeof(tiff_ifd_t); free_memory += sizeof(tiff_ifd_t);
/* Pixel data */ /* Pixel data */
strip = 0; strip = 0;
bytes_put = 0; bytes_put = 0;
for (row = 0; row < symbol->bitmap_height; row++) { for (row = 0; row < symbol->bitmap_height; row++) {
for (column = 0; column < symbol->bitmap_width; column++) { for (column = 0; column < symbol->bitmap_width; column++) {
if (pixelbuf[(row * symbol->bitmap_width) + column] == '1') { switch(pixelbuf[(row * symbol->bitmap_width) + column]) {
putc(fgred, tif_file); case 'W': // White
putc(fggrn, tif_file); putc(255, tif_file);
putc(fgblu, tif_file); putc(255, tif_file);
} else { putc(255, tif_file);
putc(bgred, tif_file); break;
putc(bggrn, tif_file); case 'C': // Cyan
putc(bgblu, tif_file); putc(0, tif_file);
putc(255, tif_file);
putc(255, tif_file);
break;
case 'B': // Blue
putc(0, tif_file);
putc(0, tif_file);
putc(255, tif_file);
break;
case 'M': // Magenta
putc(255, tif_file);
putc(0, tif_file);
putc(255, tif_file);
break;
case 'R': // Red
putc(255, tif_file);
putc(0, tif_file);
putc(0, tif_file);
break;
case 'Y': // Yellow
putc(255, tif_file);
putc(255, tif_file);
putc(0, tif_file);
break;
case 'G': // Green
putc(0, tif_file);
putc(255, tif_file);
putc(0, tif_file);
break;
case 'K': // Black
putc(0, tif_file);
putc(0, tif_file);
putc(0, tif_file);
break;
case '1':
putc(fgred, tif_file);
putc(fggrn, tif_file);
putc(fgblu, tif_file);
break;
default:
putc(bgred, tif_file);
putc(bggrn, tif_file);
putc(bgblu, tif_file);
break;
} }
bytes_put += 3; bytes_put += 3;
} }
if ((bytes_put + 3) >= strip_bytes[strip]) { if ((bytes_put + 3) >= strip_bytes[strip]) {
// End of strip, pad if strip length is odd // End of strip, pad if strip length is odd
if (strip_bytes[strip] % 2 == 1) { if (strip_bytes[strip] % 2 == 1) {

File diff suppressed because it is too large Load Diff

View File

@ -251,10 +251,9 @@ static void vector_reduce_rectangles(struct zint_symbol *symbol) {
while (rect) { while (rect) {
prev = rect; prev = rect;
target = prev->next; target = prev->next;
while (target) { while (target) {
if ((rect->x == target->x) && (rect->width == target->width) && ((rect->y + rect->height) == target->y) && (rect->colour == target->colour)) {
if ((rect->x == target->x) && (rect->width == target->width) && ((rect->y + rect->height) == target->y)) {
rect->height += target->height; rect->height += target->height;
prev->next = target->next; prev->next = target->next;
free(target); free(target);
@ -338,7 +337,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
addon_text_posn = 0.0; addon_text_posn = 0.0;
rect_count = 0; rect_count = 0;
last_row_start = 0; last_row_start = 0;
/* /*
* Determine if there will be any addon texts and text height * Determine if there will be any addon texts and text height
*/ */
@ -483,20 +482,18 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
addon_text_posn = row_posn + 8.0f; addon_text_posn = row_posn + 8.0f;
addon_latch = 1; addon_latch = 1;
} }
if (latch == 1) { if (module_is_set(symbol, this_row, i)) {
/* a bar */ /* a bar or colour block */
if (addon_latch == 0) { if (addon_latch == 0) {
rectangle = vector_plot_create_rect((float)(i + xoffset), row_posn, (float)block_width, row_height); rectangle = vector_plot_create_rect((float)(i + xoffset), row_posn, (float)block_width, row_height);
if (symbol->symbology == BARCODE_ULTRA) {
rectangle->colour = module_is_set(symbol, this_row, i);
}
} else { } else {
rectangle = vector_plot_create_rect((float)(i + xoffset), row_posn + 10.0f, (float)block_width, row_height - 5.0f); rectangle = vector_plot_create_rect((float)(i + xoffset), row_posn + 10.0f, (float)block_width, row_height - 5.0f);
} }
latch = 0;
vector_plot_add_rect(symbol, rectangle, &last_rectangle); vector_plot_add_rect(symbol, rectangle, &last_rectangle);
rect_count++; rect_count++;
} else {
/* a space */
latch = 1;
} }
i += block_width; i += block_width;
@ -529,7 +526,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
for (i = 0; i < symbol->width; i++) { for (i = 0; i < symbol->width; i++) {
if (module_is_set(symbol, r, i)) { if (module_is_set(symbol, r, i)) {
//struct zint_vector_hexagon *hexagon = vector_plot_create_hexagon(((i * 0.88) + ((r & 1) ? 1.76 : 1.32)), ((r * 0.76) + 0.76), symbol->dot_size); //struct zint_vector_hexagon *hexagon = vector_plot_create_hexagon(((i * 0.88) + ((r & 1) ? 1.76 : 1.32)), ((r * 0.76) + 0.76), symbol->dot_size);
struct zint_vector_hexagon *hexagon = vector_plot_create_hexagon(((i * 1.23f) + 0.615f + ((r & 1) ? 0.615f : 0.0f)) + xoffset, struct zint_vector_hexagon *hexagon = vector_plot_create_hexagon(((i * 1.23f) + 0.615f + ((r & 1) ? 0.615f : 0.0f)) + xoffset,
((r * 1.067f) + 0.715f) + yoffset, symbol->dot_size); ((r * 1.067f) + 0.715f) + yoffset, symbol->dot_size);
vector_plot_add_hexagon(symbol, hexagon, &last_hexagon); vector_plot_add_hexagon(symbol, hexagon, &last_hexagon);
} }
@ -565,7 +562,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
i++; i++;
} }
} }
if (upceanflag == 8) { if (upceanflag == 8) {
i = 0; i = 0;
for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) { for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) {
@ -582,7 +579,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
i++; i++;
} }
} }
if (upceanflag == 12) { if (upceanflag == 12) {
i = 0; i = 0;
for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) { for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) {
@ -603,7 +600,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
i++; i++;
} }
} }
if (upceanflag == 13) { if (upceanflag == 13) {
i = 0; i = 0;
for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) { for (rect = symbol->vector->rectangles; rect != NULL; rect = rect->next) {
@ -620,7 +617,7 @@ INTERNAL int plot_vector(struct zint_symbol *symbol, int rotate_angle, int file_
i++; i++;
} }
} }
/* Add the text */ /* Add the text */
if (!hide_text) { if (!hide_text) {

View File

@ -270,6 +270,9 @@ extern "C" {
// QR, Han Xin, Grid Matrix specific options (option_3) // QR, Han Xin, Grid Matrix specific options (option_3)
#define ZINT_FULL_MULTIBYTE 200 #define ZINT_FULL_MULTIBYTE 200
// Ultracode specific option
#define ULTRA_COMPRESSION 128
// Warning and error conditions // Warning and error conditions
#define ZINT_WARN_INVALID_OPTION 2 #define ZINT_WARN_INVALID_OPTION 2
#define ZINT_WARN_USES_ECI 3 #define ZINT_WARN_USES_ECI 3

View File

@ -1,7 +1,7 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2008 by BogDan Vatra * * Copyright (C) 2008 by BogDan Vatra *
* bogdan@licentia.eu * * bogdan@licentia.eu *
* Copyright (C) 2010-2017 Robin Stuart * * Copyright (C) 2010-2020 Robin Stuart *
* * * *
* This program is free software: you can redistribute it and/or modify * * This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -316,7 +316,36 @@ namespace Zint {
// Plot rectangles // Plot rectangles
rect = m_zintSymbol->vector->rectangles; rect = m_zintSymbol->vector->rectangles;
while (rect) { while (rect) {
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(m_fgColor)); if (rect->colour == -1) {
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(m_fgColor));
} else {
switch(rect->colour) {
case 0: // White
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::white));
break;
case 1: // Cyan
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::cyan));
break;
case 2: // Blue
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::blue));
break;
case 3: // Magenta
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::magenta));
break;
case 4: // Red
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::red));
break;
case 5: // Yellow
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::yellow));
break;
case 6: // Green
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::green));
break;
default:
painter.fillRect(rect->x, rect->y, rect->width, rect->height, QBrush(Qt::black));
break;
}
}
rect = rect->next; rect = rect->next;
} }

View File

@ -37,37 +37,38 @@
/* Print list of supported symbologies */ /* Print list of supported symbologies */
void types(void) { void types(void) {
printf( " 1: Code 11 51: Pharma One-Track 92: Aztec Code\n" printf( " 1: Code 11 52: PZN 97: Micro QR Code\n"
" 2: Standard 2of5 52: PZN 93: DAFT Code\n" " 2: Standard 2of5 53: Pharma Two-Track 98: HIBC Code 128\n"
" 3: Interleaved 2of5 53: Pharma Two-Track 97: Micro QR Code\n" " 3: Interleaved 2of5 55: PDF417 99: HIBC Code 39\n"
" 4: IATA 2of5 55: PDF417 98: HIBC Code 128\n" " 4: IATA 2of5 56: PDF417 Trunc 102: HIBC Data Matrix\n"
" 6: Data Logic 56: PDF417 Trunc 99: HIBC Code 39\n" " 6: Data Logic 57: Maxicode 104: HIBC QR Code\n"
" 7: Industrial 2of5 57: Maxicode 102: HIBC Data Matrix\n" " 7: Industrial 2of5 58: QR Code 106: HIBC PDF417\n"
" 8: Code 39 58: QR Code 104: HIBC QR Code\n" " 8: Code 39 60: Code 128-B 108: HIBC MicroPDF417\n"
" 9: Extended Code 39 60: Code 128-B 106: HIBC PDF417\n" " 9: Extended Code 39 63: AP Standard Customer 110: HIBC Codablock-F\n"
"13: EAN 63: AP Standard Customer 108: HIBC MicroPDF417\n" "13: EAN 66: AP Reply Paid 112: HIBC Aztec Code\n"
"14: EAN + Check 66: AP Reply Paid 110: HIBC Codablock-F\n" "14: EAN + Check 67: AP Routing 115: DotCode\n"
"16: GS1-128 67: AP Routing 112: HIBC Aztec Code\n" "16: GS1-128 68: AP Redirection 116: Han Xin Code\n"
"18: Codabar 68: AP Redirection 115: DotCode\n" "18: Codabar 69: ISBN 121: RM Mailmark\n"
"20: Code 128 69: ISBN 116: Han Xin Code\n" "20: Code 128 70: RM4SCC 128: Aztec Runes\n"
"21: Leitcode 70: RM4SCC 121: RM Mailmark\n" "21: Leitcode 71: Data Matrix 129: Code 32\n"
"22: Identcode 71: Data Matrix 128: Aztec Runes\n" "22: Identcode 72: EAN-14 130: Comp EAN\n"
"23: Code 16k 72: EAN-14 129: Code 32\n" "23: Code 16k 73: VIN (North America) 131: Comp GS1-128\n"
"24: Code 49 73: VIN (North America) 130: Comp EAN\n" "24: Code 49 74: Codablock-F 132: Comp DataBar Omni\n"
"25: Code 93 74: Codablock-F 131: Comp GS1-128\n" "25: Code 93 75: NVE-18 133: Comp DataBar Ltd\n"
"28: Flattermarken 75: NVE-18 132: Comp DataBar Omni\n" "28: Flattermarken 76: Japanese Post 134: Comp DataBar ExpOm\n"
"29: GS1 DataBar Omni 76: Japanese Post 133: Comp DataBar Ltd\n" "29: GS1 DataBar Omni 77: Korea Post 135: Comp UPC-A\n"
"30: GS1 DataBar Ltd 77: Korea Post 134: Comp DataBar ExpOm\n" "30: GS1 DataBar Ltd 79: GS1 DataBar Stack 136: Comp UPC-E\n"
"31: GS1 DataBar ExpOm 79: GS1 DataBar Stack 135: Comp UPC-A\n" "31: GS1 DataBar ExpOm 80: GS1 DataBar Stack Omni 137: Comp DataBar Stack\n"
"32: Telepen Alpha 80: GS1 DataBar Stack Omni 136: Comp UPC-E\n" "32: Telepen Alpha 81: GS1 DataBar ESO 138: Comp DataBar Stack Omni\n"
"34: UPC-A 81: GS1 DataBar ESO 137: Comp DataBar Stack\n" "34: UPC-A 82: Planet 1139: Comp DataBar ESO\n"
"35: UPC-A + Check 82: Planet 138: Comp DataBar Stack Omni\n" "35: UPC-A + Check 84: MicroPDF 140: Channel Code\n"
"37: UPC-E 84: MicroPDF 139: Comp DataBar ESO\n" "37: UPC-E 85: USPS OneCode 141: Code One\n"
"38: UPC-E + Check 85: USPS OneCode 140: Channel Code\n" "38: UPC-E + Check 86: UK Plessey 142: Grid Matrix\n"
"40: Postnet 86: UK Plessey 141: Code One\n" "40: Postnet 87: Telepen Numeric 143: UPNQR\n"
"47: MSI Plessey 87: Telepen Numeric 142: Grid Matrix\n" "47: MSI Plessey 89: ITF-14 144: Ultracode\n"
"49: FIM 89: ITF-14 143: UPNQR\n" "49: FIM 90: KIX Code 145: rMQR\n"
"50: Logmars 90: KIX Code 145: rMQR\n" "50: Logmars 92: Aztec Code\n"
"51: Pharma One-Track 93: DAFT Code\n"
); );
} }

View File

@ -1,6 +1,6 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> * * Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
* Copyright (C) 2009-2019 by Robin Stuart <rstuart114@gmail.com> * * Copyright (C) 2009-2020 by Robin Stuart <rstuart114@gmail.com> *
* * * *
* This program is free software: you can redistribute it and/or modify * * This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -107,6 +107,7 @@ MainWindow::MainWindow(QWidget* parent, Qt::WindowFlags fl)
"Telepen", "Telepen",
"Telepen Numeric", "Telepen Numeric",
"UK Plessey", "UK Plessey",
"Ultracode",
"UPNQR", "UPNQR",
"Universal Product Code (UPC-A)", "Universal Product Code (UPC-A)",
"Universal Product Code (UPC-E)", "Universal Product Code (UPC-E)",

View File

@ -1,6 +1,6 @@
/*************************************************************************** /***************************************************************************
* Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> * * Copyright (C) 2008 by BogDan Vatra <bogdan@licentia.eu> *
* Copyright (C) 2009-2019 by Robin Stuart <rstuart114@gmail.com> * * Copyright (C) 2009-2020 by Robin Stuart <rstuart114@gmail.com> *
* * * *
* This program is free software: you can redistribute it and/or modify * * This program is free software: you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by * * it under the terms of the GNU General Public License as published by *
@ -102,6 +102,7 @@ public:
TELEPEN = 32, TELEPEN = 32,
TELEPEN_NUM = 87, TELEPEN_NUM = 87,
PLESSEY = 86, PLESSEY = 86,
ULTRA = 144,
UPNQR = 143, UPNQR = 143,
UPCA = 34, UPCA = 34,
UPCE = 37, UPCE = 37,