Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int y_t = cabe_imagem->altura;
- for(int y=0; y < cabe_imagem->altura;y++)
- {
- for(int x = 0; x< cabe_imagem->largura; x++)
- {
- unsigned char r, g, b;
- int cor = cores[bmp[y*(cabe_imagem->largura + 1)+x]];
- //obtendo valor r
- r = ((cor & 0xFF0000) >> 16);
- //obtendo valor g
- g = ((cor & 0xFF00) >> 8);
- //obtendo valor b
- b = ( cor & 0xFF) ;
- //motando nΓΊmero com 2 bits para cada canal
- unsigned char val = ((r/85) << 4) + ((g/85) << 2) + (b/85);
- video[x+y_t*320]= val ;
- }
- y_t--;
- }
Add Comment
Please, Sign In to add comment