Oolite
Loading...
Searching...
No Matches
OOCombinedEmissionMapGenerator.m File Reference
Include dependency graph for OOCombinedEmissionMapGenerator.m:

Go to the source code of this file.

Classes

category  OOCombinedEmissionMapGenerator(Private)

Macros

#define DUMP_COMBINER   0
#define DUMP(pm, label)

Functions

static OOColor * ModulateColor (OOColor *a, OOColor *b)
static void ScaleToMatch (OOPixMap *pmA, OOPixMap *pmB)

Macro Definition Documentation

◆ DUMP

#define DUMP ( pm,
label )
Value:
do { \
} while (0)

Referenced by OOCombinedEmissionMapGenerator::loadTexture.

◆ DUMP_COMBINER

#define DUMP_COMBINER   0

Definition at line 37 of file OOCombinedEmissionMapGenerator.m.

Function Documentation

◆ ModulateColor()

OOColor * ModulateColor ( OOColor * a,
OOColor * b )
static

Definition at line 414 of file OOCombinedEmissionMapGenerator.m.

415{
416 if (a == nil)
417 return b;
418 if (b == nil)
419 return a;
420
421 OORGBAComponents ac, bc;
422 ac = [a rgbaComponents];
423 bc = [b rgbaComponents];
424
425 ac.r *= bc.r;
426 ac.g *= bc.g;
427 ac.b *= bc.b;
428 ac.a *= bc.a;
429
431}
return nil
OOColor * colorWithRGBAComponents:(OORGBAComponents components)
Definition OOColor.m:119
OORGBAComponents rgbaComponents()
Definition OOColor.m:354

References OORGBAComponents::a, OORGBAComponents::b, OOColor::colorWithRGBAComponents:, OORGBAComponents::g, nil, OORGBAComponents::r, and OOColor::rgbaComponents.

Referenced by OOCombinedEmissionMapGenerator(Private)::initWithEmissionMapSpec:emissionColor:diffuseMap:diffuseColor:illuminationMapSpec:illuminationColor:isCombinedMap:optionsSpecifier:.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ ScaleToMatch()

void ScaleToMatch ( OOPixMap * pmA,
OOPixMap * pmB )
static

Definition at line 433 of file OOCombinedEmissionMapGenerator.m.

434{
435 NSCParameterAssert(pmA != NULL && pmB != NULL && OOIsValidPixMap(*pmA) && OOIsValidPixMap(*pmB));
436
437 OOPixMapDimension minWidth = MIN(pmA->width, pmB->width);
438 OOPixMapDimension minHeight = MIN(pmA->height, pmB->height);
439
440 if (pmA->width != minWidth || pmA->height != minHeight) {
441 *pmA = OOScalePixMap(*pmA, minWidth, minHeight, NO);
442 }
443 if (pmB->width != minWidth || pmB->height != minHeight) {
444 *pmB = OOScalePixMap(*pmB, minWidth, minHeight, NO);
445 }
446}
#define MIN(A, B)
Definition OOMaths.h:91
uint32_t OOPixMapDimension
Definition OOPixMap.h:32
BOOL OOIsValidPixMap(OOPixMap pixMap)
Definition OOPixMap.m:39
OOPixMap OOScalePixMap(OOPixMap srcPixMap, OOPixMapDimension dstWidth, OOPixMapDimension dstHeight, BOOL leaveSpaceForMipMaps)
OOPixMapDimension height
Definition OOPixMap.h:45
OOPixMapDimension width
Definition OOPixMap.h:45

References OOPixMap::height, MIN, OOIsValidPixMap(), OOScalePixMap(), and OOPixMap::width.

Referenced by OOCombinedEmissionMapGenerator::loadTexture.

Here is the call graph for this function:
Here is the caller graph for this function: