97 const void *userdata,
GLushort *newimage);
101 const GLushort *oldimage,
void *userdata);
175 const void *,
void *,
180 const void *,
void *,
209 void (*)(
int,
const void *,
GLfloat []),
210 void (*)(
const GLfloat [],
int,
void *),
214 void (*)(
int,
const void *,
GLfloat []),
215 void (*)(
const GLfloat [],
int,
void *),
219 void (*)(
int,
const void *,
GLfloat []),
220 void (*)(
const GLfloat [],
int,
void *),
294 if (
value == 0)
return -1;
299 if (
value != 1)
return -1;
318 if (
value == 0)
return -1;
323 }
else if (
value == 3) {
331#define __GLU_SWAP_2_BYTES(s)\
332(GLushort)(((GLushort)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
334#define __GLU_SWAP_4_BYTES(s)\
335(GLuint)(((GLuint)((const GLubyte*)(s))[3])<<24 | \
336 ((GLuint)((const GLubyte*)(s))[2])<<16 | \
337 ((GLuint)((const GLubyte*)(s))[1])<<8 | ((const GLubyte*)(s))[0])
343 int newwidth, newheight;
348 newwidth =
width / 2;
355 for (
i = 0;
i < newheight;
i++) {
356 for (
j = 0;
j < newwidth;
j++) {
373 int newwidth, newheight;
386 newwidth =
width / 2;
388 padBytes = ysize - (
width*group_size);
390 t = (
const char *)datain;
393 for (
i = 0;
i < newheight;
i++) {
394 for (
j = 0;
j < newwidth;
j++) {
399 *(
const GLubyte*)(
t+ysize+group_size) + 2) / 4;
417 const char *
src= (
const char *) dataIn;
428 for (jj= 0; jj< halfWidth; jj++) {
440 int padBytes= ysize - (
width*group_size);
444 else if (
width == 1) {
445 int padBytes= ysize - (
width * group_size);
451 for (jj= 0; jj< halfHeight; jj++) {
475 int newwidth, newheight;
488 newwidth =
width / 2;
490 padBytes = ysize - (
width*group_size);
492 t = (
const char *)datain;
495 for (
i = 0;
i < newheight;
i++) {
496 for (
j = 0;
j < newwidth;
j++) {
499 *(
const GLbyte*)(
t+group_size) +
501 *(
const GLbyte*)(
t+ysize+group_size) + 2) / 4;
517 const char *
src= (
const char *) dataIn;
528 for (jj= 0; jj< halfWidth; jj++) {
539 int padBytes= ysize - (
width*group_size);
543 else if (
width == 1) {
544 int padBytes= ysize - (
width * group_size);
550 for (jj= 0; jj< halfHeight; jj++) {
575 int newwidth, newheight;
588 newwidth =
width / 2;
590 padBytes = ysize - (
width*group_size);
592 t = (
const char *)datain;
596 for (
i = 0;
i < newheight;
i++) {
597 for (
j = 0;
j < newwidth;
j++) {
602 *(
const GLushort*)(
t+ysize+group_size) + 2) / 4;
611 for (
i = 0;
i < newheight;
i++) {
612 for (
j = 0;
j < newwidth;
j++) {
634 const char *
src= (
const char *) dataIn;
645 for (jj= 0; jj< halfWidth; jj++) {
666 int padBytes= ysize - (
width*group_size);
670 else if (
width == 1) {
671 int padBytes= ysize - (
width * group_size);
677 for (jj= 0; jj< halfHeight; jj++) {
714 int newwidth, newheight;
727 newwidth =
width / 2;
729 padBytes = ysize - (
width*group_size);
731 t = (
const char *)datain;
735 for (
i = 0;
i < newheight;
i++) {
736 for (
j = 0;
j < newwidth;
j++) {
741 *(
const GLshort*)(
t+ysize+group_size) + 2) / 4;
750 for (
i = 0;
i < newheight;
i++) {
751 for (
j = 0;
j < newwidth;
j++) {
780 const char *
src= (
const char *) dataIn;
791 for (jj= 0; jj< halfWidth; jj++) {
805 *
dest= (sshort[0] + sshort[1]) / 2;
812 int padBytes= ysize - (
width*group_size);
816 else if (
width == 1) {
817 int padBytes= ysize - (
width * group_size);
823 for (jj= 0; jj< halfHeight; jj++) {
836 *
dest= (sshort[0] + sshort[1]) / 2;
860 int newwidth, newheight;
873 newwidth =
width / 2;
875 padBytes = ysize - (
width*group_size);
877 t = (
const char *)datain;
881 for (
i = 0;
i < newheight;
i++) {
882 for (
j = 0;
j < newwidth;
j++) {
887 (
double)*(
const GLuint*)(
t+ysize) +
898 for (
i = 0;
i < newheight;
i++) {
899 for (
j = 0;
j < newwidth;
j++) {
926 const char *
src= (
const char *) dataIn;
937 for (jj= 0; jj< halfWidth; jj++) {
958 int padBytes= ysize - (
width*group_size);
962 else if (
width == 1) {
963 int padBytes= ysize - (
width * group_size);
969 for (jj= 0; jj< halfHeight; jj++) {
1004 int newwidth, newheight;
1017 newwidth =
width / 2;
1019 padBytes = ysize - (
width*group_size);
1021 t = (
const char *)datain;
1025 for (
i = 0;
i < newheight;
i++) {
1026 for (
j = 0;
j < newwidth;
j++) {
1030 (
float)*(
const GLint*)(
t+ysize) +
1031 (
float)*(
const GLint*)(
t+ysize+group_size))/4 + 0.5;
1040 for (
i = 0;
i < newheight;
i++) {
1041 for (
j = 0;
j < newwidth;
j++) {
1072 const char *
src= (
const char *) dataIn;
1083 for (jj= 0; jj< halfWidth; jj++) {
1104 int padBytes= ysize - (
width*group_size);
1108 else if (
width == 1) {
1109 int padBytes= ysize - (
width * group_size);
1115 for (jj= 0; jj< halfHeight; jj++) {
1152 int newwidth, newheight;
1165 newwidth =
width / 2;
1167 padBytes = ysize - (
width*group_size);
1169 t = (
const char *)datain;
1173 for (
i = 0;
i < newheight;
i++) {
1174 for (
j = 0;
j < newwidth;
j++) {
1179 *(
const GLfloat*)(
t+ysize+group_size)) / 4;
1188 for (
i = 0;
i < newheight;
i++) {
1189 for (
j = 0;
j < newwidth;
j++) {
1218 const char *
src= (
const char *) dataIn;
1229 for (jj= 0; jj< halfWidth; jj++) {
1240 sfloat[1]= *(
const GLfloat*)(
src+group_size);
1243 *
dest= (sfloat[0] + sfloat[1]) / 2.0;
1250 int padBytes= ysize - (
width*group_size);
1254 else if (
width == 1) {
1255 int padBytes= ysize - (
width * group_size);
1261 for (jj= 0; jj< halfHeight; jj++) {
1274 *
dest= (sfloat[0] + sfloat[1]) / 2.0;
1294 float x, lowx, highx, convx, halfconvx;
1295 float y, lowy, highy, convy, halfconvy;
1296 float xpercent,ypercent;
1301 int i,
j,
k,yint,xint,xindex,yindex;
1304 if (widthin == widthout*2 && heightin == heightout*2) {
1308 convy = (
float) heightin/heightout;
1309 convx = (
float) widthin/widthout;
1310 halfconvx = convx/2;
1311 halfconvy = convy/2;
1312 for (
i = 0;
i < heightout;
i++) {
1313 y = convy * (
i+0.5);
1314 if (heightin > heightout) {
1315 highy =
y + halfconvy;
1316 lowy =
y - halfconvy;
1321 for (
j = 0;
j < widthout;
j++) {
1322 x = convx * (
j+0.5);
1323 if (widthin > widthout) {
1324 highx =
x + halfconvx;
1325 lowx =
x - halfconvx;
1336 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
1342 yindex = (yint + heightin) % heightin;
1343 if (highy < yint+1) {
1344 ypercent = highy -
y;
1346 ypercent = yint+1 -
y;
1353 xindex = (xint + widthin) % widthin;
1354 if (highx < xint+1) {
1355 xpercent = highx -
x;
1357 xpercent = xint+1 -
x;
1360 percent = xpercent * ypercent;
1364 totals[
k] += datain[
temp +
k] * percent;
1399 const char *
temp, *temp0;
1400 const char *temp_index;
1403 int lowx_int, highx_int, lowy_int, highy_int;
1404 float x_percent, y_percent;
1405 float lowx_float, highx_float, lowy_float, highy_float;
1406 float convy_float, convx_float;
1407 int convy_int, convx_int;
1411 if (widthin == widthout*2 && heightin == heightout*2) {
1417 convy = (
float) heightin/heightout;
1418 convx = (
float) widthin/widthout;
1419 convy_int =
floor(convy);
1420 convy_float = convy - convy_int;
1421 convx_int =
floor(convx);
1422 convx_float = convx - convx_int;
1424 area = convx * convy;
1428 highy_int = convy_int;
1429 highy_float = convy_float;
1431 for (
i = 0;
i < heightout;
i++) {
1433 if (highy_int >= heightin)
1434 highy_int = heightin - 1;
1437 highx_int = convx_int;
1438 highx_float = convx_float;
1440 for (
j = 0;
j < widthout;
j++) {
1447 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
1450 xindex = lowx_int*group_size;
1451 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
1453 y_percent = 1-lowy_float;
1454 temp = (
const char *)datain + xindex + lowy_int * ysize;
1455 percent = y_percent * (1-lowx_float);
1458 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1461 for(
l = lowx_int+1;
l < highx_int;
l++) {
1465 totals[
k] += (
GLubyte)(*(temp_index)) * y_percent;
1470 percent = y_percent * highx_float;
1473 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1477 y_percent = highy_float;
1478 percent = y_percent * (1-lowx_float);
1479 temp = (
const char *)datain + xindex + highy_int * ysize;
1482 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1484 for(
l = lowx_int+1;
l < highx_int;
l++) {
1488 totals[
k] += (
GLubyte)(*(temp_index)) * y_percent;
1492 percent = y_percent * highx_float;
1495 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1500 for(
m = lowy_int+1;
m < highy_int;
m++) {
1509 }
else if (highy_int > lowy_int) {
1510 x_percent = highx_float - lowx_float;
1511 percent = (1-lowy_float)*x_percent;
1512 temp = (
const char *)datain + xindex + lowy_int*ysize;
1515 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1517 for(
m = lowy_int+1;
m < highy_int;
m++) {
1521 totals[
k] += (
GLubyte)(*(temp_index)) * x_percent;
1524 percent = x_percent * highy_float;
1528 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1530 }
else if (highx_int > lowx_int) {
1531 y_percent = highy_float - lowy_float;
1532 percent = (1-lowx_float)*y_percent;
1533 temp = (
const char *)datain + xindex + lowy_int*ysize;
1536 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1538 for (
l = lowx_int+1;
l < highx_int;
l++) {
1542 totals[
k] += (
GLubyte)(*(temp_index)) * y_percent;
1546 percent = y_percent * highx_float;
1549 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1552 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
1553 temp = (
const char *)datain + xindex + lowy_int * ysize;
1556 totals[
k] += (
GLubyte)(*(temp_index)) * percent;
1563 temp0 = (
const char *)datain + xindex + group_size +
1565 for (
m = lowy_int+1;
m < highy_int;
m++) {
1567 for(
l = lowx_int+1;
l < highx_int;
l++) {
1570 totals[
k] += (
GLubyte)(*(temp_index));
1579 dataout[outindex +
k] = totals[
k]/
area;
1582 lowx_int = highx_int;
1583 lowx_float = highx_float;
1584 highx_int += convx_int;
1585 highx_float += convx_float;
1586 if(highx_float > 1) {
1591 lowy_int = highy_int;
1592 lowy_float = highy_float;
1593 highy_int += convy_int;
1594 highy_float += convy_float;
1595 if(highy_float > 1) {
1616 const char *
temp, *temp0;
1617 const char *temp_index;
1620 int lowx_int, highx_int, lowy_int, highy_int;
1621 float x_percent, y_percent;
1622 float lowx_float, highx_float, lowy_float, highy_float;
1623 float convy_float, convx_float;
1624 int convy_int, convx_int;
1628 if (widthin == widthout*2 && heightin == heightout*2) {
1634 convy = (
float) heightin/heightout;
1635 convx = (
float) widthin/widthout;
1636 convy_int =
floor(convy);
1637 convy_float = convy - convy_int;
1638 convx_int =
floor(convx);
1639 convx_float = convx - convx_int;
1641 area = convx * convy;
1645 highy_int = convy_int;
1646 highy_float = convy_float;
1648 for (
i = 0;
i < heightout;
i++) {
1650 if (highy_int >= heightin)
1651 highy_int = heightin - 1;
1654 highx_int = convx_int;
1655 highx_float = convx_float;
1657 for (
j = 0;
j < widthout;
j++) {
1664 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
1667 xindex = lowx_int*group_size;
1668 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
1670 y_percent = 1-lowy_float;
1671 temp = (
const char *)datain + xindex + lowy_int * ysize;
1672 percent = y_percent * (1-lowx_float);
1675 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1678 for(
l = lowx_int+1;
l < highx_int;
l++) {
1682 totals[
k] += (
GLbyte)(*(temp_index)) * y_percent;
1687 percent = y_percent * highx_float;
1690 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1694 y_percent = highy_float;
1695 percent = y_percent * (1-lowx_float);
1696 temp = (
const char *)datain + xindex + highy_int * ysize;
1699 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1701 for(
l = lowx_int+1;
l < highx_int;
l++) {
1705 totals[
k] += (
GLbyte)(*(temp_index)) * y_percent;
1709 percent = y_percent * highx_float;
1712 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1717 for(
m = lowy_int+1;
m < highy_int;
m++) {
1726 }
else if (highy_int > lowy_int) {
1727 x_percent = highx_float - lowx_float;
1728 percent = (1-lowy_float)*x_percent;
1729 temp = (
const char *)datain + xindex + lowy_int*ysize;
1732 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1734 for(
m = lowy_int+1;
m < highy_int;
m++) {
1738 totals[
k] += (
GLbyte)(*(temp_index)) * x_percent;
1741 percent = x_percent * highy_float;
1745 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1747 }
else if (highx_int > lowx_int) {
1748 y_percent = highy_float - lowy_float;
1749 percent = (1-lowx_float)*y_percent;
1750 temp = (
const char *)datain + xindex + lowy_int*ysize;
1753 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1755 for (
l = lowx_int+1;
l < highx_int;
l++) {
1759 totals[
k] += (
GLbyte)(*(temp_index)) * y_percent;
1763 percent = y_percent * highx_float;
1766 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1769 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
1770 temp = (
const char *)datain + xindex + lowy_int * ysize;
1773 totals[
k] += (
GLbyte)(*(temp_index)) * percent;
1780 temp0 = (
const char *)datain + xindex + group_size +
1782 for (
m = lowy_int+1;
m < highy_int;
m++) {
1784 for(
l = lowx_int+1;
l < highx_int;
l++) {
1787 totals[
k] += (
GLbyte)(*(temp_index));
1796 dataout[outindex +
k] = totals[
k]/
area;
1799 lowx_int = highx_int;
1800 lowx_float = highx_float;
1801 highx_int += convx_int;
1802 highx_float += convx_float;
1803 if(highx_float > 1) {
1808 lowy_int = highy_int;
1809 lowy_float = highy_float;
1810 highy_int += convy_int;
1811 highy_float += convy_float;
1812 if(highy_float > 1) {
1834 const char *
temp, *temp0;
1835 const char *temp_index;
1838 int lowx_int, highx_int, lowy_int, highy_int;
1839 float x_percent, y_percent;
1840 float lowx_float, highx_float, lowy_float, highy_float;
1841 float convy_float, convx_float;
1842 int convy_int, convx_int;
1846 if (widthin == widthout*2 && heightin == heightout*2) {
1852 convy = (
float) heightin/heightout;
1853 convx = (
float) widthin/widthout;
1854 convy_int =
floor(convy);
1855 convy_float = convy - convy_int;
1856 convx_int =
floor(convx);
1857 convx_float = convx - convx_int;
1859 area = convx * convy;
1863 highy_int = convy_int;
1864 highy_float = convy_float;
1866 for (
i = 0;
i < heightout;
i++) {
1868 if (highy_int >= heightin)
1869 highy_int = heightin - 1;
1872 highx_int = convx_int;
1873 highx_float = convx_float;
1875 for (
j = 0;
j < widthout;
j++) {
1881 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
1884 xindex = lowx_int*group_size;
1885 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
1887 y_percent = 1-lowy_float;
1888 temp = (
const char *)datain + xindex + lowy_int * ysize;
1889 percent = y_percent * (1-lowx_float);
1895 totals[
k] += *(
const GLushort*)temp_index * percent;
1899 for(
l = lowx_int+1;
l < highx_int;
l++) {
1907 totals[
k] += *(
const GLushort*)temp_index * y_percent;
1913 percent = y_percent * highx_float;
1919 totals[
k] += *(
const GLushort*)temp_index * percent;
1924 y_percent = highy_float;
1925 percent = y_percent * (1-lowx_float);
1926 temp = (
const char *)datain + xindex + highy_int * ysize;
1932 totals[
k] += *(
const GLushort*)temp_index * percent;
1935 for(
l = lowx_int+1;
l < highx_int;
l++) {
1943 totals[
k] += *(
const GLushort*)temp_index * y_percent;
1948 percent = y_percent * highx_float;
1954 totals[
k] += *(
const GLushort*)temp_index * percent;
1959 for(
m = lowy_int+1;
m < highy_int;
m++) {
1974 }
else if (highy_int > lowy_int) {
1975 x_percent = highx_float - lowx_float;
1976 percent = (1-lowy_float)*x_percent;
1977 temp = (
const char *)datain + xindex + lowy_int*ysize;
1983 totals[
k] += *(
const GLushort*)temp_index * percent;
1986 for(
m = lowy_int+1;
m < highy_int;
m++) {
1994 totals[
k] += *(
const GLushort*)temp_index * x_percent;
1998 percent = x_percent * highy_float;
2005 totals[
k] += *(
const GLushort*)temp_index * percent;
2008 }
else if (highx_int > lowx_int) {
2009 y_percent = highy_float - lowy_float;
2010 percent = (1-lowx_float)*y_percent;
2011 temp = (
const char *)datain + xindex + lowy_int*ysize;
2017 totals[
k] += *(
const GLushort*)temp_index * percent;
2020 for (
l = lowx_int+1;
l < highx_int;
l++) {
2028 totals[
k] += *(
const GLushort*)temp_index * y_percent;
2033 percent = y_percent * highx_float;
2039 totals[
k] += *(
const GLushort*)temp_index * percent;
2043 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
2044 temp = (
const char *)datain + xindex + lowy_int * ysize;
2050 totals[
k] += *(
const GLushort*)temp_index * percent;
2056 temp0 = (
const char *)datain + xindex + group_size +
2058 for (
m = lowy_int+1;
m < highy_int;
m++) {
2060 for(
l = lowx_int+1;
l < highx_int;
l++) {
2066 totals[
k] += *(
const GLushort*)temp_index;
2076 dataout[outindex +
k] = totals[
k]/
area;
2079 lowx_int = highx_int;
2080 lowx_float = highx_float;
2081 highx_int += convx_int;
2082 highx_float += convx_float;
2083 if(highx_float > 1) {
2088 lowy_int = highy_int;
2089 lowy_float = highy_float;
2090 highy_int += convy_int;
2091 highy_float += convy_float;
2092 if(highy_float > 1) {
2114 const char *
temp, *temp0;
2115 const char *temp_index;
2118 int lowx_int, highx_int, lowy_int, highy_int;
2119 float x_percent, y_percent;
2120 float lowx_float, highx_float, lowy_float, highy_float;
2121 float convy_float, convx_float;
2122 int convy_int, convx_int;
2128 if (widthin == widthout*2 && heightin == heightout*2) {
2134 convy = (
float) heightin/heightout;
2135 convx = (
float) widthin/widthout;
2136 convy_int =
floor(convy);
2137 convy_float = convy - convy_int;
2138 convx_int =
floor(convx);
2139 convx_float = convx - convx_int;
2141 area = convx * convy;
2145 highy_int = convy_int;
2146 highy_float = convy_float;
2148 for (
i = 0;
i < heightout;
i++) {
2150 if (highy_int >= heightin)
2151 highy_int = heightin - 1;
2154 highx_int = convx_int;
2155 highx_float = convx_float;
2157 for (
j = 0;
j < widthout;
j++) {
2163 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
2166 xindex = lowx_int*group_size;
2167 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
2169 y_percent = 1-lowy_float;
2170 temp = (
const char *)datain + xindex + lowy_int * ysize;
2171 percent = y_percent * (1-lowx_float);
2176 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2178 totals[
k] += *(
const GLshort*)temp_index * percent;
2182 for(
l = lowx_int+1;
l < highx_int;
l++) {
2188 totals[
k] += *(
const GLshort*)&swapbuf * y_percent;
2190 totals[
k] += *(
const GLshort*)temp_index * y_percent;
2196 percent = y_percent * highx_float;
2201 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2203 totals[
k] += *(
const GLshort*)temp_index * percent;
2208 y_percent = highy_float;
2209 percent = y_percent * (1-lowx_float);
2210 temp = (
const char *)datain + xindex + highy_int * ysize;
2215 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2217 totals[
k] += *(
const GLshort*)temp_index * percent;
2220 for(
l = lowx_int+1;
l < highx_int;
l++) {
2226 totals[
k] += *(
const GLshort*)&swapbuf * y_percent;
2228 totals[
k] += *(
const GLshort*)temp_index * y_percent;
2233 percent = y_percent * highx_float;
2238 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2240 totals[
k] += *(
const GLshort*)temp_index * percent;
2245 for(
m = lowy_int+1;
m < highy_int;
m++) {
2252 totals[
k] += *(
const GLshort*)&swapbuf * (1-lowx_float);
2254 totals[
k] += *(
const GLshort*)&swapbuf * highx_float;
2261 }
else if (highy_int > lowy_int) {
2262 x_percent = highx_float - lowx_float;
2263 percent = (1-lowy_float)*x_percent;
2264 temp = (
const char *)datain + xindex + lowy_int*ysize;
2269 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2271 totals[
k] += *(
const GLshort*)temp_index * percent;
2274 for(
m = lowy_int+1;
m < highy_int;
m++) {
2280 totals[
k] += *(
const GLshort*)&swapbuf * x_percent;
2282 totals[
k] += *(
const GLshort*)temp_index * x_percent;
2286 percent = x_percent * highy_float;
2292 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2294 totals[
k] += *(
const GLshort*)temp_index * percent;
2297 }
else if (highx_int > lowx_int) {
2298 y_percent = highy_float - lowy_float;
2299 percent = (1-lowx_float)*y_percent;
2301 temp = (
const char *)datain + xindex + lowy_int*ysize;
2306 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2308 totals[
k] += *(
const GLshort*)temp_index * percent;
2311 for (
l = lowx_int+1;
l < highx_int;
l++) {
2317 totals[
k] += *(
const GLshort*)&swapbuf * y_percent;
2319 totals[
k] += *(
const GLshort*)temp_index * y_percent;
2324 percent = y_percent * highx_float;
2329 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2331 totals[
k] += *(
const GLshort*)temp_index * percent;
2335 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
2336 temp = (
const char *)datain + xindex + lowy_int * ysize;
2341 totals[
k] += *(
const GLshort*)&swapbuf * percent;
2343 totals[
k] += *(
const GLshort*)temp_index * percent;
2349 temp0 = (
const char *)datain + xindex + group_size +
2351 for (
m = lowy_int+1;
m < highy_int;
m++) {
2353 for(
l = lowx_int+1;
l < highx_int;
l++) {
2358 totals[
k] += *(
const GLshort*)&swapbuf;
2360 totals[
k] += *(
const GLshort*)temp_index;
2370 dataout[outindex +
k] = totals[
k]/
area;
2373 lowx_int = highx_int;
2374 lowx_float = highx_float;
2375 highx_int += convx_int;
2376 highx_float += convx_float;
2377 if(highx_float > 1) {
2382 lowy_int = highy_int;
2383 lowy_float = highy_float;
2384 highy_int += convy_int;
2385 highy_float += convy_float;
2386 if(highy_float > 1) {
2408 const char *
temp, *temp0;
2409 const char *temp_index;
2412 int lowx_int, highx_int, lowy_int, highy_int;
2413 float x_percent, y_percent;
2414 float lowx_float, highx_float, lowy_float, highy_float;
2415 float convy_float, convx_float;
2416 int convy_int, convx_int;
2420 if (widthin == widthout*2 && heightin == heightout*2) {
2426 convy = (
float) heightin/heightout;
2427 convx = (
float) widthin/widthout;
2428 convy_int =
floor(convy);
2429 convy_float = convy - convy_int;
2430 convx_int =
floor(convx);
2431 convx_float = convx - convx_int;
2433 area = convx * convy;
2437 highy_int = convy_int;
2438 highy_float = convy_float;
2440 for (
i = 0;
i < heightout;
i++) {
2442 if (highy_int >= heightin)
2443 highy_int = heightin - 1;
2446 highx_int = convx_int;
2447 highx_float = convx_float;
2449 for (
j = 0;
j < widthout;
j++) {
2455 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
2458 xindex = lowx_int*group_size;
2459 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
2461 y_percent = 1-lowy_float;
2462 temp = (
const char *)datain + xindex + lowy_int * ysize;
2463 percent = y_percent * (1-lowx_float);
2469 totals[
k] += *(
const GLuint*)temp_index * percent;
2473 for(
l = lowx_int+1;
l < highx_int;
l++) {
2481 totals[
k] += *(
const GLuint*)temp_index * y_percent;
2487 percent = y_percent * highx_float;
2493 totals[
k] += *(
const GLuint*)temp_index * percent;
2498 y_percent = highy_float;
2499 percent = y_percent * (1-lowx_float);
2500 temp = (
const char *)datain + xindex + highy_int * ysize;
2506 totals[
k] += *(
const GLuint*)temp_index * percent;
2509 for(
l = lowx_int+1;
l < highx_int;
l++) {
2517 totals[
k] += *(
const GLuint*)temp_index * y_percent;
2522 percent = y_percent * highx_float;
2528 totals[
k] += *(
const GLuint*)temp_index * percent;
2533 for(
m = lowy_int+1;
m < highy_int;
m++) {
2543 totals[
k] += *(
const GLuint*)
left * (1-lowx_float)
2548 }
else if (highy_int > lowy_int) {
2549 x_percent = highx_float - lowx_float;
2550 percent = (1-lowy_float)*x_percent;
2551 temp = (
const char *)datain + xindex + lowy_int*ysize;
2557 totals[
k] += *(
const GLuint*)temp_index * percent;
2560 for(
m = lowy_int+1;
m < highy_int;
m++) {
2568 totals[
k] += *(
const GLuint*)temp_index * x_percent;
2572 percent = x_percent * highy_float;
2579 totals[
k] += *(
const GLuint*)temp_index * percent;
2582 }
else if (highx_int > lowx_int) {
2583 y_percent = highy_float - lowy_float;
2584 percent = (1-lowx_float)*y_percent;
2586 temp = (
const char *)datain + xindex + lowy_int*ysize;
2592 totals[
k] += *(
const GLuint*)temp_index * percent;
2595 for (
l = lowx_int+1;
l < highx_int;
l++) {
2603 totals[
k] += *(
const GLuint*)temp_index * y_percent;
2608 percent = y_percent * highx_float;
2614 totals[
k] += *(
const GLuint*)temp_index * percent;
2618 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
2619 temp = (
const char *)datain + xindex + lowy_int * ysize;
2625 totals[
k] += *(
const GLuint*)temp_index * percent;
2631 temp0 = (
const char *)datain + xindex + group_size +
2633 for (
m = lowy_int+1;
m < highy_int;
m++) {
2635 for(
l = lowx_int+1;
l < highx_int;
l++) {
2641 totals[
k] += *(
const GLuint*)temp_index;
2656 else dataout[outindex +
k] =
value;
2658 lowx_int = highx_int;
2659 lowx_float = highx_float;
2660 highx_int += convx_int;
2661 highx_float += convx_float;
2662 if(highx_float > 1) {
2667 lowy_int = highy_int;
2668 lowy_float = highy_float;
2669 highy_int += convy_int;
2670 highy_float += convy_float;
2671 if(highy_float > 1) {
2695 const char *
temp, *temp0;
2696 const char *temp_index;
2699 int lowx_int, highx_int, lowy_int, highy_int;
2700 float x_percent, y_percent;
2701 float lowx_float, highx_float, lowy_float, highy_float;
2702 float convy_float, convx_float;
2703 int convy_int, convx_int;
2709 if (widthin == widthout*2 && heightin == heightout*2) {
2715 convy = (
float) heightin/heightout;
2716 convx = (
float) widthin/widthout;
2717 convy_int =
floor(convy);
2718 convy_float = convy - convy_int;
2719 convx_int =
floor(convx);
2720 convx_float = convx - convx_int;
2722 area = convx * convy;
2726 highy_int = convy_int;
2727 highy_float = convy_float;
2729 for (
i = 0;
i < heightout;
i++) {
2731 if (highy_int >= heightin)
2732 highy_int = heightin - 1;
2735 highx_int = convx_int;
2736 highx_float = convx_float;
2738 for (
j = 0;
j < widthout;
j++) {
2744 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
2747 xindex = lowx_int*group_size;
2748 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
2750 y_percent = 1-lowy_float;
2751 temp = (
const char *)datain + xindex + lowy_int * ysize;
2752 percent = y_percent * (1-lowx_float);
2757 totals[
k] += *(
const GLint*)&swapbuf * percent;
2759 totals[
k] += *(
const GLint*)temp_index * percent;
2763 for(
l = lowx_int+1;
l < highx_int;
l++) {
2769 totals[
k] += *(
const GLint*)&swapbuf * y_percent;
2771 totals[
k] += *(
const GLint*)temp_index * y_percent;
2777 percent = y_percent * highx_float;
2782 totals[
k] += *(
const GLint*)&swapbuf * percent;
2784 totals[
k] += *(
const GLint*)temp_index * percent;
2789 y_percent = highy_float;
2790 percent = y_percent * (1-lowx_float);
2791 temp = (
const char *)datain + xindex + highy_int * ysize;
2796 totals[
k] += *(
const GLint*)&swapbuf * percent;
2798 totals[
k] += *(
const GLint*)temp_index * percent;
2801 for(
l = lowx_int+1;
l < highx_int;
l++) {
2807 totals[
k] += *(
const GLint*)&swapbuf * y_percent;
2809 totals[
k] += *(
const GLint*)temp_index * y_percent;
2814 percent = y_percent * highx_float;
2819 totals[
k] += *(
const GLint*)&swapbuf * percent;
2821 totals[
k] += *(
const GLint*)temp_index * percent;
2826 for(
m = lowy_int+1;
m < highy_int;
m++) {
2833 totals[
k] += *(
const GLint*)&swapbuf * (1-lowx_float);
2835 totals[
k] += *(
const GLint*)&swapbuf * highx_float;
2837 totals[
k] += *(
const GLint*)
left * (1-lowx_float)
2842 }
else if (highy_int > lowy_int) {
2843 x_percent = highx_float - lowx_float;
2844 percent = (1-lowy_float)*x_percent;
2845 temp = (
const char *)datain + xindex + lowy_int*ysize;
2850 totals[
k] += *(
const GLint*)&swapbuf * percent;
2852 totals[
k] += *(
const GLint*)temp_index * percent;
2855 for(
m = lowy_int+1;
m < highy_int;
m++) {
2861 totals[
k] += *(
const GLint*)&swapbuf * x_percent;
2863 totals[
k] += *(
const GLint*)temp_index * x_percent;
2867 percent = x_percent * highy_float;
2873 totals[
k] += *(
const GLint*)&swapbuf * percent;
2875 totals[
k] += *(
const GLint*)temp_index * percent;
2878 }
else if (highx_int > lowx_int) {
2879 y_percent = highy_float - lowy_float;
2880 percent = (1-lowx_float)*y_percent;
2882 temp = (
const char *)datain + xindex + lowy_int*ysize;
2887 totals[
k] += *(
const GLint*)&swapbuf * percent;
2889 totals[
k] += *(
const GLint*)temp_index * percent;
2892 for (
l = lowx_int+1;
l < highx_int;
l++) {
2898 totals[
k] += *(
const GLint*)&swapbuf * y_percent;
2900 totals[
k] += *(
const GLint*)temp_index * y_percent;
2905 percent = y_percent * highx_float;
2910 totals[
k] += *(
const GLint*)&swapbuf * percent;
2912 totals[
k] += *(
const GLint*)temp_index * percent;
2916 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
2917 temp = (
const char *)datain + xindex + lowy_int * ysize;
2922 totals[
k] += *(
const GLint*)&swapbuf * percent;
2924 totals[
k] += *(
const GLint*)temp_index * percent;
2930 temp0 = (
const char *)datain + xindex + group_size +
2932 for (
m = lowy_int+1;
m < highy_int;
m++) {
2934 for(
l = lowx_int+1;
l < highx_int;
l++) {
2939 totals[
k] += *(
const GLint*)&swapbuf;
2941 totals[
k] += *(
const GLint*)temp_index;
2951 dataout[outindex +
k] = totals[
k]/
area;
2954 lowx_int = highx_int;
2955 lowx_float = highx_float;
2956 highx_int += convx_int;
2957 highx_float += convx_float;
2958 if(highx_float > 1) {
2963 lowy_int = highy_int;
2964 lowy_float = highy_float;
2965 highy_int += convy_int;
2966 highy_float += convy_float;
2967 if(highy_float > 1) {
2991 const char *
temp, *temp0;
2992 const char *temp_index;
2995 int lowx_int, highx_int, lowy_int, highy_int;
2996 float x_percent, y_percent;
2997 float lowx_float, highx_float, lowy_float, highy_float;
2998 float convy_float, convx_float;
2999 int convy_int, convx_int;
3005 if (widthin == widthout*2 && heightin == heightout*2) {
3011 convy = (
float) heightin/heightout;
3012 convx = (
float) widthin/widthout;
3013 convy_int =
floor(convy);
3014 convy_float = convy - convy_int;
3015 convx_int =
floor(convx);
3016 convx_float = convx - convx_int;
3018 area = convx * convy;
3022 highy_int = convy_int;
3023 highy_float = convy_float;
3025 for (
i = 0;
i < heightout;
i++) {
3027 if (highy_int >= heightin)
3028 highy_int = heightin - 1;
3031 highx_int = convx_int;
3032 highx_float = convx_float;
3034 for (
j = 0;
j < widthout;
j++) {
3040 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
3043 xindex = lowx_int*group_size;
3044 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
3046 y_percent = 1-lowy_float;
3047 temp = (
const char *)datain + xindex + lowy_int * ysize;
3048 percent = y_percent * (1-lowx_float);
3053 totals[
k] += swapbuf.f * percent;
3055 totals[
k] += *(
const GLfloat*)temp_index * percent;
3059 for(
l = lowx_int+1;
l < highx_int;
l++) {
3065 totals[
k] += swapbuf.f * y_percent;
3067 totals[
k] += *(
const GLfloat*)temp_index * y_percent;
3073 percent = y_percent * highx_float;
3078 totals[
k] += swapbuf.f * percent;
3080 totals[
k] += *(
const GLfloat*)temp_index * percent;
3085 y_percent = highy_float;
3086 percent = y_percent * (1-lowx_float);
3087 temp = (
const char *)datain + xindex + highy_int * ysize;
3092 totals[
k] += swapbuf.f * percent;
3094 totals[
k] += *(
const GLfloat*)temp_index * percent;
3097 for(
l = lowx_int+1;
l < highx_int;
l++) {
3103 totals[
k] += swapbuf.f * y_percent;
3105 totals[
k] += *(
const GLfloat*)temp_index * y_percent;
3110 percent = y_percent * highx_float;
3115 totals[
k] += swapbuf.f * percent;
3117 totals[
k] += *(
const GLfloat*)temp_index * percent;
3122 for(
m = lowy_int+1;
m < highy_int;
m++) {
3129 totals[
k] += swapbuf.f * (1-lowx_float);
3131 totals[
k] += swapbuf.f * highx_float;
3138 }
else if (highy_int > lowy_int) {
3139 x_percent = highx_float - lowx_float;
3140 percent = (1-lowy_float)*x_percent;
3141 temp = (
const char *)datain + xindex + lowy_int*ysize;
3146 totals[
k] += swapbuf.f * percent;
3148 totals[
k] += *(
const GLfloat*)temp_index * percent;
3151 for(
m = lowy_int+1;
m < highy_int;
m++) {
3157 totals[
k] += swapbuf.f * x_percent;
3159 totals[
k] += *(
const GLfloat*)temp_index * x_percent;
3163 percent = x_percent * highy_float;
3169 totals[
k] += swapbuf.f * percent;
3171 totals[
k] += *(
const GLfloat*)temp_index * percent;
3174 }
else if (highx_int > lowx_int) {
3175 y_percent = highy_float - lowy_float;
3176 percent = (1-lowx_float)*y_percent;
3178 temp = (
const char *)datain + xindex + lowy_int*ysize;
3183 totals[
k] += swapbuf.f * percent;
3185 totals[
k] += *(
const GLfloat*)temp_index * percent;
3188 for (
l = lowx_int+1;
l < highx_int;
l++) {
3194 totals[
k] += swapbuf.f * y_percent;
3196 totals[
k] += *(
const GLfloat*)temp_index * y_percent;
3201 percent = y_percent * highx_float;
3206 totals[
k] += swapbuf.f * percent;
3208 totals[
k] += *(
const GLfloat*)temp_index * percent;
3212 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
3213 temp = (
const char *)datain + xindex + lowy_int * ysize;
3218 totals[
k] += swapbuf.f * percent;
3220 totals[
k] += *(
const GLfloat*)temp_index * percent;
3226 temp0 = (
const char *)datain + xindex + group_size +
3228 for (
m = lowy_int+1;
m < highy_int;
m++) {
3230 for(
l = lowx_int+1;
l < highx_int;
l++) {
3235 totals[
k] += swapbuf.f;
3237 totals[
k] += *(
const GLfloat*)temp_index;
3247 dataout[outindex +
k] = totals[
k]/
area;
3250 lowx_int = highx_int;
3251 lowx_float = highx_float;
3252 highx_int += convx_int;
3253 highx_float += convx_float;
3254 if(highx_float > 1) {
3259 lowy_int = highy_int;
3260 lowy_float = highy_float;
3261 highy_int += convy_int;
3262 highy_float += convy_float;
3263 if(highy_float > 1) {
3396 if (baseLevel < 0 || baseLevel < userLevel || maxLevel < baseLevel ||
3397 totalLevels < maxLevel)
3423 GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
3424 widthPowerOf2 >> 1 :
3426 GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
3427 heightPowerOf2 >> 1 :
3430 assert(widthAtLevelOne > 0);
assert(heightAtLevelOne > 0);
3439#if defined(GL_ARB_texture_cube_map)
3460 if (proxyWidth == 0) {
3461 if (widthPowerOf2 == 1 && heightPowerOf2 == 1) {
3468 goto noProxyTextures;
3470 widthPowerOf2= widthAtLevelOne;
3471 heightPowerOf2= heightAtLevelOne;
3474 }
while (proxyWidth == 0);
3478 *newWidth= widthPowerOf2;
3479 *newHeight= heightPowerOf2;
3499 GLenum typein,
const void *datain,
3508 if (widthin == 0 || heightin == 0 || widthout == 0 || heightout == 0) {
3511 if (widthin < 0 || heightin < 0 || widthout < 0 || heightout < 0) {
3527 if (beforeImage ==
NULL || afterImage ==
NULL) {
3535 datain, beforeImage);
3538 widthout, heightout, afterImage);
3557 GLint newImage_width;
3569 newwidth= widthPowerOf2;
3577 newImage_width =
width;
3578 if (newImage ==
NULL) {
3594 if (newImage_width == newwidth) {
3596 if (baseLevel <=
level &&
level <= maxLevel) {
3601 if (otherImage ==
NULL) {
3604 if (otherImage ==
NULL) {
3615 newwidth, 1, otherImage);
3617 imageTemp = otherImage;
3618 otherImage = newImage;
3619 newImage = imageTemp;
3621 newImage_width = newwidth;
3622 if (baseLevel <=
level &&
level <= maxLevel) {
3627 if (newwidth > 1) newwidth /= 2;
3652 if (rc != 0)
return rc;
3667 userLevel, baseLevel, maxLevel,
3676 GLint widthPowerOf2;
3681 if (rc != 0)
return rc;
3700 GLint newwidth, newheight;
3703 GLint newImage_width;
3704 GLint newImage_height;
3721 &newwidth,&newheight);
3730 newImage_width =
width;
3731 newImage_height =
height;
3732 if (newImage ==
NULL) {
3750 if (newImage_width == newwidth && newImage_height == newheight) {
3755 if (otherImage ==
NULL) {
3759 if (otherImage ==
NULL) {
3770 newwidth, newheight, otherImage);
3772 imageTemp = otherImage;
3773 otherImage = newImage;
3774 newImage = imageTemp;
3776 newImage_width = newwidth;
3777 newImage_height = newheight;
3782 if (newwidth > 1) newwidth /= 2;
3783 if (newheight > 1) newheight /= 2;
3799#define __GLU_INIT_SWAP_IMAGE void *tmpImage
3800#define __GLU_SWAP_IMAGE(a,b) tmpImage = a; a = b; b = tmpImage;
3811 GLint newwidth, newheight;
3813 const void *usersImage;
3814 void *srcImage, *dstImage;
3831 srcImage = dstImage =
NULL;
3833 newwidth= widthPowerOf2;
3834 newheight= heightPowerOf2;
3847 groups_per_line =
width;
3854 rowsize = groups_per_line * group_size;
3871 if (baseLevel <=
level &&
level <= maxLevel) {
3887 int nextWidth= newwidth/2;
3888 int nextHeight= newheight/2;
3891 if (nextWidth < 1) nextWidth= 1;
3892 if (nextHeight < 1) nextHeight= 1;
3939 if (dstImage ==
NULL) {
3976 (
const GLint *)usersImage, (
GLint *)dstImage,
4053 if (newwidth < 1) newwidth= 1;
4054 if (newheight < 1) newheight= 1;
4057 rowsize = newwidth * group_size;
4104 if (dstImage ==
NULL) {
4114 level = userLevel+1;
4161 if (dstImage ==
NULL) {
4173 (
const GLubyte *)usersImage, newwidth, newheight,
4175 rowsize, group_size);
4179 (
const GLbyte *)usersImage, newwidth, newheight,
4181 rowsize, group_size);
4185 (
const GLushort *)usersImage, newwidth, newheight,
4187 rowsize, group_size, myswap_bytes);
4191 (
const GLshort *)usersImage, newwidth, newheight,
4193 rowsize, group_size, myswap_bytes);
4197 (
const GLuint *)usersImage, newwidth, newheight,
4199 rowsize, group_size, myswap_bytes);
4203 (
const GLint *)usersImage, newwidth, newheight,
4205 rowsize, group_size, myswap_bytes);
4209 (
const GLfloat *)usersImage, newwidth, newheight,
4211 rowsize, group_size, myswap_bytes);
4216 newwidth,newheight,(
void *)dstImage,
4222 newwidth,newheight,(
void *)dstImage,
4228 newwidth,newheight,(
void *)dstImage,
4234 newwidth,newheight,(
void *)dstImage,
4240 newwidth,newheight,(
void *)dstImage,
4246 newwidth,newheight,(
void *)dstImage,
4252 newwidth,newheight,(
void *)dstImage,
4258 newwidth,newheight,(
void *)dstImage,
4264 newwidth,newheight,(
void *)dstImage,
4270 newwidth,newheight,(
void *)dstImage,
4276 newwidth,newheight,(
void *)dstImage,
4282 newwidth,newheight,(
void *)dstImage,
4290 rowsize = newwidth * group_size;
4296 int nextWidth= newwidth/2;
4297 int nextHeight= newheight/2;
4298 if (nextWidth < 1) nextWidth= 1;
4299 if (nextHeight < 1) nextHeight= 1;
4347 if (dstImage ==
NULL) {
4362 if (baseLevel <=
level &&
level <= maxLevel) {
4373 rowsize, group_size);
4378 rowsize, group_size);
4383 rowsize, group_size, myswap_bytes);
4388 rowsize, group_size, myswap_bytes);
4393 rowsize, group_size, myswap_bytes);
4398 rowsize, group_size, myswap_bytes);
4403 rowsize, group_size, myswap_bytes);
4484 if (newwidth > 1) { newwidth /= 2; rowsize /= 2;}
4485 if (newheight > 1) newheight /= 2;
4493 if (baseLevel <=
level &&
level <= maxLevel) {
4501 int ii;
unsigned char *dstTrav, *srcTrav;
4504 void *newMipmapImage=
malloc((
size_t) (newRowLength*newheight));
4505 if (newMipmapImage ==
NULL) {
4519 dstTrav= (
unsigned char *) newMipmapImage,
4520 srcTrav= (
unsigned char *) srcImage;
4523 dstTrav+= newRowLength,
4524 srcTrav+= rowsize) {
4525 memcpy(dstTrav,srcTrav,rowsize);
4532 if (baseLevel <=
level &&
level <= maxLevel) {
4536 free(newMipmapImage);
4563 if (rc != 0)
return rc;
4581 userLevel, baseLevel, maxLevel,
4591 GLint widthPowerOf2, heightPowerOf2;
4595 if (rc != 0)
return rc;
4602 &widthPowerOf2,&heightPowerOf2);
4610 widthPowerOf2,heightPowerOf2,
4628 GLint newwidth, newheight;
4631 GLint newImage_width;
4632 GLint newImage_height;
4647 &newwidth,&newheight);
4662 newImage_width =
width;
4663 newImage_height =
height;
4666 GLint groups_per_line;
4667 GLint elements_per_line;
4675 newImage_width =
width;
4676 newImage_height =
height;
4677 if (newImage ==
NULL) {
4687 groups_per_line =
width;
4689 rowsize = groups_per_line * cmpts;
4690 elements_per_line =
width * cmpts;
4697 for (
j = 0;
j < elements_per_line;
j++) {
4714 if (newImage_width == newwidth && newImage_height == newheight) {
4720 if (otherImage ==
NULL) {
4724 if (otherImage ==
NULL) {
4738 imageTemp = otherImage;
4739 otherImage = newImage;
4740 newImage = imageTemp;
4742 newImage_width = newwidth;
4743 newImage_height = newheight;
4748 if (newwidth > 1) newwidth /= 2;
4749 if (newheight > 1) newheight /= 2;
4760 if (otherImage && otherImage != (
const GLubyte *)
data) {
4824 return(
sizeof(
GLint));
4867 bytes_per_row = (
width + 7) / 8;
4881 const void *userdata,
GLushort *newimage)
4887 GLint groups_per_line;
4889 GLint elements_per_line;
4901 groups_per_line =
width;
4909 rowsize = (groups_per_line *
components + 7) / 8;
4921 for (
j = 0;
j < elements_per_line;
j++) {
4924 current_bit = iter[0] & (1 << bit_offset);
4926 current_bit = iter[0] & (1 << (7 - bit_offset));
4938 if (bit_offset == 8) {
4951 rowsize = groups_per_line * group_size;
4963 for (
j = 0;
j < elements_per_line;
j++) {
4965 float extractComponents[4];
4970 for (
k = 0;
k < 3;
k++) {
4971 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
4976 for (
k = 0;
k < 3;
k++) {
4977 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
4984 *iter2++ = (*iter) * 257;
4989 *iter2++ = *((
const GLbyte *) iter);
4992 *iter2++ = (*((
const GLbyte *) iter)) * 516;
4996 extract565(myswap_bytes,iter,extractComponents);
4997 for (
k = 0;
k < 3;
k++) {
4998 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5003 for (
k = 0;
k < 3;
k++) {
5004 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5009 for (
k = 0;
k < 4;
k++) {
5010 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5015 for (
k = 0;
k < 4;
k++) {
5016 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5021 for (
k = 0;
k < 4;
k++) {
5022 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5027 for (
k = 0;
k < 4;
k++) {
5028 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5034 widget.
ub[0] = iter[1];
5035 widget.
ub[1] = iter[0];
5037 widget.
ub[0] = iter[0];
5038 widget.
ub[1] = iter[1];
5042 *iter2++ = widget.
s[0];
5045 *iter2++ = widget.
s[0]*2;
5048 *iter2++ = widget.
us[0];
5053 for (
k = 0;
k < 4;
k++) {
5054 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5059 for (
k = 0;
k < 4;
k++) {
5060 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5065 for (
k = 0;
k < 4;
k++) {
5066 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5071 for (
k = 0;
k < 4;
k++) {
5072 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
5079 widget.
ub[0] = iter[3];
5080 widget.
ub[1] = iter[2];
5081 widget.
ub[2] = iter[1];
5082 widget.
ub[3] = iter[0];
5084 widget.
ub[0] = iter[0];
5085 widget.
ub[1] = iter[1];
5086 widget.
ub[2] = iter[2];
5087 widget.
ub[3] = iter[3];
5091 *iter2++ = widget.
f;
5093 *iter2++ = 65535 * widget.
f;
5097 *iter2++ = widget.
ui;
5099 *iter2++ = widget.
ui >> 16;
5103 *iter2++ = widget.
i;
5105 *iter2++ = widget.
i >> 15;
5144 const GLushort *oldimage,
void *userdata)
5150 GLint groups_per_line;
5152 GLint elements_per_line;
5164 groups_per_line =
width;
5172 rowsize = (groups_per_line *
components + 7) / 8;
5184 for (
j = 0;
j < elements_per_line;
j++) {
5186 current_bit = iter2[0] & 1;
5188 if (iter2[0] > 32767) {
5197 *iter |= (1 << bit_offset);
5199 *iter |= (1 << (7 - bit_offset));
5203 *iter &= ~(1 << bit_offset);
5205 *iter &= ~(1 << (7 - bit_offset));
5210 if (bit_offset == 8) {
5219 float shoveComponents[4];
5225 rowsize = groups_per_line * group_size;
5237 for (
j = 0;
j < elements_per_line;
j++) {
5242 for (
k = 0;
k < 3;
k++) {
5243 shoveComponents[
k]= *iter2++ / 65535.0;
5245 shove332(shoveComponents,0,(
void *)iter);
5248 for (
k = 0;
k < 3;
k++) {
5249 shoveComponents[
k]= *iter2++ / 65535.0;
5257 *iter = *iter2++ >> 8;
5262 *((
GLbyte *) iter) = *iter2++;
5264 *((
GLbyte *) iter) = *iter2++ >> 9;
5268 for (
k = 0;
k < 3;
k++) {
5269 shoveComponents[
k]= *iter2++ / 65535.0;
5271 shove565(shoveComponents,0,(
void *)&widget.
us[0]);
5273 iter[0] = widget.
ub[1];
5274 iter[1] = widget.
ub[0];
5281 for (
k = 0;
k < 3;
k++) {
5282 shoveComponents[
k]= *iter2++ / 65535.0;
5286 iter[0] = widget.
ub[1];
5287 iter[1] = widget.
ub[0];
5294 for (
k = 0;
k < 4;
k++) {
5295 shoveComponents[
k]= *iter2++ / 65535.0;
5297 shove4444(shoveComponents,0,(
void *)&widget.
us[0]);
5299 iter[0] = widget.
ub[1];
5300 iter[1] = widget.
ub[0];
5306 for (
k = 0;
k < 4;
k++) {
5307 shoveComponents[
k]= *iter2++ / 65535.0;
5311 iter[0] = widget.
ub[1];
5312 iter[1] = widget.
ub[0];
5318 for (
k = 0;
k < 4;
k++) {
5319 shoveComponents[
k]= *iter2++ / 65535.0;
5321 shove5551(shoveComponents,0,(
void *)&widget.
us[0]);
5323 iter[0] = widget.
ub[1];
5324 iter[1] = widget.
ub[0];
5330 for (
k = 0;
k < 4;
k++) {
5331 shoveComponents[
k]= *iter2++ / 65535.0;
5335 iter[0] = widget.
ub[1];
5336 iter[1] = widget.
ub[0];
5345 widget.
s[0] = *iter2++;
5347 widget.
s[0] = *iter2++ >> 1;
5350 widget.
us[0] = *iter2++;
5353 iter[0] = widget.
ub[1];
5354 iter[1] = widget.
ub[0];
5356 iter[0] = widget.
ub[0];
5357 iter[1] = widget.
ub[1];
5361 for (
k = 0;
k < 4;
k++) {
5362 shoveComponents[
k]= *iter2++ / 65535.0;
5366 iter[3] = widget.
ub[0];
5367 iter[2] = widget.
ub[1];
5368 iter[1] = widget.
ub[2];
5369 iter[0] = widget.
ub[3];
5376 for (
k = 0;
k < 4;
k++) {
5377 shoveComponents[
k]= *iter2++ / 65535.0;
5381 iter[3] = widget.
ub[0];
5382 iter[2] = widget.
ub[1];
5383 iter[1] = widget.
ub[2];
5384 iter[0] = widget.
ub[3];
5390 for (
k = 0;
k < 4;
k++) {
5391 shoveComponents[
k]= *iter2++ / 65535.0;
5395 iter[3] = widget.
ub[0];
5396 iter[2] = widget.
ub[1];
5397 iter[1] = widget.
ub[2];
5398 iter[0] = widget.
ub[3];
5404 for (
k = 0;
k < 4;
k++) {
5405 shoveComponents[
k]= *iter2++ / 65535.0;
5409 iter[3] = widget.
ub[0];
5410 iter[2] = widget.
ub[1];
5411 iter[1] = widget.
ub[2];
5412 iter[0] = widget.
ub[3];
5422 widget.
f = *iter2++;
5424 widget.
f = *iter2++ / (
float) 65535.0;
5428 widget.
ui = *iter2++;
5430 widget.
ui = (
unsigned int) *iter2++ * 65537;
5434 widget.
i = *iter2++;
5436 widget.
i = ((
unsigned int) *iter2++ * 65537)/2;
5440 iter[3] = widget.
ub[0];
5441 iter[2] = widget.
ub[1];
5442 iter[1] = widget.
ub[2];
5443 iter[0] = widget.
ub[3];
5445 iter[0] = widget.
ub[0];
5446 iter[1] = widget.
ub[1];
5447 iter[2] = widget.
ub[2];
5448 iter[3] = widget.
ub[3];
5483 const void *packedPixel,
GLfloat extractComponents[])
5493 extractComponents[0]= (
float)((ubyte & 0xe0) >> 5) / 7.0;
5494 extractComponents[1]= (
float)((ubyte & 0x1c) >> 2) / 7.0;
5495 extractComponents[2]= (
float)((ubyte & 0x03) ) / 3.0;
5499 int index,
void *packedPixel)
5505 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5506 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5507 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5511 ((
GLubyte)((shoveComponents[0] * 7)+0.5) << 5) & 0xe0;
5513 ((
GLubyte)((shoveComponents[1] * 7)+0.5) << 2) & 0x1c;
5515 ((
GLubyte)((shoveComponents[2] * 3)+0.5) ) & 0x03;
5519 const void *packedPixel,
GLfloat extractComponents[])
5529 extractComponents[0]= (
float)((ubyte & 0x07) ) / 7.0;
5530 extractComponents[1]= (
float)((ubyte & 0x38) >> 3) / 7.0;
5531 extractComponents[2]= (
float)((ubyte & 0xC0) >> 6) / 3.0;
5535 int index,
void *packedPixel)
5541 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5542 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5543 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5547 ((
GLubyte)((shoveComponents[0] * 7.0)+0.5) ) & 0x07;
5549 ((
GLubyte)((shoveComponents[1] * 7.0)+0.5) << 3) & 0x38;
5551 ((
GLubyte)((shoveComponents[2] * 3.0)+0.5) << 6) & 0xC0;
5555 const void *packedPixel,
GLfloat extractComponents[])
5570 extractComponents[0]=(
float)((
ushort & 0xf800) >> 11) / 31.0;
5571 extractComponents[1]=(
float)((
ushort & 0x07e0) >> 5) / 63.0;
5572 extractComponents[2]=(
float)((
ushort & 0x001f) ) / 31.0;
5576 int index,
void *packedPixel)
5582 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5583 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5584 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5588 ((
GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
5590 ((
GLushort)((shoveComponents[1] * 63)+0.5) << 5) & 0x07e0;
5592 ((
GLushort)((shoveComponents[2] * 31)+0.5) ) & 0x001f;
5596 const void *packedPixel,
GLfloat extractComponents[])
5611 extractComponents[0]= (
float)((
ushort & 0x001F) ) / 31.0;
5612 extractComponents[1]= (
float)((
ushort & 0x07E0) >> 5) / 63.0;
5613 extractComponents[2]= (
float)((
ushort & 0xF800) >> 11) / 31.0;
5617 int index,
void *packedPixel)
5623 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5624 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5625 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5629 ((
GLushort)((shoveComponents[0] * 31.0)+0.5) ) & 0x001F;
5631 ((
GLushort)((shoveComponents[1] * 63.0)+0.5) << 5) & 0x07E0;
5633 ((
GLushort)((shoveComponents[2] * 31.0)+0.5) << 11) & 0xF800;
5653 extractComponents[0]= (
float)((
ushort & 0xf000) >> 12) / 15.0;
5654 extractComponents[1]= (
float)((
ushort & 0x0f00) >> 8) / 15.0;
5655 extractComponents[2]= (
float)((
ushort & 0x00f0) >> 4) / 15.0;
5656 extractComponents[3]= (
float)((
ushort & 0x000f) ) / 15.0;
5660 int index,
void *packedPixel)
5662 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5663 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5664 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5665 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5669 ((
GLushort)((shoveComponents[0] * 15)+0.5) << 12) & 0xf000;
5671 ((
GLushort)((shoveComponents[1] * 15)+0.5) << 8) & 0x0f00;
5673 ((
GLushort)((shoveComponents[2] * 15)+0.5) << 4) & 0x00f0;
5675 ((
GLushort)((shoveComponents[3] * 15)+0.5) ) & 0x000f;
5696 extractComponents[0]= (
float)((
ushort & 0x000F) ) / 15.0;
5697 extractComponents[1]= (
float)((
ushort & 0x00F0) >> 4) / 15.0;
5698 extractComponents[2]= (
float)((
ushort & 0x0F00) >> 8) / 15.0;
5699 extractComponents[3]= (
float)((
ushort & 0xF000) >> 12) / 15.0;
5703 int index,
void *packedPixel)
5710 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5711 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5712 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5713 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5717 ((
GLushort)((shoveComponents[0] * 15)+0.5) ) & 0x000F;
5719 ((
GLushort)((shoveComponents[1] * 15)+0.5) << 4) & 0x00F0;
5721 ((
GLushort)((shoveComponents[2] * 15)+0.5) << 8) & 0x0F00;
5723 ((
GLushort)((shoveComponents[3] * 15)+0.5) << 12) & 0xF000;
5743 extractComponents[0]=(
float)((
ushort & 0xf800) >> 11) / 31.0;
5744 extractComponents[1]=(
float)((
ushort & 0x07c0) >> 6) / 31.0;
5745 extractComponents[2]=(
float)((
ushort & 0x003e) >> 1) / 31.0;
5750 int index,
void *packedPixel)
5757 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5758 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5759 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5760 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5764 ((
GLushort)((shoveComponents[0] * 31)+0.5) << 11) & 0xf800;
5766 ((
GLushort)((shoveComponents[1] * 31)+0.5) << 6) & 0x07c0;
5768 ((
GLushort)((shoveComponents[2] * 31)+0.5) << 1) & 0x003e;
5770 ((
GLushort)((shoveComponents[3])+0.5) ) & 0x0001;
5791 extractComponents[0]= (
float)((
ushort & 0x001F) ) / 31.0;
5792 extractComponents[1]= (
float)((
ushort & 0x03E0) >> 5) / 31.0;
5793 extractComponents[2]= (
float)((
ushort & 0x7C00) >> 10) / 31.0;
5794 extractComponents[3]= (
float)((
ushort & 0x8000) >> 15);
5798 int index,
void *packedPixel)
5805 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5806 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5807 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5808 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5812 ((
GLushort)((shoveComponents[0] * 31)+0.5) ) & 0x001F;
5814 ((
GLushort)((shoveComponents[1] * 31)+0.5) << 5) & 0x03E0;
5816 ((
GLushort)((shoveComponents[2] * 31)+0.5) << 10) & 0x7C00;
5818 ((
GLushort)((shoveComponents[3])+0.5) << 15) & 0x8000;
5822 const void *packedPixel,
GLfloat extractComponents[])
5839 extractComponents[0]= (
float)((
uint & 0xff000000) >> 24) / 255.0;
5840 extractComponents[1]= (
float)((
uint & 0x00ff0000) >> 16) / 255.0;
5841 extractComponents[2]= (
float)((
uint & 0x0000ff00) >> 8) / 255.0;
5842 extractComponents[3]= (
float)((
uint & 0x000000ff) ) / 255.0;
5846 int index,
void *packedPixel)
5853 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5854 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5855 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5856 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5860 ((
GLuint)((shoveComponents[0] * 255)+0.5) << 24) & 0xff000000;
5862 ((
GLuint)((shoveComponents[1] * 255)+0.5) << 16) & 0x00ff0000;
5864 ((
GLuint)((shoveComponents[2] * 255)+0.5) << 8) & 0x0000ff00;
5866 ((
GLuint)((shoveComponents[3] * 255)+0.5) ) & 0x000000ff;
5870 const void *packedPixel,
GLfloat extractComponents[])
5887 extractComponents[0]= (
float)((
uint & 0x000000FF) ) / 255.0;
5888 extractComponents[1]= (
float)((
uint & 0x0000FF00) >> 8) / 255.0;
5889 extractComponents[2]= (
float)((
uint & 0x00FF0000) >> 16) / 255.0;
5890 extractComponents[3]= (
float)((
uint & 0xFF000000) >> 24) / 255.0;
5894 int index,
void *packedPixel)
5901 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5902 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5903 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5904 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5908 ((
GLuint)((shoveComponents[0] * 255)+0.5) ) & 0x000000FF;
5910 ((
GLuint)((shoveComponents[1] * 255)+0.5) << 8) & 0x0000FF00;
5912 ((
GLuint)((shoveComponents[2] * 255)+0.5) << 16) & 0x00FF0000;
5914 ((
GLuint)((shoveComponents[3] * 255)+0.5) << 24) & 0xFF000000;
5918 const void *packedPixel,
GLfloat extractComponents[])
5935 extractComponents[0]= (
float)((
uint & 0xffc00000) >> 22) / 1023.0;
5936 extractComponents[1]= (
float)((
uint & 0x003ff000) >> 12) / 1023.0;
5937 extractComponents[2]= (
float)((
uint & 0x00000ffc) >> 2) / 1023.0;
5938 extractComponents[3]= (
float)((
uint & 0x00000003) ) / 3.0;
5942 int index,
void *packedPixel)
5949 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
5950 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
5951 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
5952 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
5956 ((
GLuint)((shoveComponents[0] * 1023)+0.5) << 22) & 0xffc00000;
5958 ((
GLuint)((shoveComponents[1] * 1023)+0.5) << 12) & 0x003ff000;
5960 ((
GLuint)((shoveComponents[2] * 1023)+0.5) << 2) & 0x00000ffc;
5962 ((
GLuint)((shoveComponents[3] * 3)+0.5) ) & 0x00000003;
5966 const void *packedPixel,
5984 extractComponents[0]= (
float)((
uint & 0x000003FF) ) / 1023.0;
5985 extractComponents[1]= (
float)((
uint & 0x000FFC00) >> 10) / 1023.0;
5986 extractComponents[2]= (
float)((
uint & 0x3FF00000) >> 20) / 1023.0;
5987 extractComponents[3]= (
float)((
uint & 0xC0000000) >> 30) / 3.0;
5992 int index,
void *packedPixel)
5999 assert(0.0 <= shoveComponents[0] && shoveComponents[0] <= 1.0);
6000 assert(0.0 <= shoveComponents[1] && shoveComponents[1] <= 1.0);
6001 assert(0.0 <= shoveComponents[2] && shoveComponents[2] <= 1.0);
6002 assert(0.0 <= shoveComponents[3] && shoveComponents[3] <= 1.0);
6006 ((
GLuint)((shoveComponents[0] * 1023)+0.5) ) & 0x000003FF;
6008 ((
GLuint)((shoveComponents[1] * 1023)+0.5) << 10) & 0x000FFC00;
6010 ((
GLuint)((shoveComponents[2] * 1023)+0.5) << 20) & 0x3FF00000;
6012 ((
GLuint)((shoveComponents[3] * 3)+0.5) << 30) & 0xC0000000;
6016 void (*extractPackedPixel)
6017 (
int,
const void *,
GLfloat []),
6018 void (*shovePackedPixel)
6019 (
const GLfloat [],
int,
void *),
6024 GLint pixelSizeInBytes,
6033 float extractTotals[4], extractMoreTotals[4], shoveTotals[4];
6038 const char *
temp, *temp0;
6041 int lowx_int, highx_int, lowy_int, highy_int;
6042 float x_percent, y_percent;
6043 float lowx_float, highx_float, lowy_float, highy_float;
6044 float convy_float, convx_float;
6045 int convy_int, convx_int;
6049 if (widthIn == widthOut*2 && heightIn == heightOut*2) {
6051 widthIn, heightIn, dataIn, dataOut,
6052 pixelSizeInBytes,rowSizeInBytes,isSwap);
6055 convy = (
float) heightIn/heightOut;
6056 convx = (
float) widthIn/widthOut;
6057 convy_int =
floor(convy);
6058 convy_float = convy - convy_int;
6059 convx_int =
floor(convx);
6060 convx_float = convx - convx_int;
6062 area = convx * convy;
6066 highy_int = convy_int;
6067 highy_float = convy_float;
6069 for (
i = 0;
i < heightOut;
i++) {
6072 highx_int = convx_int;
6073 highx_float = convx_float;
6075 for (
j = 0;
j < widthOut;
j++) {
6081 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
6084 xindex = lowx_int*pixelSizeInBytes;
6085 if((highy_int>lowy_int) && (highx_int>lowx_int)) {
6087 y_percent = 1-lowy_float;
6088 temp = (
const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
6089 percent = y_percent * (1-lowx_float);
6096 totals[
k] += *(
const GLushort*)temp_index * percent;
6100 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6102 totals[
k]+= extractTotals[
k] * percent;
6106 for(
l = lowx_int+1;
l < highx_int;
l++) {
6107 temp += pixelSizeInBytes;
6115 totals[
k] += *(
const GLushort*)temp_index * y_percent;
6119 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6121 totals[
k]+= extractTotals[
k] * y_percent;
6125 temp += pixelSizeInBytes;
6127 percent = y_percent * highx_float;
6134 totals[
k] += *(
const GLushort*)temp_index * percent;
6138 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6140 totals[
k]+= extractTotals[
k] * percent;
6146 y_percent = highy_float;
6147 percent = y_percent * (1-lowx_float);
6148 temp = (
const char *)dataIn + xindex + highy_int * rowSizeInBytes;
6155 totals[
k] += *(
const GLushort*)temp_index * percent;
6159 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6161 totals[
k]+= extractTotals[
k] * percent;
6164 for(
l = lowx_int+1;
l < highx_int;
l++) {
6165 temp += pixelSizeInBytes;
6173 totals[
k] += *(
const GLushort*)temp_index * y_percent;
6177 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6179 totals[
k]+= extractTotals[
k] * y_percent;
6184 temp += pixelSizeInBytes;
6185 percent = y_percent * highx_float;
6192 totals[
k] += *(
const GLushort*)temp_index * percent;
6196 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6198 totals[
k]+= extractTotals[
k] * percent;
6203 for(
m = lowy_int+1;
m < highy_int;
m++) {
6204 left += rowSizeInBytes;
6205 right += rowSizeInBytes;
6219 (*extractPackedPixel)(isSwap,
left,extractTotals);
6220 (*extractPackedPixel)(isSwap,
right,extractMoreTotals);
6222 totals[
k]+= (extractTotals[
k]*(1-lowx_float) +
6223 extractMoreTotals[
k]*highx_float);
6227 }
else if (highy_int > lowy_int) {
6228 x_percent = highx_float - lowx_float;
6229 percent = (1-lowy_float)*x_percent;
6230 temp = (
const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
6237 totals[
k] += *(
const GLushort*)temp_index * percent;
6241 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6243 totals[
k]+= extractTotals[
k] * percent;
6246 for(
m = lowy_int+1;
m < highy_int;
m++) {
6247 temp += rowSizeInBytes;
6255 totals[
k] += *(
const GLushort*)temp_index * x_percent;
6259 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6261 totals[
k]+= extractTotals[
k] * x_percent;
6265 percent = x_percent * highy_float;
6266 temp += rowSizeInBytes;
6273 totals[
k] += *(
const GLushort*)temp_index * percent;
6277 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6279 totals[
k]+= extractTotals[
k] * percent;
6282 }
else if (highx_int > lowx_int) {
6283 y_percent = highy_float - lowy_float;
6284 percent = (1-lowx_float)*y_percent;
6285 temp = (
const char *)dataIn + xindex + lowy_int*rowSizeInBytes;
6292 totals[
k] += *(
const GLushort*)temp_index * percent;
6296 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6298 totals[
k]+= extractTotals[
k] * percent;
6301 for (
l = lowx_int+1;
l < highx_int;
l++) {
6302 temp += pixelSizeInBytes;
6310 totals[
k] += *(
const GLushort*)temp_index * y_percent;
6314 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6316 totals[
k]+= extractTotals[
k] * y_percent;
6320 temp += pixelSizeInBytes;
6321 percent = y_percent * highx_float;
6328 totals[
k] += *(
const GLushort*)temp_index * percent;
6332 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6334 totals[
k]+= extractTotals[
k] * percent;
6338 percent = (highy_float-lowy_float)*(highx_float-lowx_float);
6339 temp = (
const char *)dataIn + xindex + lowy_int * rowSizeInBytes;
6346 totals[
k] += *(
const GLushort*)temp_index * percent;
6350 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6352 totals[
k]+= extractTotals[
k] * percent;
6358 temp0 = (
const char *)dataIn + xindex + pixelSizeInBytes + (lowy_int+1)*rowSizeInBytes;
6359 for (
m = lowy_int+1;
m < highy_int;
m++) {
6361 for(
l = lowx_int+1;
l < highx_int;
l++) {
6368 totals[
k] += *(
const GLushort*)temp_index;
6372 (*extractPackedPixel)(isSwap,
temp,extractTotals);
6374 totals[
k]+= extractTotals[
k];
6377 temp += pixelSizeInBytes;
6379 temp0 += rowSizeInBytes;
6382 outindex = (
j + (
i * widthOut));
6385 dataout[outindex +
k] = totals[
k]/
area;
6390 shoveTotals[
k]= totals[
k]/
area;
6392 (*shovePackedPixel)(shoveTotals,outindex,(
void *)dataOut);
6394 lowx_int = highx_int;
6395 lowx_float = highx_float;
6396 highx_int += convx_int;
6397 highx_float += convx_float;
6398 if(highx_float > 1) {
6403 lowy_int = highy_int;
6404 lowy_float = highy_float;
6405 highy_int += convy_int;
6406 highy_float += convy_float;
6407 if(highy_float > 1) {
6413 assert(outindex == (widthOut*heightOut - 1));
6420 void (*extractPackedPixel)
6421 (
int,
const void *,
GLfloat []),
6422 void (*shovePackedPixel)
6423 (
const GLfloat [],
int,
void *),
6425 const void *dataIn,
void *dataOut,
6426 GLint pixelSizeInBytes,
6434 rowSizeInBytes,isSwap);
6441 int halfWidth=
width / 2;
6442 int halfHeight=
height / 2;
6443 const char *
src= (
const char *) dataIn;
6444 int padBytes= rowSizeInBytes - (
width*pixelSizeInBytes);
6447 for (ii= 0; ii< halfHeight; ii++) {
6448 for (jj= 0; jj< halfWidth; jj++) {
6451 float extractTotals[
BOX4][4];
6454 (*extractPackedPixel)(isSwap,
src,
6455 &extractTotals[0][0]);
6456 (*extractPackedPixel)(isSwap,(
src+pixelSizeInBytes),
6457 &extractTotals[1][0]);
6458 (*extractPackedPixel)(isSwap,(
src+rowSizeInBytes),
6459 &extractTotals[2][0]);
6460 (*extractPackedPixel)(isSwap,
6461 (
src+rowSizeInBytes+pixelSizeInBytes),
6462 &extractTotals[3][0]);
6472 for (kk = 0; kk <
BOX4; kk++) {
6473 totals[
cc]+= extractTotals[kk][
cc];
6477 (*shovePackedPixel)(totals,outIndex,dataOut);
6481 src+= pixelSizeInBytes + pixelSizeInBytes;
6496 src+= rowSizeInBytes;
6501 assert(outIndex == halfWidth * halfHeight);
6506 void (*extractPackedPixel)
6507 (
int,
const void *,
GLfloat []),
6508 void (*shovePackedPixel)
6509 (
const GLfloat [],
int,
void *),
6511 const void *dataIn,
void *dataOut,
6512 GLint pixelSizeInBytes,
6515 int halfWidth=
width / 2;
6516 int halfHeight=
height / 2;
6517 const char *
src= (
const char *) dataIn;
6531 for (jj= 0; jj< halfWidth; jj++) {
6534 float extractTotals[
BOX2][4];
6538 (*extractPackedPixel)(isSwap,
src,
6539 &extractTotals[0][0]);
6540 (*extractPackedPixel)(isSwap,(
src+pixelSizeInBytes),
6541 &extractTotals[1][0]);
6550 for (kk = 0; kk <
BOX2; kk++) {
6551 totals[
cc]+= extractTotals[kk][
cc];
6555 (*shovePackedPixel)(totals,outIndex,dataOut);
6559 src+= pixelSizeInBytes + pixelSizeInBytes;
6563 int padBytes= rowSizeInBytes - (
width*pixelSizeInBytes);
6566 assert(
src == &((
const char *)dataIn)[rowSizeInBytes]);
6567 assert(outIndex == halfWidth * halfHeight);
6569 else if (
width == 1) {
6577 for (jj= 0; jj< halfHeight; jj++) {
6580 float extractTotals[
BOX2][4];
6584 (*extractPackedPixel)(isSwap,
src,
6585 &extractTotals[0][0]);
6586 (*extractPackedPixel)(isSwap,(
src+rowSizeInBytes),
6587 &extractTotals[1][0]);
6596 for (kk = 0; kk <
BOX2; kk++) {
6597 totals[
cc]+= extractTotals[kk][
cc];
6601 (*shovePackedPixel)(totals,outIndex,dataOut);
6604 src+= rowSizeInBytes + rowSizeInBytes;
6608 assert(outIndex == halfWidth * halfHeight);
6614#ifdef RESOLVE_3D_TEXTURE_SUPPORT
6630static TexImage3Dproc pTexImage3D = 0;
6632#if !defined(_WIN32) && !defined(__WIN32__)
6634# include <sys/types.h>
6647#if defined(_WIN32) || defined(__WIN32__)
6652 void *libHandle = dlopen(
"libgl.so",
RTLD_LAZY);
6653 pTexImage3D = (TexImage3Dproc) dlsym(libHandle,
"glTexImage3D" );
6655 pTexImage3D = (TexImage3Dproc) dlsym(libHandle,
"glTexImage3DEXT");
6669#define gluTexImage3D glTexImage3D
6688 const void *userImage,
GLushort *newImage)
6697 int elementsPerLine;
6710 groupsPerLine=
width;
6714 if (elementSize == 1) myswapBytes= 0;
6725 rowSize= groupsPerLine * groupSize;
6743 for (hh= 0; hh <
height; hh++) {
6746 for (ww= 0; ww < elementsPerLine; ww++) {
6748 float extractComponents[4];
6755 *iter2++ = (*iter) * 257;
6760 *iter2++ = *((
const GLbyte *) iter);
6763 *iter2++ = (*((
const GLbyte *) iter)) * 516;
6768 for (
k = 0;
k < 3;
k++) {
6769 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6774 for (
k = 0;
k < 3;
k++) {
6775 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6779 extract565(myswapBytes,iter,extractComponents);
6780 for (
k = 0;
k < 3;
k++) {
6781 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6786 for (
k = 0;
k < 3;
k++) {
6787 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6792 for (
k = 0;
k < 4;
k++) {
6793 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6798 for (
k = 0;
k < 4;
k++) {
6799 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6804 for (
k = 0;
k < 4;
k++) {
6805 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6810 for (
k = 0;
k < 4;
k++) {
6811 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6817 widget.
ub[0] = iter[1];
6818 widget.
ub[1] = iter[0];
6820 widget.
ub[0] = iter[0];
6821 widget.
ub[1] = iter[1];
6825 *iter2++ = widget.
s[0];
6828 *iter2++ = widget.
s[0]*2;
6831 *iter2++ = widget.
us[0];
6836 for (
k = 0;
k < 4;
k++) {
6837 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6842 for (
k = 0;
k < 4;
k++) {
6843 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6848 for (
k = 0;
k < 4;
k++) {
6849 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6854 for (
k = 0;
k < 4;
k++) {
6855 *iter2++ = (
GLushort)(extractComponents[
k]*65535);
6862 widget.
ub[0] = iter[3];
6863 widget.
ub[1] = iter[2];
6864 widget.
ub[2] = iter[1];
6865 widget.
ub[3] = iter[0];
6867 widget.
ub[0] = iter[0];
6868 widget.
ub[1] = iter[1];
6869 widget.
ub[2] = iter[2];
6870 widget.
ub[3] = iter[3];
6874 *iter2++ = widget.
f;
6876 *iter2++ = 65535 * widget.
f;
6880 *iter2++ = widget.
ui;
6882 *iter2++ = widget.
ui >> 16;
6886 *iter2++ = widget.
i;
6888 *iter2++ = widget.
i >> 15;
6927 float x, lowx, highx, convx, halfconvx;
6928 float y, lowy, highy, convy, halfconvy;
6929 float z, lowz, highz, convz, halfconvz;
6930 float xpercent,ypercent,zpercent;
6935 int i,
j,
d,
k,zint,yint,xint,xindex,yindex,zindex;
6938 convz = (
float) depthIn/depthOut;
6939 convy = (
float) heightIn/heightOut;
6940 convx = (
float) widthIn/widthOut;
6941 halfconvx = convx/2;
6942 halfconvy = convy/2;
6943 halfconvz = convz/2;
6944 for (
d = 0;
d < depthOut;
d++) {
6945 z = convz * (
d+0.5);
6946 if (depthIn > depthOut) {
6947 highz =
z + halfconvz;
6948 lowz =
z - halfconvz;
6953 for (
i = 0;
i < heightOut;
i++) {
6954 y = convy * (
i+0.5);
6955 if (heightIn > heightOut) {
6956 highy =
y + halfconvy;
6957 lowy =
y - halfconvy;
6962 for (
j = 0;
j < widthOut;
j++) {
6963 x = convx * (
j+0.5);
6964 if (widthIn > widthOut) {
6965 highx =
x + halfconvx;
6966 lowx =
x - halfconvx;
6977 totals[0] = totals[1] = totals[2] = totals[3] = 0.0;
6983 zindex = (zint + depthIn) % depthIn;
6984 if (highz < zint+1) {
6985 zpercent = highz -
z;
6987 zpercent = zint+1 -
z;
6993 yindex = (yint + heightIn) % heightIn;
6994 if (highy < yint+1) {
6995 ypercent = highy -
y;
6997 ypercent = yint+1 -
y;
7004 xindex = (xint + widthIn) % widthIn;
7005 if (highx < xint+1) {
7006 xpercent = highx -
x;
7008 xpercent = xint+1 -
x;
7011 percent = xpercent * ypercent * zpercent;
7014 temp = (xindex + (yindex*widthIn) +
7020 totals[
k] += dataIn[
temp +
k] * percent;
7035 temp = (
j + (
i * widthOut) +
7053 const GLushort *oldImage,
void *userImage)
7063 int elementsPerLine;
7075 groupsPerLine =
width;
7080 if (elementSize == 1) myswapBytes= 0;
7092 rowSize = groupsPerLine * groupSize;
7110 for (ii= 0; ii<
height; ii++) {
7113 for (jj = 0; jj < elementsPerLine; jj++) {
7115 float shoveComponents[4];
7122 *iter = *iter2++ >> 8;
7127 *((
GLbyte *) iter) = *iter2++;
7129 *((
GLbyte *) iter) = *iter2++ >> 9;
7133 for (
k = 0;
k < 3;
k++) {
7134 shoveComponents[
k]= *iter2++ / 65535.0;
7136 shove332(shoveComponents,0,(
void *)iter);
7139 for (
k = 0;
k < 3;
k++) {
7140 shoveComponents[
k]= *iter2++ / 65535.0;
7145 for (
k = 0;
k < 3;
k++) {
7146 shoveComponents[
k]= *iter2++ / 65535.0;
7148 shove565(shoveComponents,0,(
void *)&widget.
us[0]);
7150 iter[0] = widget.
ub[1];
7151 iter[1] = widget.
ub[0];
7158 for (
k = 0;
k < 3;
k++) {
7159 shoveComponents[
k]= *iter2++ / 65535.0;
7163 iter[0] = widget.
ub[1];
7164 iter[1] = widget.
ub[0];
7171 for (
k = 0;
k < 4;
k++) {
7172 shoveComponents[
k]= *iter2++ / 65535.0;
7174 shove4444(shoveComponents,0,(
void *)&widget.
us[0]);
7176 iter[0] = widget.
ub[1];
7177 iter[1] = widget.
ub[0];
7183 for (
k = 0;
k < 4;
k++) {
7184 shoveComponents[
k]= *iter2++ / 65535.0;
7188 iter[0] = widget.
ub[1];
7189 iter[1] = widget.
ub[0];
7195 for (
k = 0;
k < 4;
k++) {
7196 shoveComponents[
k]= *iter2++ / 65535.0;
7198 shove5551(shoveComponents,0,(
void *)&widget.
us[0]);
7200 iter[0] = widget.
ub[1];
7201 iter[1] = widget.
ub[0];
7207 for (
k = 0;
k < 4;
k++) {
7208 shoveComponents[
k]= *iter2++ / 65535.0;
7212 iter[0] = widget.
ub[1];
7213 iter[1] = widget.
ub[0];
7222 widget.
s[0] = *iter2++;
7224 widget.
s[0] = *iter2++ >> 1;
7227 widget.
us[0] = *iter2++;
7230 iter[0] = widget.
ub[1];
7231 iter[1] = widget.
ub[0];
7233 iter[0] = widget.
ub[0];
7234 iter[1] = widget.
ub[1];
7238 for (
k = 0;
k < 4;
k++) {
7239 shoveComponents[
k]= *iter2++ / 65535.0;
7243 iter[3] = widget.
ub[0];
7244 iter[2] = widget.
ub[1];
7245 iter[1] = widget.
ub[2];
7246 iter[0] = widget.
ub[3];
7252 for (
k = 0;
k < 4;
k++) {
7253 shoveComponents[
k]= *iter2++ / 65535.0;
7257 iter[3] = widget.
ub[0];
7258 iter[2] = widget.
ub[1];
7259 iter[1] = widget.
ub[2];
7260 iter[0] = widget.
ub[3];
7266 for (
k = 0;
k < 4;
k++) {
7267 shoveComponents[
k]= *iter2++ / 65535.0;
7271 iter[3] = widget.
ub[0];
7272 iter[2] = widget.
ub[1];
7273 iter[1] = widget.
ub[2];
7274 iter[0] = widget.
ub[3];
7280 for (
k = 0;
k < 4;
k++) {
7281 shoveComponents[
k]= *iter2++ / 65535.0;
7285 iter[3] = widget.
ub[0];
7286 iter[2] = widget.
ub[1];
7287 iter[1] = widget.
ub[2];
7288 iter[0] = widget.
ub[3];
7298 widget.
f = *iter2++;
7300 widget.
f = *iter2++ / (
float) 65535.0;
7304 widget.
ui = *iter2++;
7306 widget.
ui = (
unsigned int) *iter2++ * 65537;
7310 widget.
i = *iter2++;
7312 widget.
i = ((
unsigned int) *iter2++ * 65537)/2;
7316 iter[3] = widget.
ub[0];
7317 iter[2] = widget.
ub[1];
7318 iter[1] = widget.
ub[2];
7319 iter[0] = widget.
ub[3];
7321 iter[0] = widget.
ub[0];
7322 iter[1] = widget.
ub[1];
7323 iter[2] = widget.
ub[2];
7324 iter[3] = widget.
ub[3];
7358 GLenum typeIn,
const void *dataIn,
7360 GLenum typeOut,
void *dataOut)
7363 GLushort *beforeImage, *afterImage;
7366 if (widthIn == 0 || heightIn == 0 || depthIn == 0 ||
7367 widthOut == 0 || heightOut == 0 || depthOut == 0) {
7371 if (widthIn < 0 || heightIn < 0 || depthIn < 0 ||
7372 widthOut < 0 || heightOut < 0 || depthOut < 0) {
7391 if (beforeImage ==
NULL || afterImage ==
NULL) {
7399 dataIn, beforeImage);
7402 widthOut,heightOut,depthOut,afterImage);
7405 free((
void *) beforeImage);
7406 free((
void *) afterImage);
7423 GLint widthAtLevelOne= (widthPowerOf2 > 1) ?
7424 widthPowerOf2 >> 1 :
7426 GLint heightAtLevelOne= (heightPowerOf2 > 1) ?
7427 heightPowerOf2 >> 1 :
7429 GLint depthAtLevelOne= (depthPowerOf2 > 1) ?
7430 depthPowerOf2 >> 1 :
7433 assert(widthAtLevelOne > 0);
7434 assert(heightAtLevelOne > 0);
7435 assert(depthAtLevelOne > 0);
7441 widthAtLevelOne,heightAtLevelOne,depthAtLevelOne,
7445 if (proxyWidth == 0) {
7446 if (widthPowerOf2 == 1 && heightPowerOf2 == 1 &&
7447 depthPowerOf2 == 1) {
7448 *newWidth= *newHeight= *newDepth= 1;
7451 widthPowerOf2= widthAtLevelOne;
7452 heightPowerOf2= heightAtLevelOne;
7453 depthPowerOf2= depthAtLevelOne;
7456 }
while (proxyWidth == 0);
7460 *newWidth= widthPowerOf2;
7461 *newHeight= heightPowerOf2;
7462 *newDepth= depthPowerOf2;
7467 void (*extractPackedPixel)
7468 (
int,
const void *,
GLfloat []),
7469 void (*shovePackedPixel)
7470 (
const GLfloat [],
int,
void *),
7472 const void *dataIn,
void *dataOut,
7473 GLint pixelSizeInBytes,
7474 GLint rowSizeInBytes,
7475 GLint imageSizeInBytes,
7479 int halfWidth=
width / 2;
7480 int halfHeight=
height / 2;
7481 int halfDepth=
depth / 2;
7482 const char *
src= (
const char *)dataIn;
7491 for (ii= 0; ii< halfDepth; ii++) {
7493 float extractTotals[
BOX2][4];
7496 (*extractPackedPixel)(isSwap,
src,&extractTotals[0][0]);
7497 (*extractPackedPixel)(isSwap,(
src+imageSizeInBytes),
7498 &extractTotals[1][0]);
7507 for (kk = 0; kk <
BOX2; kk++) {
7508 totals[
cc]+= extractTotals[kk][
cc];
7513 (*shovePackedPixel)(totals,outIndex,dataOut);
7516 src+= imageSizeInBytes + imageSizeInBytes;
7522 for (ii= 0; ii< halfDepth; ii++) {
7523 for (jj= 0; jj< halfWidth; jj++) {
7525 float extractTotals[
BOX4][4];
7528 (*extractPackedPixel)(isSwap,
src,
7529 &extractTotals[0][0]);
7530 (*extractPackedPixel)(isSwap,(
src+pixelSizeInBytes),
7531 &extractTotals[1][0]);
7532 (*extractPackedPixel)(isSwap,(
src+imageSizeInBytes),
7533 &extractTotals[2][0]);
7534 (*extractPackedPixel)(isSwap,
7535 (
src+imageSizeInBytes+pixelSizeInBytes),
7536 &extractTotals[3][0]);
7546 for (kk = 0; kk <
BOX4; kk++) {
7547 totals[
cc]+= extractTotals[kk][
cc];
7551 (*shovePackedPixel)(totals,outIndex,dataOut);
7555 src+= imageSizeInBytes + imageSizeInBytes;
7561 else if (
width == 1) {
7564 for (ii= 0; ii< halfDepth; ii++) {
7565 for (jj= 0; jj< halfHeight; jj++) {
7567 float extractTotals[
BOX4][4];
7570 (*extractPackedPixel)(isSwap,
src,
7571 &extractTotals[0][0]);
7572 (*extractPackedPixel)(isSwap,(
src+rowSizeInBytes),
7573 &extractTotals[1][0]);
7574 (*extractPackedPixel)(isSwap,(
src+imageSizeInBytes),
7575 &extractTotals[2][0]);
7576 (*extractPackedPixel)(isSwap,
7577 (
src+imageSizeInBytes+rowSizeInBytes),
7578 &extractTotals[3][0]);
7588 for (kk = 0; kk <
BOX4; kk++) {
7589 totals[
cc]+= extractTotals[kk][
cc];
7593 (*shovePackedPixel)(totals,outIndex,dataOut);
7598 src+= imageSizeInBytes + imageSizeInBytes;
7607 void (*extractPackedPixel)
7608 (
int,
const void *,
GLfloat []),
7609 void (*shovePackedPixel)
7610 (
const GLfloat [],
int,
void *),
7612 const void *dataIn,
void *dataOut,
7613 GLint pixelSizeInBytes,
7614 GLint rowSizeInBytes,
7615 GLint imageSizeInBytes,
7623 rowSizeInBytes,isSwap);
7631 extractPackedPixel,shovePackedPixel,
7633 pixelSizeInBytes, rowSizeInBytes,
7634 imageSizeInBytes, isSwap);
7640 int halfWidth=
width / 2;
7641 int halfHeight=
height / 2;
7642 int halfDepth=
depth / 2;
7643 const char *
src= (
const char *) dataIn;
7644 int padBytes= rowSizeInBytes - (
width*pixelSizeInBytes);
7647 for (dd= 0; dd < halfDepth; dd++) {
7648 for (ii= 0; ii< halfHeight; ii++) {
7649 for (jj= 0; jj< halfWidth; jj++) {
7652 float extractTotals[
BOX8][4];
7655 (*extractPackedPixel)(isSwap,
src,
7656 &extractTotals[0][0]);
7657 (*extractPackedPixel)(isSwap,(
src+pixelSizeInBytes),
7658 &extractTotals[1][0]);
7659 (*extractPackedPixel)(isSwap,(
src+rowSizeInBytes),
7660 &extractTotals[2][0]);
7661 (*extractPackedPixel)(isSwap,
7662 (
src+rowSizeInBytes+pixelSizeInBytes),
7663 &extractTotals[3][0]);
7665 (*extractPackedPixel)(isSwap,(
src+imageSizeInBytes),
7666 &extractTotals[4][0]);
7667 (*extractPackedPixel)(isSwap,(
src+pixelSizeInBytes+imageSizeInBytes),
7668 &extractTotals[5][0]);
7669 (*extractPackedPixel)(isSwap,(
src+rowSizeInBytes+imageSizeInBytes),
7670 &extractTotals[6][0]);
7671 (*extractPackedPixel)(isSwap,
7672 (
src+rowSizeInBytes+pixelSizeInBytes+imageSizeInBytes),
7673 &extractTotals[7][0]);
7685 for (kk = 0; kk <
BOX8; kk++) {
7686 totals[
cc]+= extractTotals[kk][
cc];
7690 (*shovePackedPixel)(totals,outIndex,dataOut);
7694 src+= pixelSizeInBytes + pixelSizeInBytes;
7709 src+= rowSizeInBytes;
7712 src+= imageSizeInBytes;
7717 assert(outIndex == halfWidth * halfHeight * halfDepth);
7734 GLint newWidth, newHeight, newDepth;
7736 const void *usersImage;
7737 void *srcImage, *dstImage;
7742 GLint myswapBytes, groupsPerLine, elementSize, groupSize;
7751 srcImage = dstImage =
NULL;
7753 newWidth= widthPowerOf2;
7754 newHeight= heightPowerOf2;
7755 newDepth= depthPowerOf2;
7770 groupsPerLine =
width;
7774 groupSize = elementSize * cmpts;
7775 if (elementSize == 1) myswapBytes = 0;
7786 rowSize = groupsPerLine * groupSize;
7809 if (baseLevel <=
level &&
level <= maxLevel) {
7825 int nextWidth= newWidth/2;
7826 int nextHeight= newHeight/2;
7827 int nextDepth= newDepth/2;
7830 if (nextWidth < 1) nextWidth= 1;
7831 if (nextHeight < 1) nextHeight= 1;
7832 if (nextDepth < 1) nextDepth= 1;
7878 if (dstImage ==
NULL) {
7894 usersImage,dstImage,elementSize,groupSize,rowSize,
7899 elementSize,rowSize,groupSize);
7906 usersImage,dstImage,elementSize,groupSize,rowSize,
7911 elementSize,rowSize,groupSize);
7918 usersImage,dstImage,elementSize,groupSize,rowSize,
7923 elementSize,rowSize,groupSize,myswapBytes);
7930 usersImage,dstImage,elementSize,groupSize,rowSize,
7935 elementSize,rowSize,groupSize,myswapBytes);
7942 usersImage,dstImage,elementSize,groupSize,rowSize,
7947 elementSize,rowSize,groupSize,myswapBytes);
7954 usersImage,dstImage,elementSize,groupSize,rowSize,
7959 elementSize,rowSize,groupSize,myswapBytes);
7966 usersImage,dstImage,elementSize,groupSize,rowSize,
7971 elementSize,rowSize,groupSize,myswapBytes);
7978 elementSize,rowSize,
imageSize,myswapBytes);
7984 elementSize,rowSize,
imageSize,myswapBytes);
7989 elementSize,rowSize,
imageSize,myswapBytes);
7994 elementSize,rowSize,
imageSize,myswapBytes);
7999 elementSize,rowSize,
imageSize,myswapBytes);
8004 elementSize,rowSize,
imageSize,myswapBytes);
8009 elementSize,rowSize,
imageSize,myswapBytes);
8014 elementSize,rowSize,
imageSize,myswapBytes);
8019 elementSize,rowSize,
imageSize,myswapBytes);
8024 elementSize,rowSize,
imageSize,myswapBytes);
8029 elementSize,rowSize,
imageSize,myswapBytes);
8034 elementSize,rowSize,
imageSize,myswapBytes);
8044 if (newWidth < 1) newWidth= 1;
8045 if (newHeight < 1) newHeight= 1;
8046 if (newDepth < 1) newDepth= 1;
8049 rowSize = newWidth * groupSize;
8097 if (dstImage ==
NULL) {
8109 level = userLevel+1;
8156 if (dstImage ==
NULL) {
8170 newWidth, newHeight, newDepth,
type, dstImage);
8173 rowSize = newWidth * groupSize;
8180 int nextWidth= newWidth/2;
8181 int nextHeight= newHeight/2;
8182 int nextDepth= newDepth/2;
8183 if (nextWidth < 1) nextWidth= 1;
8184 if (nextHeight < 1) nextHeight= 1;
8185 if (nextDepth < 1) nextDepth= 1;
8232 if (dstImage ==
NULL) {
8249 if (baseLevel <=
level &&
level <= maxLevel) {
8259 newWidth,newHeight,newDepth,
8260 srcImage,dstImage,elementSize,groupSize,rowSize,
8265 elementSize,rowSize,groupSize);
8271 newWidth,newHeight,newDepth,
8272 srcImage,dstImage,elementSize,groupSize,rowSize,
8277 elementSize,rowSize,groupSize);
8283 newWidth,newHeight,newDepth,
8284 srcImage,dstImage,elementSize,groupSize,rowSize,
8289 elementSize,rowSize,groupSize,myswapBytes);
8295 newWidth,newHeight,newDepth,
8296 srcImage,dstImage,elementSize,groupSize,rowSize,
8301 elementSize,rowSize,groupSize,myswapBytes);
8307 newWidth,newHeight,newDepth,
8308 srcImage,dstImage,elementSize,groupSize,rowSize,
8313 elementSize,rowSize,groupSize,myswapBytes);
8319 newWidth,newHeight,newDepth,
8320 srcImage,dstImage,elementSize,groupSize,rowSize,
8325 elementSize,rowSize,groupSize,myswapBytes);
8331 newWidth,newHeight,newDepth,
8332 srcImage,dstImage,elementSize,groupSize,rowSize,
8337 elementSize,rowSize,groupSize,myswapBytes);
8342 newWidth,newHeight,newDepth,
8343 srcImage,dstImage,elementSize,rowSize,
8348 newWidth,newHeight,newDepth,
8349 srcImage,dstImage,elementSize,rowSize,
8354 newWidth,newHeight,newDepth,
8355 srcImage,dstImage,elementSize,rowSize,
8360 newWidth,newHeight,newDepth,
8361 srcImage,dstImage,elementSize,rowSize,
8366 newWidth,newHeight,newDepth,
8367 srcImage,dstImage,elementSize,rowSize,
8372 newWidth,newHeight,newDepth,
8373 srcImage,dstImage,elementSize,rowSize,
8378 newWidth,newHeight,newDepth,
8379 srcImage,dstImage,elementSize,rowSize,
8384 newWidth,newHeight,newDepth,
8385 srcImage,dstImage,elementSize,rowSize,
8390 newWidth,newHeight,newDepth,
8391 srcImage,dstImage,elementSize,rowSize,
8396 newWidth,newHeight,newDepth,
8397 srcImage,dstImage,elementSize,rowSize,
8402 newWidth,newHeight,newDepth,
8403 srcImage,dstImage,elementSize,rowSize,
8408 newWidth,newHeight,newDepth,
8409 srcImage,dstImage,elementSize,rowSize,
8419 if (newWidth > 1) { newWidth /= 2; rowSize /= 2;}
8420 if (newHeight > 1) { newHeight /= 2;
imageSize = rowSize * newHeight; }
8421 if (newDepth > 1) newDepth /= 2;
8424 if (baseLevel <=
level &&
level <= maxLevel) {
8426 newDepth,0,
format,
type, (
void *) srcImage);
8455 if (rc != 0)
return rc;
8479 userLevel, baseLevel, maxLevel,
8488 GLint widthPowerOf2, heightPowerOf2, depthPowerOf2;
8492 if (rc != 0)
return rc;
8503 &widthPowerOf2,&heightPowerOf2,&depthPowerOf2);
8513 widthPowerOf2, heightPowerOf2,
8580 sshort= *(
const GLshort *)sitem;
8626 sint= *(
const GLint *)sitem;
8629 assert(sint <= 0x7fffffff);
8666 void (*shove)(
GLdouble,
int,
void *),
8668 const void *dataIn,
void *dataOut,
8669 GLint elementSizeInBytes,
8670 GLint groupSizeInBytes,
8671 GLint rowSizeInBytes,
8672 GLint imageSizeInBytes,
8676 int halfWidth=
width / 2;
8677 int halfHeight=
height / 2;
8678 int halfDepth=
depth / 2;
8679 const char *
src= (
const char *)dataIn;
8680 int rowPadBytes= rowSizeInBytes - (
width * groupSizeInBytes);
8681 int imagePadBytes= imageSizeInBytes - (
width*
height*groupSizeInBytes);
8691 for (ii= 0; ii< halfDepth; ii++) {
8696 double extractTotals[
BOX2][4];
8699 extractTotals[0][
cc]= (*extract)(isSwap,
src);
8700 extractTotals[1][
cc]= (*extract)(isSwap,(
src+imageSizeInBytes));
8707 for (kk = 0; kk <
BOX2; kk++) {
8708 totals[
cc]+= extractTotals[kk][
cc];
8712 (*shove)(totals[
cc],outIndex,dataOut);
8714 src+= elementSizeInBytes;
8718 src+= rowSizeInBytes;
8728 for (ii= 0; ii< halfDepth; ii++) {
8729 for (jj= 0; jj< halfWidth; jj++) {
8735 double extractTotals[
BOX4][4];
8737 extractTotals[0][
cc]=(*extract)(isSwap,
src);
8738 extractTotals[1][
cc]=(*extract)(isSwap,
8739 (
src+groupSizeInBytes));
8740 extractTotals[2][
cc]=(*extract)(isSwap,
8741 (
src+imageSizeInBytes));
8742 extractTotals[3][
cc]=(*extract)(isSwap,
8743 (
src+imageSizeInBytes+groupSizeInBytes));
8751 for (kk = 0; kk <
BOX4; kk++) {
8752 totals[
cc]+= extractTotals[kk][
cc];
8756 (*shove)(totals[
cc],outIndex,dataOut);
8759 src+= elementSizeInBytes;
8763 src+= groupSizeInBytes;
8767 src+= rowSizeInBytes;
8773 else if (
width == 1) {
8777 for (ii= 0; ii< halfDepth; ii++) {
8778 for (jj= 0; jj< halfHeight; jj++) {
8784 double extractTotals[
BOX4][4];
8786 extractTotals[0][
cc]=(*extract)(isSwap,
src);
8787 extractTotals[1][
cc]=(*extract)(isSwap,
8788 (
src+rowSizeInBytes));
8789 extractTotals[2][
cc]=(*extract)(isSwap,
8790 (
src+imageSizeInBytes));
8791 extractTotals[3][
cc]=(*extract)(isSwap,
8792 (
src+imageSizeInBytes+rowSizeInBytes));
8800 for (kk = 0; kk <
BOX4; kk++) {
8801 totals[
cc]+= extractTotals[kk][
cc];
8805 (*shove)(totals[
cc],outIndex,dataOut);
8808 src+= elementSizeInBytes;
8813 src+= rowSizeInBytes;
8815 src+= imagePadBytes;
8817 src+= imageSizeInBytes;
8828 void (*shove)(
GLdouble,
int,
void *),
8830 const void *dataIn,
void *dataOut,
8831 GLint elementSizeInBytes,
8832 GLint groupSizeInBytes,
8833 GLint rowSizeInBytes,
8834 GLint imageSizeInBytes,
8844 dataIn, dataOut, elementSizeInBytes, groupSizeInBytes,
8845 rowSizeInBytes, imageSizeInBytes, isSwap);
8851 int halfWidth=
width / 2;
8852 int halfHeight=
height / 2;
8853 int halfDepth=
depth / 2;
8854 const char *
src= (
const char *) dataIn;
8855 int rowPadBytes= rowSizeInBytes - (
width*groupSizeInBytes);
8856 int imagePadBytes= imageSizeInBytes - (
width*
height*groupSizeInBytes);
8859 for (dd= 0; dd < halfDepth; dd++) {
8860 for (ii= 0; ii< halfHeight; ii++) {
8861 for (jj= 0; jj< halfWidth; jj++) {
8868 double extractTotals[
BOX8][4];
8870 extractTotals[0][
cc]= (*extract)(isSwap,
src);
8871 extractTotals[1][
cc]= (*extract)(isSwap,
8872 (
src+groupSizeInBytes));
8873 extractTotals[2][
cc]= (*extract)(isSwap,
8874 (
src+rowSizeInBytes));
8875 extractTotals[3][
cc]= (*extract)(isSwap,
8876 (
src+rowSizeInBytes+groupSizeInBytes));
8878 extractTotals[4][
cc]= (*extract)(isSwap,
8879 (
src+imageSizeInBytes));
8881 extractTotals[5][
cc]= (*extract)(isSwap,
8882 (
src+groupSizeInBytes+imageSizeInBytes));
8883 extractTotals[6][
cc]= (*extract)(isSwap,
8884 (
src+rowSizeInBytes+imageSizeInBytes));
8885 extractTotals[7][
cc]= (*extract)(isSwap,
8886 (
src+rowSizeInBytes+groupSizeInBytes+imageSizeInBytes));
8896 for (kk = 0; kk <
BOX8; kk++) {
8897 totals[
cc]+= extractTotals[kk][
cc];
8901 (*shove)(totals[
cc],outIndex,dataOut);
8905 src+= elementSizeInBytes;
8909 src+= groupSizeInBytes;
8924 src+= rowSizeInBytes;
8928 src+= imagePadBytes;
8930 src+= imageSizeInBytes;
size_t const element_size
#define GLU_INVALID_OPERATION
#define GLU_OUT_OF_MEMORY
#define GLU_INVALID_VALUE
unsigned int(__cdecl typeof(jpeg_read_scanlines))(struct jpeg_decompress_struct *
GLint GLint GLsizei GLsizei GLsizei GLint border
GLAPI void GLAPIENTRY glGetTexLevelParameteriv(GLenum target, GLint level, GLenum pname, GLint *params)
#define GL_MAX_TEXTURE_SIZE
#define GL_PROXY_TEXTURE_3D
#define GL_UNPACK_SWAP_BYTES
GLint GLint GLsizei GLsizei GLsizei depth
#define GL_PACK_SKIP_IMAGES
#define GL_PACK_LSB_FIRST
#define GL_UNSIGNED_SHORT_4_4_4_4_REV
GLAPI void GLAPIENTRY glTexImage2D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLsizei height, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
#define GL_UNSIGNED_SHORT
#define GL_PACK_IMAGE_HEIGHT
GLint GLint GLint GLint GLint x
#define GL_LUMINANCE_ALPHA
#define GL_PROXY_TEXTURE_2D
#define GL_PACK_ROW_LENGTH
GLint GLint GLsizei GLsizei GLsizei GLint GLenum GLenum const GLvoid * pixels
#define GL_PACK_ALIGNMENT
#define GL_UNSIGNED_SHORT_5_6_5_REV
GLuint GLuint GLsizei GLenum type
#define GL_UNSIGNED_INT_10_10_10_2
#define GL_PACK_SKIP_PIXELS
#define GL_UNPACK_SKIP_IMAGES
#define GL_UNSIGNED_SHORT_5_5_5_1
GLint GLint GLint GLint GLint GLint y
#define GL_UNPACK_SKIP_PIXELS
#define GL_UNPACK_ALIGNMENT
#define GL_PACK_SKIP_ROWS
#define GL_PACK_SWAP_BYTES
#define GL_UNPACK_IMAGE_HEIGHT
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei const GLvoid * data
GLint GLint GLsizei GLsizei height
#define GL_DEPTH_COMPONENT
#define GL_UNPACK_SKIP_ROWS
#define GL_UNSIGNED_INT_8_8_8_8
GLint GLint GLsizei width
#define GL_UNSIGNED_BYTE_3_3_2
#define GL_UNSIGNED_SHORT_4_4_4_4
GLAPI void GLAPIENTRY glPixelStorei(GLenum pname, GLint param)
GLAPI void GLAPIENTRY glTexImage1D(GLenum target, GLint level, GLint internalFormat, GLsizei width, GLint border, GLenum format, GLenum type, const GLvoid *pixels)
#define GL_UNSIGNED_SHORT_1_5_5_5_REV
#define GL_PROXY_TEXTURE_1D
GLAPI void GLAPIENTRY glGetIntegerv(GLenum pname, GLint *params)
#define GL_UNSIGNED_INT_8_8_8_8_REV
#define GL_UNSIGNED_BYTE_2_3_3_REV
GLint GLenum GLsizei GLsizei GLsizei GLint GLsizei imageSize
#define GL_UNSIGNED_SHORT_5_6_5
#define GL_UNSIGNED_INT_2_10_10_10_REV
GLAPI const GLubyte *GLAPIENTRY glGetString(GLenum name)
#define GL_UNPACK_LSB_FIRST
#define GL_UNPACK_ROW_LENGTH
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Z_ARB
GLenum GLenum GLuint components
#define GL_TEXTURE_CUBE_MAP_POSITIVE_X_ARB
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Y_ARB
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_Y_ARB
GLboolean GLboolean GLboolean b
#define GL_TEXTURE_CUBE_MAP_POSITIVE_Z_ARB
GLenum GLuint GLenum GLsizei const GLchar * buf
#define GL_PROXY_TEXTURE_CUBE_MAP_ARB
#define GL_TEXTURE_CUBE_MAP_NEGATIVE_X_ARB
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint GLint GLint j
#define gluBuild1DMipmaps
#define gluBuild2DMipmapLevels
#define gluBuild3DMipmaps
#define gluBuild1DMipmapLevels
#define gluBuild2DMipmaps
#define gluBuild3DMipmapLevels
_Check_return_ _CRTIMP double __cdecl floor(_In_ double x)
_Check_return_ double __cdecl strtod(_In_z_ const char *_Str, _Out_opt_ _Deref_post_z_ char **_EndPtr)
static void shoveSbyte(GLdouble, int, void *)
static void scaleInternalPackedPixel(int, void(*)(int, const void *, GLfloat[]), void(*)(const GLfloat[], int, void *), GLint, GLint, const void *, GLint, GLint, void *, GLint, GLint, GLint)
static void halveImagePackedPixelSlice(int components, void(*extractPackedPixel)(int, const void *, GLfloat[]), void(*shovePackedPixel)(const GLfloat[], int, void *), GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, GLint pixelSizeInBytes, GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap)
static void scale_internal(GLint components, GLint widthin, GLint heightin, const GLushort *datain, GLint widthout, GLint heightout, GLushort *dataout)
static void extract1010102(int, const void *, GLfloat[])
static void halve1Dimage_ubyte(GLint, GLuint, GLuint, const GLubyte *, GLubyte *, GLint, GLint, GLint)
static void halveImage_short(GLint components, GLuint width, GLuint height, const GLshort *datain, GLshort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static int bitmapBuild2DMipmaps(GLenum target, GLint internalFormat, GLint width, GLint height, GLenum format, GLenum type, const void *data)
static GLdouble extractFloat(int, const void *)
static void shove565rev(const GLfloat[], int, void *)
static void shoveFloat(GLdouble, int, void *)
static void shove8888(const GLfloat[], int, void *)
static void shoveUshort(GLdouble, int, void *)
static GLboolean isTypePackedPixel(GLenum)
static int nearestPower(GLuint value)
static GLint elements_per_group(GLenum format, GLenum type)
static void fillImage3D(const PixelStorageModes *, GLint, GLint, GLint, GLenum, GLenum, GLboolean, const void *, GLushort *)
static void halveImage(GLint components, GLuint width, GLuint height, const GLushort *datain, GLushort *dataout)
static void extract332(int, const void *, GLfloat[])
static void halve1Dimage_float(GLint, GLuint, GLuint, const GLfloat *, GLfloat *, GLint, GLint, GLint, GLint)
static void scaleInternal3D(GLint, GLint, GLint, GLint, const GLushort *, GLint, GLint, GLint, GLushort *)
static void extract233rev(int, const void *, GLfloat[])
static void emptyImage3D(const PixelStorageModes *, GLint, GLint, GLint, GLenum, GLenum, GLboolean, const GLushort *, void *)
static int computeLog(GLuint value)
static void halve1Dimage_byte(GLint, GLuint, GLuint, const GLbyte *, GLbyte *, GLint, GLint, GLint)
static void halve1Dimage_short(GLint, GLuint, GLuint, const GLshort *, GLshort *, GLint, GLint, GLint, GLint)
static void shoveSint(GLdouble, int, void *)
static void halve1Dimage_int(GLint, GLuint, GLuint, const GLint *, GLint *, GLint, GLint, GLint, GLint)
static void shove1010102(const GLfloat[], int, void *)
static void scale_internal_float(GLint components, GLint widthin, GLint heightin, const GLfloat *datain, GLint widthout, GLint heightout, GLfloat *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void scale_internal_ushort(GLint components, GLint widthin, GLint heightin, const GLushort *datain, GLint widthout, GLint heightout, GLushort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
#define __GLU_SWAP_IMAGE(a, b)
static void halveImage_byte(GLint components, GLuint width, GLuint height, const GLbyte *datain, GLbyte *dataout, GLint element_size, GLint ysize, GLint group_size)
static void halveImagePackedPixel(int, void(*)(int, const void *, GLfloat[]), void(*)(const GLfloat[], int, void *), GLint, GLint, const void *, void *, GLint, GLint, GLint)
static void extract1555rev(int, const void *, GLfloat[])
static GLint imageSize3D(GLint, GLint, GLint, GLenum, GLenum)
static void halve1Dimage_ushort(GLint, GLuint, GLuint, const GLushort *, GLushort *, GLint, GLint, GLint, GLint)
static GLdouble extractUint(int, const void *)
static int gluBuild2DMipmapLevelsCore(GLenum, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLint, GLint, GLint, const void *)
static GLboolean isLegalFormatForPackedPixelType(GLenum, GLenum)
static void extract4444(int, const void *, GLfloat[])
static void shoveUint(GLdouble, int, void *)
static void extract8888(int, const void *, GLfloat[])
static GLint is_index(GLenum format)
static void halveImageSlice(int, GLdouble(*)(int, const void *), void(*)(GLdouble, int, void *), GLint, GLint, GLint, const void *, void *, GLint, GLint, GLint, GLint, GLint)
static void halve1Dimage_uint(GLint, GLuint, GLuint, const GLuint *, GLuint *, GLint, GLint, GLint, GLint)
static void fill_image(const PixelStorageModes *, GLint width, GLint height, GLenum format, GLenum type, GLboolean index_format, const void *userdata, GLushort *newimage)
static int checkMipmapArgs(GLenum, GLenum, GLenum)
static GLboolean legalFormat(GLenum)
static void extract5551(int, const void *, GLfloat[])
static void extract8888rev(int, const void *, GLfloat[])
static void extract565rev(int, const void *, GLfloat[])
static void scale_internal_short(GLint components, GLint widthin, GLint heightin, const GLshort *datain, GLint widthout, GLint heightout, GLshort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void shove565(const GLfloat[], int, void *)
static void shove1555rev(const GLfloat[], int, void *)
static void extract2101010rev(int, const void *, GLfloat[])
static GLdouble extractSbyte(int, const void *)
#define __GLU_SWAP_2_BYTES(s)
static void shove2101010rev(const GLfloat[], int, void *)
static GLdouble extractSint(int, const void *)
static int gluBuild1DMipmapLevelsCore(GLenum, GLint, GLsizei, GLsizei, GLenum, GLenum, GLint, GLint, GLint, const void *)
static void shoveSshort(GLdouble, int, void *)
static void scale_internal_byte(GLint components, GLint widthin, GLint heightin, const GLbyte *datain, GLint widthout, GLint heightout, GLbyte *dataout, GLint element_size, GLint ysize, GLint group_size)
static void halve1DimagePackedPixel(int, void(*)(int, const void *, GLfloat[]), void(*)(const GLfloat[], int, void *), GLint, GLint, const void *, void *, GLint, GLint, GLint)
static GLdouble extractUshort(int, const void *)
static void retrieveStoreModes(PixelStorageModes *psm)
static GLfloat bytes_per_element(GLenum type)
static void closestFit3D(GLenum target, GLint width, GLint height, GLint depth, GLint internalFormat, GLenum format, GLenum type, GLint *newWidth, GLint *newHeight, GLint *newDepth)
static GLdouble extractUbyte(int, const void *)
static GLboolean legalType(GLenum)
static void shove4444(const GLfloat[], int, void *)
static void scale_internal_ubyte(GLint components, GLint widthin, GLint heightin, const GLubyte *datain, GLint widthout, GLint heightout, GLubyte *dataout, GLint element_size, GLint ysize, GLint group_size)
static void extract565(int, const void *, GLfloat[])
static void halveImage_uint(GLint components, GLuint width, GLuint height, const GLuint *datain, GLuint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void extract4444rev(int, const void *, GLfloat[])
static void shove8888rev(const GLfloat[], int, void *)
static void shove4444rev(const GLfloat[], int, void *)
static void scale_internal_uint(GLint components, GLint widthin, GLint heightin, const GLuint *datain, GLint widthout, GLint heightout, GLuint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void empty_image(const PixelStorageModes *, GLint width, GLint height, GLenum format, GLenum type, GLboolean index_format, const GLushort *oldimage, void *userdata)
static int gluScaleImage3D(GLenum format, GLint widthIn, GLint heightIn, GLint depthIn, GLenum typeIn, const void *dataIn, GLint widthOut, GLint heightOut, GLint depthOut, GLenum typeOut, void *dataOut)
static void shove233rev(const GLfloat[], int, void *)
static void halveImage_ubyte(GLint components, GLuint width, GLuint height, const GLubyte *datain, GLubyte *dataout, GLint element_size, GLint ysize, GLint group_size)
#define __GLU_SWAP_4_BYTES(s)
static void closestFit(GLenum, GLint, GLint, GLint, GLenum, GLenum, GLint *, GLint *)
static void halveImage_int(GLint components, GLuint width, GLuint height, const GLint *datain, GLint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
#define __GLU_INIT_SWAP_IMAGE
static void retrieveStoreModes3D(PixelStorageModes *psm)
static void halveImagePackedPixel3D(int components, void(*extractPackedPixel)(int, const void *, GLfloat[]), void(*shovePackedPixel)(const GLfloat[], int, void *), GLint width, GLint height, GLint depth, const void *dataIn, void *dataOut, GLint pixelSizeInBytes, GLint rowSizeInBytes, GLint imageSizeInBytes, GLint isSwap)
static GLint image_size(GLint width, GLint height, GLenum format, GLenum type)
static void halveImage_ushort(GLint components, GLuint width, GLuint height, const GLushort *datain, GLushort *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static int gluBuild3DMipmapLevelsCore(GLenum, GLint, GLsizei, GLsizei, GLsizei, GLsizei, GLsizei, GLsizei, GLenum, GLenum, GLint, GLint, GLint, const void *)
static void shove332(const GLfloat[], int, void *)
static GLboolean isLegalLevels(GLint, GLint, GLint, GLint)
static GLdouble extractSshort(int, const void *)
static void scale_internal_int(GLint components, GLint widthin, GLint heightin, const GLint *datain, GLint widthout, GLint heightout, GLint *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void halveImage3D(int, GLdouble(*)(int, const void *), void(*)(GLdouble, int, void *), GLint, GLint, GLint, const void *, void *, GLint, GLint, GLint, GLint, GLint)
static void shoveUbyte(GLdouble, int, void *)
static void halveImage_float(GLint components, GLuint width, GLuint height, const GLfloat *datain, GLfloat *dataout, GLint element_size, GLint ysize, GLint group_size, GLint myswap_bytes)
static void shove5551(const GLfloat[], int, void *)
#define memcpy(s1, s2, n)
static const char mbstate_t *static wchar_t const char mbstate_t *static const wchar_t int *static double
static const DWORD padding[]
static float(__cdecl *square_half_float)(float x
static Real area(Real A[2], Real B[2], Real C[2])
_In_ size_t const maxsize
GLint unpack_image_height
PROC WINAPI wglGetProcAddress(LPCSTR name)