#include <stdio.h>


#define guint unsigned int
#define guint8 unsigned char

#include "letters_cropped.c"


#define GRAPHIC_WIDTH gimp_image.width
#define GRAPHIC_HEIGHT gimp_image.height

int main()
{
    
    guint x_index = 0;
    guint y_index = 0;
    char * data_ptr = gimp_image.pixel_data;
    char color_found = 0;
    //printf("Leading text "BYTE_TO_BINARY_PATTERN, BYTE_TO_BINARY(byte));
    
    while(y_index<GRAPHIC_HEIGHT)
    {
        color_found = 0;
        if(x_index == 0)
        {
            printf("0b");
        }
        
        unsigned char cur_row = 0;
        if (data_ptr[3] == 0)
        {
            printf("0");         
            color_found = 1;
        }
        else
        {
            if(data_ptr[0] != 0 || data_ptr[1] != 0 || data_ptr[2] != 0)
            {
                printf("1"); 
                color_found = 1;
                
            } else 
            {
                    printf("0");
                    color_found = 1;
            }
        }
        if(!color_found)
        {
                printf("color not found: (%02hhx,%02hhx,%02hhx) at x/y: %d,%d\n", data_ptr[0],data_ptr[1],data_ptr[2],x_index,y_index);
                break;
        } 
        data_ptr +=4;
        x_index++;
        if(x_index==GRAPHIC_WIDTH)
        {
            x_index = 0;
            y_index++;
            printf("\n");
        }      
        
    }
	//    printf("expected_size: %d\n",y_index*4*2001);
}

