Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- for(i=0; i<IMG_SIZE; i++){ //En cada pasada estoy leyendo 4 pixeles.
- fread((int *)&buff,1,1,input); //Leo un byte
- printf("buff vale: %x - ",buff);
- const char *byteChar = (char *)malloc(9);
- byteChar = bytetobin(buff);
- int j;
- for (j=0; j<8; j+=2){
- switch (byteChar[j]){
- case '0':
- if(byteChar[j+1] == '0')
- putColor(output,grises->white);
- else
- putColor(output,grises->lightGrey);
- break;
- case '1':
- if(byteChar[j+1] == '0')
- putColor(output,grises->darkGrey);
- else{
- putColor(output,grises->black);
- break;
- }
- }
- printf("posición %d\n",ftell(input));
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement