clan::PixelConverter Class Reference - ClanLib SDK
Description: clan::PixelConverter Class Reference

Public Member Functions | List of all members
clan::PixelConverter Class Reference
clanDisplay Display

Low level pixel format converter class. More...

`#include <pixel_converter.h>`

## Public Member Functions
| PixelConverter ()
| Constructs a pixel format converter.
| ~PixelConverter ()
void | convert (void *output, int output_pitch, TextureFormat output_format, const void *input, int input_pitch, TextureFormat input_format, int width, int height)
| Convert some pixel data.
bool | flip_vertical () const
| Returns the flip vertical setting.
float | get_gamma () const
| Returns the gamma setting.
bool | get_input_is_ycrcb () const
| Returns the JPEG JFIF YCrCb input setting.
bool | get_output_is_ycrcb () const
| Returns the JPEG JFIF YCrCb output setting.
bool | get_premultiply_alpha () const
| Returns the premultiply alpha setting.
Vec4i | get_swizzle () const
| Returns the input channel used for each output channel.
void | set_flip_vertical (bool enable)
| Set the flip vertical setting.
void | set_gamma (float gamma)
| Set the gamma applied when converting.
void | set_input_is_ycrcb (bool enable)
| Converts from JPEG JFIF YCrCb.
void | set_output_is_ycrcb (bool enable)
| Converts to JPEG JFIF YCrCb.
void | set_premultiply_alpha (bool enable)
| Set the premultiply alpha setting.
void | set_swizzle (const Vec4i &swizzle)
void | set_swizzle (int red_source, int green_source, int blue_source, int alpha_source)
| Set the input channel used for each output channel.

## Detailed Description

Low level pixel format converter class.

## Constructor & Destructor Documentation

## ◆ PixelConverter()

clan::PixelConverter::PixelConverter | ( |  | ) |

Constructs a pixel format converter.

## ◆ ~PixelConverter()

clan::PixelConverter::~PixelConverter | ( |  | ) |

## Member Function Documentation

## ◆ convert()

void clan::PixelConverter::convert | ( | void * | output,
|  | int | output_pitch,
|  | TextureFormat | output_format,
|  | const void * | input,
|  | int | input_pitch,
|  | TextureFormat | input_format,
|  | int | width,
|  | int | height )

Convert some pixel data.

## ◆ flip_vertical()

bool clan::PixelConverter::flip_vertical | ( |  | ) | const

Returns the flip vertical setting.

## ◆ get_gamma()

float clan::PixelConverter::get_gamma | ( |  | ) | const

Returns the gamma setting.

## ◆ get_input_is_ycrcb()

bool clan::PixelConverter::get_input_is_ycrcb | ( |  | ) | const

Returns the JPEG JFIF YCrCb input setting.

## ◆ get_output_is_ycrcb()

bool clan::PixelConverter::get_output_is_ycrcb | ( |  | ) | const

Returns the JPEG JFIF YCrCb output setting.

## ◆ get_premultiply_alpha()

bool clan::PixelConverter::get_premultiply_alpha | ( |  | ) | const

Returns the premultiply alpha setting.

## ◆ get_swizzle()

Vec4i clan::PixelConverter::get_swizzle | ( |  | ) | const

Returns the input channel used for each output channel.

## ◆ set_flip_vertical()

void clan::PixelConverter::set_flip_vertical | ( | bool | enable | ) |

Set the flip vertical setting.

This defaults to off.

## ◆ set_gamma()

void clan::PixelConverter::set_gamma | ( | float | gamma | ) |

Set the gamma applied when converting.

This defaults to 1.0 (off).

## ◆ set_input_is_ycrcb()

void clan::PixelConverter::set_input_is_ycrcb | ( | bool | enable | ) |

Converts from JPEG JFIF YCrCb.

## ◆ set_output_is_ycrcb()

void clan::PixelConverter::set_output_is_ycrcb | ( | bool | enable | ) |

Converts to JPEG JFIF YCrCb.

## ◆ set_premultiply_alpha()

void clan::PixelConverter::set_premultiply_alpha | ( | bool | enable | ) |

Set the premultiply alpha setting.

This defaults to off.

## ◆ set_swizzle() [1/2]

void clan::PixelConverter::set_swizzle | ( | const Vec4i & | swizzle | ) |

## ◆ set_swizzle() [2/2]

void clan::PixelConverter::set_swizzle | ( | int | red_source,
|  | int | green_source,
|  | int | blue_source,
|  | int | alpha_source )

Set the input channel used for each output channel.

Values 0-3 accepted. 0 = red, 1 = green, 2 = blue, 3 = alpha.

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

- pixel_converter.h