Complex Arts · Bitmap Tool
--------------------------
File   : 
Pixels : 
Width  : 
Height : 
Bytes  : 
Jump   : 
Rows   :   
This utility converts 1-bit .pbm type P4 files to c arrays.  An array is created by horizontally
scanning the .pbm images and successively writing pixel values to the array bits. For example,
a 3 x 4 pixel letter 'A' is converted as follows:

.X.   Bitmap           Binary                  Hexadecimal     C Array
X.X   010 101 111 101  0b01010111 0b11010000   0x57, 0xD0      uint8_t A[ 2 ] = { 0x57, 0xD0 };
XXX                      5   7      D   0
X.X
Drop Bitmap File Here...
// Example Drawing Function
//----------------------------------------------------------------------------
// draws a bitmap of size ( width, height ) at coordinates ( x, y )
//
// char A[ 2 ] = { 0x57, 0xD0 };
// Bitmap( 0, 0, 3, 4, A );
//

void Bitmap( int x, int y, int width, int height, const char* bitmap )
{
    int pix = width * height + 1;
    int max = x + width;
    int bit = 7;

    while( --pix )
    {
        Pixel( x, y, *bitmap & ( 1 << bit ) ? 1 : 0 );

        if( --bit == -1 )
        {
            bit = 7;
            ++bitmap;
        }

        if( ++x == max )
        {
            x -= width;
            ++y;
        }
    }
}            

...try it with ca62x46.pbm or caRows.pbm