63 NSCParameterAssert(ioPixMap != NULL);
68 uint_fast32_t xCount,
y;
71 shift = 8 * channelIndex;
76 xCount = ioPixMap->
width;
80 *dst++ = (*src++ >> shift) & 0xFF;
135 uint_fast32_t xCount,
y;
142 xCount = srcPx.
width;
146 *dst++ = (*src++ * 0x00010101) | 0xFF000000;
160 uint_fast32_t xCount,
y;
167 xCount = srcPx.
width;
173 *dst++ = (((px & 0xFF00) >> 8) * 0x00010101) | ((px & 0x00FF) << 24);
174#elif OOLITE_LITTLE_ENDIAN
175 *dst++ = ((px & 0x00FF) * 0x00010101) | ((px & 0xFF00) << 16);
177#error Unknown byte order.
190 ModulateUniform_4(*ioPixMap, f0 * 256.0f, f1 * 256.0f, f2 * 256.0f, f3 * 256.0f);
202 uint_fast32_t p0, p1, p2, p3;
203 uint_fast32_t xCount,
y;
208 xCount = pixMap.
width;
222 p0 = px & 0xFF000000;
223 p0 = ((p0 >> 8) * f0) & 0xFF000000;
225 p1 = px & 0x00FF0000;
226 p1 = ((p1 * f1) >> 8) & 0x00FF0000;
228 p2 = px & 0x0000FF00;
229 p2 = ((p2 * f2) >> 8) & 0x0000FF00;
231 p3 = px & 0x000000FF;
232 p3 = ((p3 * f3) >> 8) & 0x000000FF;
234 px = p0 | p1 | p2 | p3;
257 uint32_t *dst, *other;
259 uint_fast16_t m0, m1, m2, m3;
260 uint_fast16_t o0, o1, o2, o3;
261 uint_fast32_t xCount,
y;
267 xCount = mainPx.
width;
272 m0 = (px >> 24) & 0xFF;
273 m1 = (px >> 16) & 0xFF;
274 m2 = (px >> 8) & 0xFF;
278 o0 = (px >> 24) & 0xFF;
279 o1 = (px >> 16) & 0xFF;
280 o2 = (px >> 8) & 0xFF;
288 m0 = (m0 * o0) / 255;
289 m1 = (m1 * o1) / 255;
290 m2 = (m2 * o2) / 255;
291 m3 = (m3 * o3) / 255;
293 *dst++ = ((uint_fast32_t)m0 << 24) | ((uint_fast32_t)m1 << 16) | (m2 << 8) | m3;
316 uint32_t *dst, *other;
318 uint_fast32_t m02, m13;
319 uint_fast32_t o02, o13;
320 uint_fast32_t xCount,
y;
326 xCount = mainPx.
width;
331 m02 = (px & 0xFF00FF00) >> 8;
332 m13 = px & 0x00FF00FF;
335 o02 = (px & 0xFF00FF00) >> 8;
336 o13 = px & 0x00FF00FF;
345 m02 |= ((m02 & 0x01000100) * 0xFF) >> 8;
347 m13 |= ((m13 & 0x01000100) * 0xFF) >> 8;
349 *dst++ = ((m02 << 8) & 0xFF00FF00) | (m13 & 0x00FF00FF);
static void ToRGBA_2(OOPixMap srcPx, OOPixMap dstPx)
static void ToRGBA_1(OOPixMap srcPx, OOPixMap dstPx)
static void AddPixMap_4(OOPixMap mainPx, OOPixMap otherPx)
BOOL OOPixMapModulateUniform(OOPixMap *ioPixMap, float f0, float f1, float f2, float f3)
BOOL OOExtractPixMapChannel(OOPixMap *ioPixMap, uint8_t channelIndex, BOOL compactWhenDone)
static void ExtractChannel_4(OOPixMap *ioPixMap, uint8_t channelIndex)
BOOL OOPixMapAddPixMap(OOPixMap *ioDstPixMap, OOPixMap otherPixMap)
static void ModulatePixMap_4(OOPixMap mainPx, OOPixMap otherPx)
static void ModulateUniform_4(OOPixMap pixMap, uint16_t f0, uint16_t f1, uint16_t f2, uint16_t f3)
BOOL OOPixMapModulatePixMap(OOPixMap *ioDstPixMap, OOPixMap otherPixMap)
BOOL OOPixMapToRGBA(OOPixMap *ioPixMap)
@ kOOPixMapGrayscaleAlpha
OOPixMap OOAllocatePixMap(OOPixMapDimension width, OOPixMapDimension height, OOPixMapFormat format, size_t rowBytes, size_t bufferSize)
OOINLINE unsigned short OOPixMapBytesPerPixel(OOPixMap pixMap)
OOINLINE BOOL OOIsNullPixMap(OOPixMap pixMap)
BOOL OOIsValidPixMap(OOPixMap pixMap)
OOINLINE void OOCompactPixMap(OOPixMap *ioPixMap)