Skia
2DGraphicsLibrary
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
SkColorSpaceXform Class Reference
Inheritance diagram for SkColorSpaceXform:

Public Types

enum  ColorFormat {
  kRGBA_8888_ColorFormat, kBGRA_8888_ColorFormat, kRGB_U16_BE_ColorFormat, kRGBA_U16_BE_ColorFormat,
  kRGBA_F16_ColorFormat, kRGBA_F32_ColorFormat, kBGR_565_ColorFormat
}
 
enum  AlphaOp { kPreserve_AlphaOp, kPremul_AlphaOp, kSrcIsOpaque_AlphaOp }
 

Public Member Functions

bool apply (ColorFormat dstFormat, void *dst, ColorFormat srcFormat, const void *src, int count, SkAlphaType alphaType) const
 Apply the color conversion to a |src| buffer, storing the output in the |dst| buffer. More...
 

Static Public Member Functions

static std::unique_ptr
< SkColorSpaceXform
New (SkColorSpace *srcSpace, SkColorSpace *dstSpace)
 Create an object to handle color space conversions. More...
 
static bool Apply (SkColorSpace *dstCS, ColorFormat dstFormat, void *dst, SkColorSpace *srcCS, ColorFormat srcFormat, const void *src, int count, AlphaOp)
 

Member Function Documentation

bool SkColorSpaceXform::apply ( ColorFormat  dstFormat,
void *  dst,
ColorFormat  srcFormat,
const void *  src,
int  count,
SkAlphaType  alphaType 
) const

Apply the color conversion to a |src| buffer, storing the output in the |dst| buffer.

F16 and F32 are only supported when the color space is linear. This function will return false in unsupported cases.

Parameters
dstStored in the format described by |dstColorFormat|
srcStored in the format described by |srcColorFormat|
lenNumber of pixels in the buffers
dstColorFormatDescribes color format of |dst|
srcColorFormatDescribes color format of |src|
alphaTypeDescribes alpha properties of the |dst| (and |src|) kUnpremul preserves input alpha values kPremul performs a premultiplication and also preserves alpha values kOpaque optimization hint, |dst| alphas set to 1
static std::unique_ptr<SkColorSpaceXform> SkColorSpaceXform::New ( SkColorSpace srcSpace,
SkColorSpace dstSpace 
)
static

Create an object to handle color space conversions.

Parameters
srcSpaceThe encoded color space.
dstSpaceThe destination color space.

The documentation for this class was generated from the following file: