Hash :
32dc40a2
Author :
Date :
2009-05-20T17:19:07
Mask module for Micro QR Code has been added.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48
#include <stdio.h>
#include <string.h>
#include "common.h"
#include "../mmask.h"
#include "../mqrspec.h"
void print_mask(int mask)
{
const int w = 8;
unsigned char frame[w * w], *masked, *p;
int x, y;
memset(frame, 0, w * w);
masked = MMask_makeMaskedFrame(w, frame, mask);
p = masked;
for(y=0; y<w; y++) {
for(x=0; x<w; x++) {
if(*p & 1) {
printf("#");
} else {
printf("_");
}
p++;
}
printf("\n");
}
printf("\n");
free(masked);
}
void print_masks(void)
{
int i;
for(i=0; i<4; i++) {
print_mask(i);
}
}
int main(void)
{
print_masks();
report();
return 0;
}