openMSX
|
#include <PixelOperations.hh>
Public Member Functions | |
Pixel | getRmask () const |
Pixel | getGmask () const |
Pixel | getBmask () const |
Pixel | getAmask () const |
unsigned | red (Pixel p) const |
Extract RGBA components, each in range [0..255]. | |
unsigned | green (Pixel p) const |
unsigned | blue (Pixel p) const |
unsigned | alpha (Pixel p) const |
Pixel | combine (unsigned r, unsigned g, unsigned b) const |
Combine RGB components to a pixel. | |
template<unsigned w1, unsigned w2> | |
Pixel | blend (Pixel p1, Pixel p2) const |
Blend the given colors into a single color. | |
template<unsigned w1, unsigned w2, unsigned w3> | |
Pixel | blend (Pixel p1, Pixel p2, Pixel p3) const |
template<unsigned w1, unsigned w2, unsigned w3, unsigned w4> | |
Pixel | blend (Pixel p1, Pixel p2, Pixel p3, Pixel p4) const |
template<unsigned w1, unsigned w2, unsigned w3, unsigned w4, unsigned w5, unsigned w6> | |
Pixel | blend (Pixel p1, Pixel p2, Pixel p3, Pixel p4, Pixel p5, Pixel p6) const |
template<unsigned w1, unsigned w2> | |
Pixel | blend (std::span< const Pixel, 2 > p) const |
template<unsigned w1, unsigned w2, unsigned w3> | |
Pixel | blend (std::span< const Pixel, 3 > p) const |
template<unsigned w1, unsigned w2, unsigned w3, unsigned w4> | |
Pixel | blend (std::span< const Pixel, 4 > p) const |
template<unsigned w1, unsigned w2, unsigned w3, unsigned w4, unsigned w5, unsigned w6> | |
Pixel | blend (std::span< const Pixel, 6 > p) const |
Pixel | lerp (Pixel p1, Pixel p2, unsigned x) const |
Perform linear interpolation between two pixels. | |
Pixel | alphaBlend (Pixel p1, Pixel p2) const |
Perform alpha blending of two pixels. | |
Static Public Member Functions | |
static Pixel | multiply (Pixel p, unsigned x) |
Perform a component wise multiplication of a pixel with an 8-bit fractional value: result = (pixel * x) / 256 [component wise] 'x' must be in range [0..256]. | |
Definition at line 12 of file PixelOperations.hh.
|
inline |
Definition at line 100 of file PixelOperations.hh.
Referenced by alphaBlend(), and openmsx::alphaBlendLines().
Perform alpha blending of two pixels.
Pixel p1 contains the alpha value. For maximal alpha p1 is returned, for minimal alpha p2.
Definition at line 309 of file PixelOperations.hh.
References alpha(), and lerp().
Referenced by openmsx::alphaBlendLines().
|
inline |
Blend the given colors into a single color.
The special case for blending between two colors with an equal blend weight has an optimized implementation.
Definition at line 126 of file PixelOperations.hh.
|
inline |
Definition at line 259 of file PixelOperations.hh.
|
inline |
Definition at line 265 of file PixelOperations.hh.
|
inline |
Definition at line 271 of file PixelOperations.hh.
|
inline |
Definition at line 278 of file PixelOperations.hh.
|
inline |
Definition at line 96 of file PixelOperations.hh.
|
inline |
Combine RGB components to a pixel.
Definition at line 105 of file PixelOperations.hh.
References g.
Referenced by blend(), blend(), blend(), openmsx::LDSDLRasterizer::drawBlank(), and openmsx::OutputSurface::mapRGB255().
|
inline |
Definition at line 18 of file PixelOperations.hh.
Referenced by openmsx::PNG::load(), and openmsx::PNG::saveRGBA().
|
inline |
Definition at line 17 of file PixelOperations.hh.
Referenced by openmsx::PNG::load(), and openmsx::PNG::saveRGBA().
|
inline |
Definition at line 16 of file PixelOperations.hh.
Referenced by openmsx::PNG::load(), and openmsx::PNG::saveRGBA().
|
inline |
Definition at line 15 of file PixelOperations.hh.
Referenced by openmsx::PNG::load(), and openmsx::PNG::saveRGBA().
|
inline |
Definition at line 92 of file PixelOperations.hh.
Perform linear interpolation between two pixels.
This calculates component-wise: (c1 * (256 - x) + c2 * x) / 256 with c1, c2 the R,B,G,A components of the pixel. 'x' must be in range [0..256]. For x=0 the result is p1. For x=256 the result is p2.
Definition at line 289 of file PixelOperations.hh.
Referenced by alphaBlend().
Perform a component wise multiplication of a pixel with an 8-bit fractional value: result = (pixel * x) / 256 [component wise] 'x' must be in range [0..256].
For x=0 the result is 0. For x=255 the result in the original value. Note: ATM only implemented for 32bpp.
Definition at line 283 of file PixelOperations.hh.
Referenced by openmsx::alphaBlendLines().
|
inline |
Extract RGBA components, each in range [0..255].
Definition at line 88 of file PixelOperations.hh.