34#define DUMP_MIP_MAPS 0
59#if OOLITE_NATIVE_64_BIT
87#if !OOLITE_NATIVE_64_BIT
107 StretchVerticallyN_x8(srcPx, dstPx);
135 [NSException raise:NSInternalInconsistencyException
136 format:@"Unsupported pixmap format in scaler: %@", OOPixMapFormatName(pixMap.format)];
164 [NSException raise:NSInternalInconsistencyException
165 format:@"Unsupported pixmap format in scaler: %@", OOPixMapFormatName(srcPx.format)];
191 [NSException raise:NSInternalInconsistencyException
192 format:@"Unsupported pixmap format in scaler: %@", OOPixMapFormatName(pixMap.format)];
198#if DUMP_MIP_MAPS || DUMP_SCALE
200volatile int32_t sPreviousDumpID = 0;
201int32_t OSAtomicAdd32(int32_t __theAmount,
volatile int32_t* __theValue);
206#define DUMP_CHANNELS -1
208#define DUMP_MIP_MAP_PREPARE(pl) \
209 uint32_t dumpPlanes = pl; \
210 uint32_t dumpLevel = 0; \
211 BOOL dumpThis = (dumpPlanes & DUMP_CHANNELS) != 0; \
212 SInt32 dumpID = dumpThis ? OSAtomicAdd32(1, &sPreviousDumpID) : 0;
213#define DUMP_MIP_MAP_DUMP(px, w, h) \
215 DumpMipMap(px, w, h, dumpPlanes, dumpID, dumpLevel++);
218#define DUMP_MIP_MAP_PREPARE(pl) \
222#define DUMP_MIP_MAP_DUMP(px, w, h) \
231#define DUMP_SCALE_PREPARE() SInt32 dumpID = OSAtomicAdd32(1, &sPreviousDumpID), dumpCount = 0;
232#define DUMP_SCALE_DUMP(PM, stage) \
234 OOPixMap* pm = &(PM); \
235 OODumpPixMap(*pm, [NSString stringWithFormat:@"scaling dump ID %u stage %u-%@ %ux%u", dumpID, dumpCount++, stage, pm->width, pm->height]); \
238#define DUMP_SCALE_PREPARE()
239#define DUMP_SCALE_DUMP(PM, stage) \
246 OOPixMap dstPx = { 0 }, sparePx = { 0 };
259 if (srcPx.
height < dstHeight) {
261 size_t dstSize = srcPx.
rowBytes * dstHeight;
262 if (leaveSpaceForMipMaps && dstWidth <= srcPx.
width)
263 dstSize = dstSize * 4 / 3;
276 }
else if (dstHeight < srcPx.
height) {
283 if (srcPx.
width < dstWidth) {
286 if (leaveSpaceForMipMaps)
287 dstSize = dstSize * 4 / 3;
289 if (dstSize <= sparePx.bufferSize) {
302 }
else if (dstWidth < srcPx.
width) {
307 dstPx.
width = dstWidth;
324 if (sparePx.pixels != dstPx.
pixels && sparePx.pixels != srcPx.
pixels) {
325 free(sparePx.pixels);
339 OOLog(
kOOLogParameterError,
@"Non-power-of-two dimensions (%ux%u) passed to %s() - ignoring, data will be junk.", width, height, __PRETTY_FUNCTION__);
368 uint8_t *curr, *next;
373#if OOLITE_NATIVE_64_BIT
374 while (8 < w && 1 < h) {
378 ScaleToHalf_1_x8(curr, next, w, h);
385 while (4 < w && 1 < h) {
397 while (1 < w && 1 < h) {
417 uint8_t *src0, *src1, *dst;
418 uint8_t px00, px01, px10, px11;
422 src1 = src0 + srcWidth;
436 sum = px00 + px01 + px10 + px11;
451#if !OOLITE_NATIVE_64_BIT
456 uint32_t *src0, *src1, *dst;
457 uint32_t px00, px01, px10, px11;
462 src1 = src0 + srcWidth;
476 sum0 = (px00 & 0x00FF00FF) + (px10 & 0x00FF00FF) + ((px00 & 0xFF00FF00) >> 8) + ((px10 & 0xFF00FF00) >> 8);
477 sum1 = (px01 & 0x00FF00FF) + (px11 & 0x00FF00FF) + ((px01 & 0xFF00FF00) >> 8) + ((px11 & 0xFF00FF00) >> 8);
481 sum0 = ((sum0 << 6) & 0xFF000000) | ((sum0 << 14) & 0x00FF0000);
482 sum1 = ((sum1 >> 10) & 0x0000FF00) | ((sum1 >> 2) & 0x000000FF);
483#elif OOLITE_LITTLE_ENDIAN
484 sum0 = ((sum0 >> 10) & 0x0000FF00) | ((sum0 >> 2) & 0x000000FF);
485 sum1 = ((sum1 << 6) & 0xFF000000) | ((sum1 << 14) & 0x00FF0000);
487#error Neither OOLITE_BIG_ENDIAN nor OOLITE_LITTLE_ENDIAN is defined as nonzero!
491 *dst++ = sum0 | sum1;
505 uint64_t *src0, *src1;
507 uint_fast64_t px00, px01, px10, px11;
508 uint_fast64_t sum0, sum1;
512 src1 = src0 + srcWidth;
526 sum0 = ((px00 & 0x00FF00FF00FF00FFULL)) + ((px10 & 0x00FF00FF00FF00FFULL)) + ((px00 & 0xFF00FF00FF00FF00ULL) >> 8) + ((px10 & 0xFF00FF00FF00FF00ULL) >> 8);
527 sum1 = ((px01 & 0x00FF00FF00FF00FFULL)) + ((px11 & 0x00FF00FF00FF00FFULL)) + ((px01 & 0xFF00FF00FF00FF00ULL) >> 8) + ((px11 & 0xFF00FF00FF00FF00ULL) >> 8);
531 sum0 = ((sum0 << 06) & 0xFF00000000000000ULL) | ((sum0 << 14) & 0x00FF000000000000ULL) | ((sum0 << 22) & 0x0000FF0000000000ULL) | ((sum0 << 30) & 0x000000FF00000000ULL);
532 sum1 = ((sum1 >> 26) & 0x00000000FF000000ULL) | ((sum1 >> 18) & 0x0000000000FF0000ULL) | ((sum1 >> 10) & 0x000000000000FF00ULL) | ((sum1 >> 02) & 0x00000000000000FFULL);
533#elif OOLITE_LITTLE_ENDIAN
534 sum0 = ((sum0 >> 26) & 0x00000000FF000000ULL) | ((sum0 >> 18) & 0x0000000000FF0000ULL) | ((sum0 >> 10) & 0x000000000000FF00ULL) | ((sum0 >> 02) & 0x00000000000000FFULL);
535 sum1 = ((sum1 << 06) & 0xFF00000000000000ULL) | ((sum1 << 14) & 0x00FF000000000000ULL) | ((sum1 << 22) & 0x0000FF0000000000ULL) | ((sum1 << 30) & 0x000000FF00000000ULL);
537#error Neither OOLITE_BIG_ENDIAN nor OOLITE_LITTLE_ENDIAN is defined as nonzero!
540 *dst++ = sum0 | sum1;
554 uint16_t *curr, *next;
561#if OOLITE_NATIVE_64_BIT
562 while (4 < w && 1 < h)
567 ScaleToHalf_2_x4(curr, next, w, h);
574 while (2 < w && 1 < h)
579 ScaleToHalf_2_x2(curr, next, w, h);
588 while (1 < w && 1 < h) {
608 uint16_t *src0, *src1, *dst;
609 uint16_t px00, px01, px10, px11;
610 uint32_t sumHi, sumLo;
613 src1 = src0 + srcWidth;
627 sumHi = (px00 & 0xFF00) + (px01 & 0xFF00) + (px10 & 0xFF00) + (px11 & 0xFF00);
628 sumLo = (px00 & 0x00FF) + (px01 & 0x00FF) + (px10 & 0x00FF) + (px11 & 0x00FF);
631 sumLo = ((sumHi & 0x3FC00) | sumLo) >> 2;
646 uint32_t *curr, *next;
651#if OOLITE_NATIVE_64_BIT
652 while (2 < w && 1 < h) {
656 ScaleToHalf_4_x2(curr, next, w, h);
662 if (
EXPECT(1 < w && 1 < h)) {
672 while (1 < w && 1 < h) {
693 uint32_t *src0, *src1, *dst;
694 uint32_t px00, px01, px10, px11;
704 src1 = src0 + srcWidth;
718 ag = (px00 & 0xFF00FF00) >> 8;
719 br = (px00 & 0x00FF00FF);
720 ag += (px01 & 0xFF00FF00) >> 8;
721 br += (px01 & 0x00FF00FF);
722 ag += (px10 & 0xFF00FF00) >> 8;
723 br += (px10 & 0x00FF00FF);
724 ag += (px11 & 0xFF00FF00) >> 8;
725 br += (px11 & 0x00FF00FF);
732 *dst++ = (ag & 0xFF00FF00) | (br & 0x00FF00FF);
741#if OOLITE_NATIVE_64_BIT
746 uint_fast64_t *src0, *src1, *dst;
747 uint_fast64_t px00, px01, px10, px11;
754 uint_fast64_t ag0, ag1, br0, br1;
758 src1 = src0 + srcWidth;
772 ag0 = (px00 & 0xFF00FF00FF00FF00ULL) >> 8;
773 br0 = (px00 & 0x00FF00FF00FF00FFULL);
774 ag0 += (px10 & 0xFF00FF00FF00FF00ULL) >> 8;
775 br0 += (px10 & 0x00FF00FF00FF00FFULL);
776 ag1 = (px01 & 0xFF00FF00FF00FF00ULL) >> 8;
777 br1 = (px01 & 0x00FF00FF00FF00FFULL);
778 ag1 += (px11 & 0xFF00FF00FF00FF00ULL) >> 8;
779 br1 += (px11 & 0x00FF00FF00FF00FFULL);
783 ag0 = ag0 + (ag0 << 32);
784 br0 = br0 + (br0 << 32);
785 ag1 = ag1 + (ag1 >> 32);
786 br1 = br1 + (br1 >> 32);
789 ag0 = ((ag0 & 0x03FC03FC00000000ULL) | (ag1 & 0x0000000003FC03FCULL)) << 6;
790 br0 = ((br0 & 0x03FC03FC00000000ULL) | (br1 & 0x0000000003FC03FCULL)) >> 2;
791#elif OOLITE_LITTLE_ENDIAN
793 ag0 = ag0 + (ag0 >> 32);
794 br0 = br0 + (br0 >> 32);
795 ag1 = ag1 + (ag1 << 32);
796 br1 = br1 + (br1 << 32);
799 ag0 = ((ag0 & 0x0000000003FC03FCULL) | (ag1 & 0x03FC03FC00000000ULL)) << 6;
800 br0 = ((br0 & 0x0000000003FC03FCULL) | (br1 & 0x03FC03FC00000000ULL)) >> 2;
802#error Unknown architecture.
827 uint8_t *src, *src0, *src1, *prev, *dst;
829 uint32_t
x,
y, xCount;
831 uint16_t weight0, weight1;
846 prev = src1 = src + srcRowBytes * (fractY >> 8);
848 weight1 = fractY & 0xFF;
849 weight0 = 0x100 - weight1;
856 *dst++ = (px0 * weight0 + px1 * weight1) >> 8;
867#if !OOLITE_NATIVE_64_BIT
872 uint32_t *src0, *src1, *prev, *dst;
873 uint32_t px0, px1, ag, br;
874 uint32_t
x,
y, xCount;
876 uint16_t weight0, weight1;
883 src0 = prev = (uint32_t*)src;
891 prev = src1 = (uint32_t*)(src + srcRowBytes * (fractY >> 8));
893 weight1 = fractY & 0xFF;
894 weight0 = 0x100 - weight1;
901 ag = ((px0 & 0xFF00FF00) >> 8) * weight0 + ((px1 & 0xFF00FF00) >> 8) * weight1;
902 br = (px0 & 0x00FF00FF) * weight0 + (px1 & 0x00FF00FF) * weight1;
904 *dst++ = (ag & 0xFF00FF00) | ((br >> 8) & 0x00FF00FF);
920 uint64_t *src0, *src1, *prev, *dst;
921 uint64_t px0, px1, agag, brbr;
922 uint32_t
x,
y, xCount;
924 uint16_t weight0, weight1;
931 src0 = prev = (uint64_t*)src;
939 prev = src1 = (uint64_t*)(src + srcRowBytes * (fractY >> 8));
941 weight1 = fractY & 0xFF;
942 weight0 = 0x100 - weight1;
949 agag = ((px0 & 0xFF00FF00FF00FF00ULL) >> 8) * weight0 + ((px1 & 0xFF00FF00FF00FF00ULL) >> 8) * weight1;
950 brbr = (px0 & 0x00FF00FF00FF00FFULL) * weight0 + (px1 & 0x00FF00FF00FF00FFULL) * weight1;
952 *dst++ = (agag & 0xFF00FF00FF00FF00ULL) | ((brbr >> 8) & 0x00FF00FF00FF00FFULL);
966 uint8_t *src, *srcStart, *dst;
968 uint32_t
x,
y, xCount;
970 uint16_t weight0, weight1;
971 uint32_t fractX, deltaX;
977 xCount = dstPx.
width;
986 for (
x = 0;
x != xCount; ++
x) {
989 weight1 = (fractX >> 4) & 0xFF;
990 weight0 = 0x100 - weight1;
993 src = srcStart + (fractX >> 12);
996 *dst++ = (px0 * weight0 + px1 * weight1) >> 8;
999 srcStart = (uint8_t*)((
char*)srcStart + srcRowBytes);
1005 for (
x = 0;
x != xCount; ++
x) {
1008 weight1 = (fractX >> 4) & 0xFF;
1009 weight0 = 0x100 - weight1;
1012 src = srcStart + (fractX >> 12);
1015 *dst++ = (px0 * weight0 + px1 * weight1) >> 8;
1021 uint16_t *src, *srcStart, *dst;
1024 uint32_t
x,
y, xCount;
1026 uint16_t weight0, weight1;
1027 uint32_t fractX, deltaX;
1033 xCount = dstPx.
width;
1039 for (
y = 0;
y < dstPx.
height - 1; ++
y) {
1042 for (
x = 0;
x != xCount; ++
x) {
1045 weight1 = (fractX >> 4) & 0xFF;
1046 weight0 = 0x100 - weight1;
1049 src = srcStart + (fractX >> 12);
1052 hi = (px0 & 0xFF00) * weight0 + (px1 & 0xFF00) * weight1;
1053 lo = (px0 & 0x00FF) * weight0 + (px1 & 0x00FF) * weight1;
1055 *dst++ = ((hi & 0xFF0000) | (lo & 0x00FF00)) >> 8;
1058 srcStart = (uint16_t*)((
char*)srcStart + srcRowBytes);
1064 for (
x = 0;
x != xCount; ++
x) {
1067 weight1 = (fractX >> 4) & 0xFF;
1068 weight0 = 0x100 - weight1;
1071 src = srcStart + (fractX >> 12);
1074 hi = (px0 & 0xFF00) * weight0 + (px1 & 0xFF00) * weight1;
1075 lo = (px0 & 0x00FF) * weight0 + (px1 & 0x00FF) * weight1;
1077 *dst++ = ((hi & 0xFF0000) | (lo & 0x00FF00)) >> 8;
1083 uint32_t *src, *srcStart, *dst;
1086 uint32_t
x,
y, xCount;
1088 uint16_t weight0, weight1;
1089 uint32_t fractX, deltaX;
1095 xCount = dstPx.
width;
1101 for (
y = 0;
y < dstPx.
height - 1; ++
y) {
1104 for (
x = 0;
x != xCount; ++
x) {
1107 weight1 = (fractX >> 4) & 0xFF;
1108 weight0 = 0x100 - weight1;
1111 src = srcStart + (fractX >> 12);
1114 ag = ((px0 & 0xFF00FF00) >> 8) * weight0 + ((px1 & 0xFF00FF00) >> 8) * weight1;
1115 br = (px0 & 0x00FF00FF) * weight0 + (px1 & 0x00FF00FF) * weight1;
1117 *dst++ = (ag & 0xFF00FF00) | ((br & 0xFF00FF00) >> 8);
1120 srcStart = (uint32_t*)((
char*)srcStart + srcRowBytes);
1126 for (
x = 0;
x != xCount; ++
x) {
1129 weight1 = (fractX >> 4) & 0xFF;
1130 weight0 = 0x100 - weight1;
1133 src = srcStart + (fractX >> 12);
1137 ag = ((px0 & 0xFF00FF00) >> 8) * weight0 + ((px1 & 0xFF00FF00) >> 8) * weight1;
1138 br = (px0 & 0x00FF00FF) * weight0 + (px1 & 0x00FF00FF) * weight1;
1140 *dst++ = (ag & 0xFF00FF00) | ((br & 0xFF00FF00) >> 8);
1146 uint8_t *src, *srcStart, *dst;
1148 uint32_t
x,
y, xCount, endX;
1150 uint32_t endFractX, deltaX;
1151 uint32_t accum, weight;
1152 uint8_t borderWeight;
1160 deltaX = (srcPx.
width << 12) / dstWidth;
1163 borderPx = *srcStart;
1172 endFractX += deltaX;
1173 endX = endFractX >> 12;
1175 borderWeight = 0xFF - borderWeight;
1176 accum = borderPx * borderWeight;
1177 weight = borderWeight;
1179 borderWeight = (endFractX >> 4) & 0xFF;
1180 weight += borderWeight;
1187 accum += borderPx * borderWeight;
1190 accum += *++src * 0xFF;
1195 *dst++ = accum / weight;
1198 srcStart = (uint8_t*)((
char*)srcStart + srcRowBytes);
1204 uint8_t *src, *srcStart, *dst;
1205 uint32_t
x,
y, xCount, startY, endY, lastRow;
1207 uint32_t endFractY, deltaY;
1208 uint32_t accum, weight;
1209 uint8_t startWeight, endWeight;
1215 xCount = srcPx.
width;
1217 deltaY = (srcPx.
height << 12) / dstHeight;
1223 lastRow = srcPx.
height - 1;
1225 while (endY < lastRow) {
1226 endFractY += deltaY;
1228 endY = endFractY >> 12;
1230 startWeight = 0xFF - endWeight;
1231 endWeight = (endFractY >> 4) & 0xFF;
1233 srcStart = (uint8_t*)((
char*)srcPx.
pixels + srcRowBytes * startY);
1235 for (
x = 0;
x != xCount; ++
x) {
1237 accum = startWeight * *src;
1238 weight = startWeight + endWeight;
1243 src = (uint8_t*)((
char*)src + srcRowBytes);
1245 if (
EXPECT(endY < lastRow))
1246 accum += *src * endWeight;
1249 accum += *src * 0xFF;
1254 *dst++ = accum / weight;
1264#define ACCUM2(PX, WT) \
1268 accumHi += (px & 0xFF00) * wt; \
1269 accumLo += (px & 0x00FF) * wt; \
1273#define CLEAR_ACCUM2() \
1280#define ACCUM2TOPX() ( \
1281 ((accumHi / weight) & 0xFF00) | ((accumLo / weight) & 0x00FF))
1285 uint16_t *src, *srcStart, *dst;
1287 uint32_t
x,
y, xCount, endX;
1289 uint32_t endFractX, deltaX;
1290 uint32_t accumHi, accumLo, weight;
1291 uint8_t borderWeight;
1299 deltaX = (srcPx.
width << 12) / dstWidth;
1302 borderPx = *srcStart;
1311 endFractX += deltaX;
1312 endX = endFractX >> 12;
1316 borderWeight = 0xFF - borderWeight;
1317 ACCUM2(borderPx, borderWeight);
1319 borderWeight = (endFractX >> 4) & 0xFF;
1326 ACCUM2(borderPx, borderWeight);
1336 srcStart = (uint16_t*)((
char*)srcStart + srcRowBytes);
1342 uint16_t *src, *srcStart, *dst;
1343 uint32_t
x,
y, xCount, startY, endY, lastRow;
1345 uint32_t endFractY, deltaY;
1346 uint32_t accumHi, accumLo, weight;
1347 uint8_t startWeight, endWeight;
1353 xCount = srcPx.
width;
1355 deltaY = (srcPx.
height << 12) / dstHeight;
1361 lastRow = srcPx.
height - 1;
1363 while (endY < lastRow) {
1364 endFractY += deltaY;
1366 endY = endFractY >> 12;
1368 startWeight = 0xFF - endWeight;
1369 endWeight = (endFractY >> 4) & 0xFF;
1371 srcStart = (uint16_t*)((
char*)srcPx.
pixels + srcRowBytes * startY);
1373 for (
x = 0;
x != xCount; ++
x) {
1377 ACCUM2(*src, startWeight);
1382 src = (uint16_t*)((
char*)src + srcRowBytes);
1384 if (
EXPECT(endY <= lastRow))
1402#define ACCUM4(PX, WT) \
1406 ag = ((px & 0xFF00FF00) >> 8) * wt; \
1407 br = (px & 0x00FF00FF) * wt; \
1408 accum1 += ag >> 16; \
1409 accum2 += br >> 16; \
1410 accum3 += ag & 0xFFFF; \
1411 accum4 += br & 0xFFFF; \
1415#define CLEAR_ACCUM4() \
1430#define ACCUM4TOPX() ( \
1431 (((accum1 / weight) & 0xFF) << 24) | (((accum3 / weight) & 0xFF) << 8) | (((accum2 / weight) & 0xFF) << 16) | ((accum4 / weight) & 0xFF))
1435 uint32_t *src, *srcStart, *dst;
1436 uint32_t borderPx, ag, br;
1437 uint32_t
x,
y, xCount, endX;
1439 uint32_t endFractX, deltaX;
1440 uint32_t accum1, accum2, accum3, accum4, weight;
1441 uint8_t borderWeight;
1449 deltaX = (srcPx.
width << 12) / dstWidth;
1452 borderPx = *srcStart;
1461 endFractX += deltaX;
1462 endX = endFractX >> 12;
1466 borderWeight = 0xFF - borderWeight;
1467 ACCUM4(borderPx, borderWeight);
1469 borderWeight = (endFractX >> 4) & 0xFF;
1476 ACCUM4(borderPx, borderWeight);
1486 srcStart = (uint32_t*)((
char*)srcStart + srcRowBytes);
1492 uint32_t *src, *srcStart, *dst;
1493 uint32_t
x,
y, xCount, startY, endY, lastRow;
1496 uint32_t endFractY, deltaY;
1497 uint32_t accum1, accum2, accum3, accum4, weight;
1498 uint8_t startWeight, endWeight;
1504 xCount = srcPx.
width;
1506 deltaY = (srcPx.
height << 12) / dstHeight;
1512 lastRow = srcPx.
height - 1;
1514 while (endY < lastRow) {
1515 endFractY += deltaY;
1517 endY = endFractY >> 12;
1519 startWeight = 0xFF - endWeight;
1520 endWeight = (endFractY >> 4) & 0xFF;
1522 srcStart = (uint32_t*)((
char*)srcPx.
pixels + srcRowBytes * startY);
1524 for (
x = 0;
x != xCount; ++
x) {
1528 ACCUM4(*src, startWeight);
1533 src = (uint32_t*)((
char*)src + srcRowBytes);
1535 if (
EXPECT(endY <= lastRow))
1567 if (leaveSpaceForMipMaps)
1568 correctSize = correctSize * 4 / 3;
1570 bytes = realloc(pixMap->
pixels, correctSize);
#define ALWAYS_INLINE_FUNC
#define OOLogGenericParameterError()
#define OOLog(class, format,...)
NSString *const kOOLogParameterError
uint32_t OOPixMapDimension
NSString * OOPixMapFormatName(OOPixMapFormat format) PURE_FUNC
void OODumpPixMap(OOPixMap pixMap, NSString *name)
@ kOOPixMapGrayscaleAlpha
const OOPixMap kOONullPixMap
#define OORoundUpToPowerOf2_PixMap
OOPixMap OOAllocatePixMap(OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format, size_t rowBytes, size_t bufferSize)
OOINLINE unsigned short OOPixMapBytesPerPixel(OOPixMap pixMap)
OOPixMap OOMakePixMap(void *pixels, OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format, size_t rowBytes, size_t bufferSize)
BOOL OOIsValidPixMap(OOPixMap pixMap)
static BOOL GenerateMipMaps2(void *textureBytes, OOPixMapDimension width, OOPixMapDimension height) NONNULL_FUNC
static void SqueezeVertically1(OOPixMap srcPx, OOPixMapDimension dstHeight)
#define DUMP_MIP_MAP_DUMP(px, w, h)
static void ScaleToHalf_4_x1(void *srcBytes, void *dstBytes, OOPixMapDimension srcWidth, OOPixMapDimension srcHeight) NONNULL_FUNC
static void ScaleToHalf_2_x1(void *srcBytes, void *dstBytes, OOPixMapDimension srcWidth, OOPixMapDimension srcHeight) NONNULL_FUNC
#define DUMP_SCALE_PREPARE()
static void StretchHorizontally2(OOPixMap srcPx, OOPixMap dstPx)
#define DUMP_SCALE_DUMP(PM, stage)
static BOOL GenerateMipMaps4(void *textureBytes, OOPixMapDimension width, OOPixMapDimension height) NONNULL_FUNC
static BOOL EnsureCorrectDataSize(OOPixMap *pixMap, BOOL leaveSpaceForMipMaps) NONNULL_FUNC
OOPixMap OOScalePixMap(OOPixMap srcPx, OOPixMapDimension dstWidth, OOPixMapDimension dstHeight, BOOL leaveSpaceForMipMaps)
#define DUMP_MIP_MAP_PREPARE(pl)
OOINLINE void StretchVertically(OOPixMap srcPx, OOPixMap dstPx) ALWAYS_INLINE_FUNC
static void SqueezeHorizontally2(OOPixMap srcPx, OOPixMapDimension dstWidth)
static BOOL GenerateMipMaps1(void *textureBytes, OOPixMapDimension width, OOPixMapDimension height) NONNULL_FUNC
OOINLINE void StretchHorizontally(OOPixMap srcPx, OOPixMap dstPx) ALWAYS_INLINE_FUNC
static void SqueezeVertically4(OOPixMap srcPx, OOPixMapDimension dstHeight)
OOINLINE void SqueezeVertically(OOPixMap pixMap, OOPixMapDimension dstHeight) ALWAYS_INLINE_FUNC
static void ScaleToHalf_1_x1(void *srcBytes, void *dstBytes, OOPixMapDimension srcWidth, OOPixMapDimension srcHeight) NONNULL_FUNC
OOINLINE void SqueezeHorizontally(OOPixMap pixMap, OOPixMapDimension dstHeight) ALWAYS_INLINE_FUNC
static void SqueezeHorizontally1(OOPixMap srcPx, OOPixMapDimension dstWidth)
static void SqueezeHorizontally4(OOPixMap srcPx, OOPixMapDimension dstWidth)
BOOL OOGenerateMipMaps(void *textureBytes, OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format)
static void StretchHorizontally1(OOPixMap srcPx, OOPixMap dstPx)
static void StretchVerticallyN_x1(OOPixMap srcPx, OOPixMap dstPx)
static void ScaleToHalf_1_x4(void *srcBytes, void *dstBytes, OOPixMapDimension srcWidth, OOPixMapDimension srcHeight) NONNULL_FUNC
static void StretchHorizontally4(OOPixMap srcPx, OOPixMap dstPx)
static void SqueezeVertically2(OOPixMap srcPx, OOPixMapDimension dstHeight)
static void StretchVerticallyN_x4(OOPixMap srcPx, OOPixMap dstPx)