Skip to content

Commit

Permalink
byte-wise instead of decomposing through arithmetic
Browse files Browse the repository at this point in the history
  • Loading branch information
umarcor committed Apr 30, 2020
1 parent b10a8b2 commit cc7e02d
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions vhpidirect/arrays/matrices/framebuffer/caux.c
Original file line number Diff line number Diff line change
Expand Up @@ -9,15 +9,15 @@ void sim_init(uint32_t width, uint32_t height) {
}

void integer_to_raw24(int32_t *ptr, uint32_t width, uint32_t height, uint8_t *raw24) {
int x,y;
int x, y;
uint32_t *q = ptr;
uint8_t *j = raw24;
for ( y=0 ; y < height ; y++ ) {
for ( x=0 ; x < width ; x++ ) {
int k = *q++;
*(j++) = (k/65536) %256;
*(j++) = (k/256) %256;
*(j++) = k %256;
for ( y = 0 ; y < height ; y++ ) {
for ( x = 0 ; x < width ; x++ ) {
uint8_t *u = (uint8_t*) q++;
*(j++) = u[2];
*(j++) = u[1];
*(j++) = u[0];
}
}
}
Expand Down

0 comments on commit cc7e02d

Please sign in to comment.