Oolite 1.91.0.7645-241119-222d325
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 OOColorModulateColor (OOColor *a, OOColor *b)
 
static void ScaleToMatch (OOPixMap *pmA, OOPixMap *pmB)
 

Macro Definition Documentation

◆ DUMP

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

◆ DUMP_COMBINER

#define DUMP_COMBINER   0

Definition at line 38 of file OOCombinedEmissionMapGenerator.m.

Function Documentation

◆ ModulateColor()

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

Definition at line 445 of file OOCombinedEmissionMapGenerator.m.

446{
447 if (a == nil) return b;
448 if (b == nil) return a;
449
450 OORGBAComponents ac, bc;
451 ac = [a rgbaComponents];
452 bc = [b rgbaComponents];
453
454 ac.r *= bc.r;
455 ac.g *= bc.g;
456 ac.b *= bc.b;
457 ac.a *= bc.a;
458
460}
return nil
OOColor * colorWithRGBAComponents:(OORGBAComponents components)
Definition OOColor.m:109
OORGBAComponents rgbaComponents()
Definition OOColor.m:379

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

+ Here is the call graph for this function:

◆ ScaleToMatch()

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

Definition at line 463 of file OOCombinedEmissionMapGenerator.m.

464{
465 NSCParameterAssert(pmA != NULL && pmB != NULL && OOIsValidPixMap(*pmA) && OOIsValidPixMap(*pmB));
466
467 OOPixMapDimension minWidth = MIN(pmA->width, pmB->width);
468 OOPixMapDimension minHeight = MIN(pmA->height, pmB->height);
469
470 if (pmA->width != minWidth || pmA->height != minHeight)
471 {
472 *pmA = OOScalePixMap(*pmA, minWidth, minHeight, NO);
473 }
474 if (pmB->width != minWidth || pmB->height != minHeight)
475 {
476 *pmB = OOScalePixMap(*pmB, minWidth, minHeight, NO);
477 }
478}
#define MIN(A, B)
Definition OOMaths.h:111
uint_fast32_t OOPixMapDimension
Definition OOPixMap.h:33
BOOL OOIsValidPixMap(OOPixMap pixMap)
Definition OOPixMap.m:42
OOPixMap OOScalePixMap(OOPixMap srcPixMap, OOPixMapDimension dstWidth, OOPixMapDimension dstHeight, BOOL leaveSpaceForMipMaps)
OOPixMapDimension height
Definition OOPixMap.h:50
OOPixMapDimension width
Definition OOPixMap.h:50