Esempio n. 1
0
void
prbm(BITMAT const *bmp)
{
    int r, c, nrows = bitmat_rows(bmp), ncols = bitmat_cols(bmp);

    printf("col>");
    for (c = 0; c < ncols; ++c) {
        if (!(c & 7)) putchar(' ');
        putchar('0' + c % 10);
    }
    putchar('\n');

    for (r = 0; r < nrows; ++r) {
        printf("%3d ", r);
        for (c = 0; c < ncols; ++c) {
            if (!(c & 7)) putchar(' ');
            putchar("-#"[bitmat_get(bmp, r, c)]);
        }

        // HEX format:
        char const *data = bitmat_rowval(bmp, r);
        for (c = 0; c < ncols; c += 8)
            printf(" %2.2X", 255 & data[c/8]);
        putchar('\n');
    }
}
Esempio n. 2
0
void
prbm(BITMAT const*bmp)
{
    int r, c, nrows = bitmat_rows(bmp), ncols = bitmat_cols(bmp);

    for (r = 0; r < nrows; ++r) {
        printf("%3d ", r);
        for (c = 0; c < ncols; ++c) {
            if (!(c & 7)) putchar(' ');
            putchar("-#"[bitmat_get(bmp, r, c)]);
        }
        putchar('\n');
    }
}