|
| Patrick's Programming Library Version 7.0.0 - Dokumentation |
Ein Datenobjekt zum Speichern eines Farbwertes. Mehr ...
Öffentliche Methoden | |
| Color () | |
| Konstruktor ohne Angabe von Werten. Mehr ... | |
| Color (int red, int green, int blue, int alpha=255) | |
| Konstruktor mit Angabe der Farbwerte. Mehr ... | |
| Color (ppluint32 rgba) | |
| Konstruktor mit Angabe eines Farbwertes als 32-Bit Wert. Mehr ... | |
| Color (ppluint32 rgb, int alpha) | |
| Konstruktor mit Angabe eines 32-Bit-Farbwertes und der Transparenz. Mehr ... | |
| int | alpha () const |
| Transparenz-Wert auslesen. Mehr ... | |
| Color & | blend (const Color &background, const Color &foreground, int intensity) |
| Farben überblenden. Mehr ... | |
| Color & | blendf (const Color &background, const Color &foreground, float intensity) |
| Farben überblenden. Mehr ... | |
| int | blue () const |
| blau-Anteil auslesen Mehr ... | |
| int | brightness () const |
| Helligkeit der Farbe. Mehr ... | |
| ppluint32 | color () const |
| Farbwert als 32-Bit-Wert auslesen. Mehr ... | |
| int | getY () const |
| Farbe in das YCbCr-Farbmodell umrechnen. Mehr ... | |
| int | getYCb () const |
| Farbe in das YCbCr-Farbmodell umrechnen. Mehr ... | |
| int | getYCr () const |
| Farbe in das YCbCr-Farbmodell umrechnen. Mehr ... | |
| int | green () const |
| grün-Anteil auslesen Mehr ... | |
| Color | grey () const |
| Grauwert der Farbe. Mehr ... | |
| bool | match (const Color &other, int tolerance=0) const |
| Farbübereinstimmung prüfen. Mehr ... | |
| Color | negativ () const |
| operator pplint32 () const | |
| Farbwert als 32-Bit-Wert auslesen. Mehr ... | |
| operator ppluint32 () const | |
| Farbwert als 32-Bit-Wert auslesen. Mehr ... | |
| bool | operator!= (const Color &other) const |
| Vergleich zweier Farben. Mehr ... | |
| Color & | operator*= (float factor) |
| Multiplikation der einzelnen Farbkomponenten mit einem Faktor. Mehr ... | |
| Color & | operator+= (const Color &other) |
| bool | operator< (const Color &other) const |
| bool | operator<= (const Color &other) const |
| bool | operator== (const Color &other) const |
| Vergleich zweier Farben. Mehr ... | |
| bool | operator> (const Color &other) const |
| bool | operator>= (const Color &other) const |
| int | red () const |
| rot-Anteil auslesen Mehr ... | |
| ppluint32 | rgb () const |
| Farbwert als 32-Bit-Wert ohne Alpha-Kanal auslesen. Mehr ... | |
| ppluint32 | rgba () const |
| Farbwert als 32-Bit-Wert auslesen. Mehr ... | |
| void | set (int red, int green, int blue, int alpha=255) |
| Farbwert anhand der einzelnen Farbkomponenten setzen. Mehr ... | |
| void | set (const Color &other) |
| void | setAlpha (int alpha) |
| Transparenz-Wert setzen. Mehr ... | |
| void | setBlue (int blue) |
| blau-Anteil setzen Mehr ... | |
| void | setColor (int red, int green, int blue, int alpha=255) |
| Farbwert anhand der einzelnen Farbkomponenten setzen. Mehr ... | |
| void | setColor (ppluint32 rgba) |
| Farbwert anhand eines 32-Bit-Wertes setzen. Mehr ... | |
| void | setColor (ppluint32 rgb, int alpha) |
| Farbwert anhand eines 32-Bit-Farbwertes und der Transparenz setzen. Mehr ... | |
| void | setGreen (int green) |
| grün-Anteil setzen Mehr ... | |
| void | setRed (int red) |
| rot-Anteil setzen Mehr ... | |
Öffentliche, statische Methoden | |
| static Color | getBlended (const Color &background, const Color &foreground, int intensity) |
| static Color | getBlendedf (const Color &background, const Color &foreground, float intensity) |
Private Attribute | |
| union { | |
| struct { | |
| ppluint8 a | |
| ppluint8 b | |
| ppluint8 g | |
| ppluint8 r | |
| } | |
| ppluint32 c | |
| }; | |
Freundbeziehungen | |
| const Color | operator* (const Color &size, float factor) |
| Multiplikation einer Farbe mit einem Faktor. Mehr ... | |
| const Color | operator* (float factor, const Color &size) |
| Multiplikation einer Farbe mit einem Faktor. Mehr ... | |
| const Color | operator+ (const Color &color1, const Color &color2) |
| ppl7::grafix::Color::Color | ( | ) |
| ppl7::grafix::Color::Color | ( | int | red, |
| int | green, | ||
| int | blue, | ||
| int | alpha = 255 |
||
| ) |
| red | Wert zwischen 0 und 255, der den rot-Anteil der Farbe festlegt |
| green | Wert zwischen 0 und 255, der den grün-Anteil der Farbe festlegt |
| blue | Wert zwischen 0 und 255, der den blau-Anteil der Farbe festlegt |
| alpha | Optionaler Wert zwischen 0 und 255, der die Transparenz der Farbe festlegt. 0 bedeutet komplett transparent, 255 komplett sichtbar. |
| ppl7::grafix::Color::Color | ( | ppluint32 | rgba | ) |
| rgba | 32-Bit Farbwert mit folgendem Aufbau:
|
| ppl7::grafix::Color::Color | ( | ppluint32 | rgb, |
| int | alpha | ||
| ) |
rgb und der Transparenz alpha initialisiert wird.| rgb | 32-Bit Farbwert mit folgendem Aufbau:
|
| alpha | Der Transparenz-Wert der Farbe zwischen 0 (völlig transparent) und 255 (vollständig sichtbar). |
| int ppl7::grafix::Color::alpha | ( | ) | const |
| Color & ppl7::grafix::Color::blend | ( | const Color & | background, |
| const Color & | foreground, | ||
| int | intensity | ||
| ) |
background und foreground anhand des dritten Parameters intensity vermischt. Dabei gilt, je höher der Wert intensity, desto stärker kommt der Farbwert foreground zur Geltung.| background | Hintergrundfarbe |
| foreground | Vordergrundfarbe |
| intensity | Intensität der Vordergrundfarbe auf einer Skala von 0-255 |
| Color & ppl7::grafix::Color::blendf | ( | const Color & | background, |
| const Color & | foreground, | ||
| float | intensity | ||
| ) |
background und foreground anhand des dritten Parameters intensity vermischt. Dabei gilt, je höher der Wert intensity, desto stärker kommt der Farbwert foreground zur Geltung.| background | Hintergrundfarbe |
| foreground | Vordergrundfarbe |
| intensity | Intensität der Vordergrundfarbe auf einer Skala von 0.0 bis 1.0 |
| int ppl7::grafix::Color::blue | ( | ) | const |
| int ppl7::grafix::Color::brightness | ( | ) | const |
. Der Alpha-Kanal (Transparenz) spielt bei der Berechnung keine Rolle.| ppluint32 ppl7::grafix::Color::color | ( | ) | const |
|
static |
|
static |
| int ppl7::grafix::Color::getY | ( | ) | const |
| int ppl7::grafix::Color::getYCb | ( | ) | const |
| int ppl7::grafix::Color::getYCr | ( | ) | const |
| int ppl7::grafix::Color::green | ( | ) | const |
| Color ppl7::grafix::Color::grey | ( | ) | const |
| bool ppl7::grafix::Color::match | ( | const Color & | other, |
| int | tolerance = 0 |
||
| ) | const |
other mit dieser übereinstimmt, wobei jeder der drei Farbwerte (rot, grün, blau) eine maximale Abweichung von tolerance haben darf. Der Alpha-Kanal wird dabei nicht berücksichtigt.| other | Der zu vergleichende Farbwert |
| tolerance | Ein optionaler Parameter, der die maximale Toleranz auf einer Skala von 0-255 angibt. Der Default ist 0 |
true zurück, andernfalls false. | Color ppl7::grafix::Color::negativ | ( | ) | const |
| ppl7::grafix::Color::operator pplint32 | ( | ) | const |
| ppl7::grafix::Color::operator ppluint32 | ( | ) | const |
| bool ppl7::grafix::Color::operator!= | ( | const Color & | other | ) | const |
== und != können zwei Farbwerte miteinander verglichen werden.| other | Anderer Farbwert |
== wird true zurückgegeben, wenn beide Farbwerte identisch sind und false, wenn dies nicht der Fall ist. Bei Verwendung des Operators != wird true zurückgegeben, wenn die Farbwerte unterschiedlich sind und false, wenn sie identisch sind. | Color & ppl7::grafix::Color::operator*= | ( | float | factor | ) |
| factor | Der Multiplikator als float-Wert |
| bool ppl7::grafix::Color::operator< | ( | const Color & | other | ) | const |
| bool ppl7::grafix::Color::operator<= | ( | const Color & | other | ) | const |
| bool ppl7::grafix::Color::operator== | ( | const Color & | other | ) | const |
== und != können zwei Farbwerte miteinander verglichen werden.| other | Anderer Farbwert |
== wird true zurückgegeben, wenn beide Farbwerte identisch sind und false, wenn dies nicht der Fall ist. Bei Verwendung des Operators != wird true zurückgegeben, wenn die Farbwerte unterschiedlich sind und false, wenn sie identisch sind. | bool ppl7::grafix::Color::operator> | ( | const Color & | other | ) | const |
| bool ppl7::grafix::Color::operator>= | ( | const Color & | other | ) | const |
| int ppl7::grafix::Color::red | ( | ) | const |
| ppluint32 ppl7::grafix::Color::rgb | ( | ) | const |
| ppluint32 ppl7::grafix::Color::rgba | ( | ) | const |
| void ppl7::grafix::Color::set | ( | int | red, |
| int | green, | ||
| int | blue, | ||
| int | alpha = 255 |
||
| ) |
| red | Wert zwischen 0 und 255, der den rot-Anteil der Farbe festlegt |
| green | Wert zwischen 0 und 255, der den grün-Anteil der Farbe festlegt |
| blue | Wert zwischen 0 und 255, der den blau-Anteil der Farbe festlegt |
| alpha | Optionaler Wert zwischen 0 und 255, der die Transparenz der Farbe festlegt. 0 bedeutet komplett transparent, 255 komplett sichtbar. Wird der Parameter nicht angegeben, wird automatisch 255 gesetzt. |
| void ppl7::grafix::Color::set | ( | const Color & | other | ) |
| void ppl7::grafix::Color::setAlpha | ( | int | alpha | ) |
| red | Transparenz-Wert zwischen 0 (völlig transparent) und 255 (vollständig sichtbar). Ein Wert kleiner 0 wird zu 0, ein Wert größer 255 wird zu 255. |
| void ppl7::grafix::Color::setBlue | ( | int | blue | ) |
| red | blau-Anteil zwischen 0 und 255. Ein Wert kleiner 0 wird zu 0, ein Wert größer 255 wird zu 255. |
| void ppl7::grafix::Color::setColor | ( | int | red, |
| int | green, | ||
| int | blue, | ||
| int | alpha = 255 |
||
| ) |
| red | Wert zwischen 0 und 255, der den rot-Anteil der Farbe festlegt |
| green | Wert zwischen 0 und 255, der den grün-Anteil der Farbe festlegt |
| blue | Wert zwischen 0 und 255, der den blau-Anteil der Farbe festlegt |
| alpha | Optionaler Wert zwischen 0 und 255, der die Transparenz der Farbe festlegt. 0 bedeutet komplett transparent, 255 komplett sichtbar. Wird der Parameter nicht angegeben, wird automatisch 255 gesetzt. |
| void ppl7::grafix::Color::setColor | ( | ppluint32 | rgba | ) |
| rgba | 32-Bit Farbwert mit folgendem Aufbau:
|
| void ppl7::grafix::Color::setColor | ( | ppluint32 | rgb, |
| int | alpha | ||
| ) |
rgb und der Transparenz alpha gesetzt.| rgb | 32-Bit Farbwert mit folgendem Aufbau:
|
| alpha | Der Transparenz-Wert der Farbe zwischen 0 (völlig transparent) und 255 (vollständig sichtbar). |
| void ppl7::grafix::Color::setGreen | ( | int | green | ) |
| red | grün-Anteil zwischen 0 und 255. Ein Wert kleiner 0 wird zu 0, ein Wert größer 255 wird zu 255. |
| void ppl7::grafix::Color::setRed | ( | int | red | ) |
| red | rot-Anteil zwischen 0 und 255. Ein Wert kleiner 0 wird zu 0, ein Wert größer 255 wird zu 255. |
color mit dem Faktor factor multipliziert und das Ergebnis als neuer Farbwert zurückgegeben. Ein Wert größer 1.0 bewirkt, dass die Farbe heller wird, bei Werten kleiner 1,0 wird die Farbe dunkler.Ist das Ergebnis der Multiplikation eines Farbwertes größer 255, wird er auf 255 gesetzt. Ein negativer Faktor wird zu 0.
| color | Farbwert |
| factor | Multiplikations-Faktor |
color mit dem Faktor factor multipliziert und das Ergebnis als neuer Farbwert zurückgegeben. Ein Wert größer 1.0 bewirkt, dass die Farbe heller wird, bei Werten kleiner 1,0 wird die Farbe dunkler.Ist das Ergebnis der Multiplikation eines Farbwertes größer 255, wird er auf 255 gesetzt. Ein negativer Faktor wird zu 0.
| factor | Multiplikations-Faktor |
| color | Farbwert |
| union { ... } |
| ppluint8 ppl7::grafix::Color::a |
| ppluint8 ppl7::grafix::Color::b |
| ppl7::grafix::Color::c |
| ppluint8 ppl7::grafix::Color::g |
| ppluint8 ppl7::grafix::Color::r |