KiCad PCB EDA Suite
ccolorrgb.cpp File Reference
#include "ccolorrgb.h"

Go to the source code of this file.

Functions

CCOLORRGB BlendColor (const CCOLORRGB &aC1, const CCOLORRGB &aC2)
 
CCOLORRGB BlendColor (const CCOLORRGB &aC1, const CCOLORRGB &aC2, const CCOLORRGB &aC3)
 
CCOLORRGB BlendColor (const CCOLORRGB &aC1, const CCOLORRGB &aC2, const CCOLORRGB &aC3, const CCOLORRGB &aC4)
 

Function Documentation

CCOLORRGB BlendColor ( const CCOLORRGB aC1,
const CCOLORRGB aC2 
)

Definition at line 42 of file ccolorrgb.cpp.

References CCOLORRGB::b, CCOLORRGB::g, and CCOLORRGB::r.

Referenced by C3D_RENDER_RAYTRACING::render_preview().

43 {
44  const unsigned int r = aC1.r + aC2.r;
45  const unsigned int g = aC1.g + aC2.g;
46  const unsigned int b = aC1.b + aC2.b;
47 
48  return CCOLORRGB( (r >> 1), (g >> 1), (b >> 1) );
49 }
unsigned char r
Definition: ccolorrgb.h:41
unsigned char g
Definition: ccolorrgb.h:42
unsigned char b
Definition: ccolorrgb.h:43
CCOLORRGB BlendColor ( const CCOLORRGB aC1,
const CCOLORRGB aC2,
const CCOLORRGB aC3 
)

Definition at line 52 of file ccolorrgb.cpp.

References CCOLORRGB::b, CCOLORRGB::g, and CCOLORRGB::r.

53 {
54  const unsigned int r = aC1.r + aC2.r + aC3.r;
55  const unsigned int g = aC1.g + aC2.g + aC3.g;
56  const unsigned int b = aC1.b + aC2.b + aC3.b;
57 
58  return CCOLORRGB( (r / 3), (g / 3), (b / 3) );
59 }
unsigned char r
Definition: ccolorrgb.h:41
unsigned char g
Definition: ccolorrgb.h:42
unsigned char b
Definition: ccolorrgb.h:43
CCOLORRGB BlendColor ( const CCOLORRGB aC1,
const CCOLORRGB aC2,
const CCOLORRGB aC3,
const CCOLORRGB aC4 
)

Definition at line 62 of file ccolorrgb.cpp.

References CCOLORRGB::b, CCOLORRGB::g, and CCOLORRGB::r.

66 {
67  const unsigned int r = aC1.r + aC2.r + aC3.r + aC4.r;
68  const unsigned int g = aC1.g + aC2.g + aC3.g + aC4.g;
69  const unsigned int b = aC1.b + aC2.b + aC3.b + aC4.b;
70 
71  return CCOLORRGB( (r >> 2), (g >> 2), (b >> 2) );
72 }
unsigned char r
Definition: ccolorrgb.h:41
unsigned char g
Definition: ccolorrgb.h:42
unsigned char b
Definition: ccolorrgb.h:43