1
0
mirror of https://git.code.sf.net/p/zint/code synced 2026-01-27 05:45:58 +00:00

Disable GS1 in QR Code (to allow building against official qrencode) and compress bullseye in Maxicode to save memory.

This commit is contained in:
hooper114
2009-09-05 06:48:10 +00:00
parent 2ab4cb712b
commit 467433f0d0
4 changed files with 130 additions and 104 deletions

View File

@@ -302,6 +302,27 @@ void draw_bar(char *pixelbuf, int xpos, int xlen, int ypos, int ylen, int image_
}
}
int bullseye_pixel(int row, int col) {
int block_val, block_pos, return_val;
block_val = bullseye_compressed[(row * 12) + (col / 8)];
return_val = 0;
block_pos = col % 8;
switch(block_pos) {
case 0: if((block_val & 0x80) != 0) { return_val = 1; } break;
case 1: if((block_val & 0x40) != 0) { return_val = 1; } break;
case 2: if((block_val & 0x20) != 0) { return_val = 1; } break;
case 3: if((block_val & 0x10) != 0) { return_val = 1; } break;
case 4: if((block_val & 0x08) != 0) { return_val = 1; } break;
case 5: if((block_val & 0x04) != 0) { return_val = 1; } break;
case 6: if((block_val & 0x02) != 0) { return_val = 1; } break;
case 7: if((block_val & 0x01) != 0) { return_val = 1; } break;
}
return return_val;
}
void draw_bullseye(char *pixelbuf, int image_width, int xoffset, int yoffset)
{
/* Central bullseye in Maxicode symbols */
@@ -309,7 +330,8 @@ void draw_bullseye(char *pixelbuf, int image_width, int xoffset, int yoffset)
for(j = 103; j < 196; j++) {
for(i = 0; i < 93; i++) {
if(bullseye[(((j - 103) * 93) + i)] == 1) {
if(bullseye_pixel(j - 103, i)) {
/* if(bullseye[(((j - 103) * 93) + i)] == 1) { */
*(pixelbuf + (image_width * j) + (image_width * yoffset) + i + 99 + xoffset) = '1';
}
}