mirror of
https://git.code.sf.net/p/zint/code
synced 2025-05-09 13:41:59 -04:00
Merge branch Ultra
This commit is contained in:
commit
0d26948baa
16 changed files with 1671 additions and 192 deletions
|
@ -76,16 +76,16 @@ INTERNAL int tif_pixel_plot(struct zint_symbol *symbol, char *pixelbuf) {
|
|||
if ((symbol->bitmap_height % rows_per_strip) != 0) {
|
||||
strip_count++;
|
||||
}
|
||||
|
||||
|
||||
if (rows_per_strip > symbol->bitmap_height) {
|
||||
rows_per_strip = symbol->bitmap_height;
|
||||
}
|
||||
|
||||
|
||||
if (strip_count == 1) {
|
||||
rows_per_strip = (rows_per_strip / 2) + 1;
|
||||
strip_count++;
|
||||
}
|
||||
|
||||
|
||||
#ifndef _MSC_VER
|
||||
uint32_t strip_offset[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);
|
||||
free_memory += sizeof(tiff_ifd_t);
|
||||
|
||||
|
||||
/* Pixel data */
|
||||
strip = 0;
|
||||
bytes_put = 0;
|
||||
for (row = 0; row < symbol->bitmap_height; row++) {
|
||||
for (column = 0; column < symbol->bitmap_width; column++) {
|
||||
if (pixelbuf[(row * symbol->bitmap_width) + column] == '1') {
|
||||
putc(fgred, tif_file);
|
||||
putc(fggrn, tif_file);
|
||||
putc(fgblu, tif_file);
|
||||
} else {
|
||||
putc(bgred, tif_file);
|
||||
putc(bggrn, tif_file);
|
||||
putc(bgblu, tif_file);
|
||||
switch(pixelbuf[(row * symbol->bitmap_width) + column]) {
|
||||
case 'W': // White
|
||||
putc(255, tif_file);
|
||||
putc(255, tif_file);
|
||||
putc(255, tif_file);
|
||||
break;
|
||||
case 'C': // Cyan
|
||||
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;
|
||||
}
|
||||
|
||||
|
||||
if ((bytes_put + 3) >= strip_bytes[strip]) {
|
||||
// End of strip, pad if strip length is odd
|
||||
if (strip_bytes[strip] % 2 == 1) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue