Remove 15bpp surface operations

These were used only with X11 backend.
This commit is contained in:
kichikuou
2020-10-04 16:01:48 +09:00
parent 379ca744d5
commit ebb249cd47
25 changed files with 3 additions and 495 deletions
-132
View File
@@ -134,132 +134,6 @@ static void image_fillRectangle8(agsurface_t *dib, int x, int y, int w, int h, i
}
}
/******************************************************************************/
/* private methods image操作 15bpp */
/******************************************************************************/
static void image_copy_from_alpha15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) {
int x, y;
BYTE *yls;
WORD *yld;
switch(flag) {
case TO_16H:
for (y = 0; y < h; y++) {
yls = (BYTE *)(sdata + y * dib->width);
yld = (WORD *)(ddata + y * dib->bytes_per_line);
for (x = 0; x < w; x++) {
/* *yld = */
yld++; yls++;
}
}
break;
case TO_16L:
for (y = 0; y < h; y++) {
yls = (BYTE *)(sdata + y * dib->width);
yld = (WORD *)(ddata + y * dib->bytes_per_line);
for (x = 0; x < w; x++) {
/* *yld = (WORD)(*yls) | (*yld & 0xff00); */
yld++; yls++;
}
}
break;
case TO_24R:
for (y = 0; y < h; y++) {
yls = (BYTE *)(sdata + y * dib->width);
yld = (WORD *)(ddata + y * dib->bytes_per_line);
for (x = 0; x < w; x++) {
*yld = PIX15(*yls, PIXG15(*yld), PIXB15(*yld));
yld++; yls++;
}
}
break;
case TO_24G:
for (y = 0; y < h; y++) {
yls = (BYTE *)(sdata + y * dib->width);
yld = (WORD *)(ddata + y * dib->bytes_per_line);
for (x = 0; x < w; x++) {
*yld = PIX15(PIXR15(*yls), *yls, PIXB15(*yld));
yld++; yls++;
}
}
break;
case TO_24B:
for (y = 0; y < h; y++) {
yls = (BYTE *)(sdata + y * dib->width);
yld = (WORD *)(ddata + y * dib->bytes_per_line);
for (x = 0; x < w; x++) {
*yld = PIX15(PIXR15(*yld), PIXG15(*yld), *yls);
yld++; yls++;
}
}
break;
default:
break;
}
}
static void image_copy_to_alpha15(agsurface_t *dib, BYTE *sdata, BYTE *ddata, int w, int h, ALPHA_DIB_COPY_TYPE flag) {
int x, y;
BYTE *yld;
WORD *yls;
switch(flag) {
case FROM_16H:
for (y = 0; y < h; y++) {
yls = (WORD *)(sdata + y * dib->bytes_per_line);
yld = (BYTE *)(ddata + y * dib->width);
for (x = 0; x < w; x++) {
*yld = (BYTE)(PIX16(PIXR15(*yls), PIXG15(*yls), PIXB15(*yls)) >> 8);
yld++; yls++;
}
}
break;
case FROM_16L:
for (y = 0; y < h; y++) {
yls = (WORD *)(sdata + y * dib->bytes_per_line);
yld = (BYTE *)(ddata + y * dib->width);
for (x = 0; x < w; x++) {
*yld = (BYTE)(PIX16(PIXR15(*yls), PIXG15(*yls), PIXB15(*yls)));
yld++; yls++;
}
}
break;
case FROM_24R:
for (y = 0; y < h; y++) {
yls = (WORD *)(sdata + y * dib->bytes_per_line);
yld = (BYTE *)(ddata + y * dib->width);
for (x = 0; x < w; x++) {
*yld = (BYTE)PIXR15(*yls);
yld++; yls++;
}
}
break;
case FROM_24G:
for (y = 0; y < h; y++) {
yls = (WORD *)(sdata + y * dib->bytes_per_line);
yld = (BYTE *)(ddata + y * dib->width);
for (x = 0; x < w; x++) {
*yld = (BYTE)PIXG15(*yls);
yld++; yls++;
}
}
break;
case FROM_24B:
for (y = 0; y < h; y++) {
yls = (WORD *)(sdata + y * dib->bytes_per_line);
yld = (BYTE *)(ddata + y * dib->width);
for (x = 0; x < w; x++) {
*yld = (BYTE)PIXB15(*yls);
yld++; yls++;
}
}
break;
default:
break;
}
}
/******************************************************************************/
/* private methods image操作 16bpp */
/******************************************************************************/
@@ -817,12 +691,6 @@ void image_setdepth(int depth) {
draw_line = image_drawLine8;
fill_rectangle = image_fillRectangle8;
break;
case 15:
draw_line = image_drawLine16;
fill_rectangle = image_fillRectangle16;
copy_from_alpha = image_copy_from_alpha15;
copy_to_alpha = image_copy_to_alpha15;
break;
case 16:
draw_line = image_drawLine16;
fill_rectangle = image_fillRectangle16;