1
0
mirror of https://github.com/gryf/wmaker.git synced 2025-12-19 04:20:27 +01:00

ooptimized code for 8bpp/PseudoColor

This commit is contained in:
kojima
2000-01-19 17:47:35 +00:00
parent ec5f3a294e
commit 0780ab82fe
6 changed files with 331 additions and 144 deletions

View File

@@ -250,13 +250,13 @@ renderDGradient(unsigned width, unsigned height, int r0, int g0, int b0,
return NULL;
}
a = (((width - 1)<<16) / (height - 1)) * 3;
a = (((width - 1)<<16) / (height - 1))*3;
width *= 3;
/* copy the first line to the other lines with corresponding offset */
for (i=0, j=0, offset = 0; i<height; i++, j+= width) {
offset += a;
memcpy(&(image->data[j]), &(tmp->data[(offset>>16)]), width);
memcpy(&(image->data[j]), &(tmp->data[(offset>>16)]), width);
}
RDestroyImage(tmp);
return image;