| ## Public API Reference

- Main Page
- Modules
- Namespaces
- Classes
- Files
- Related Pages

- Alphabetical List
- Class List
- Class Hierarchy
- Class Members

# csCursorConverter Class Reference
[Common Plugin Classes]

Helper class to convert images into data formats suitable for mouse cursor creation on various platforms and toolkits. More...

`#include <csplugincommon/canvas/cursorconvert.h>`

List of all members.

## Static Public Member Functions
static bool | ConvertTo1bpp (iImage *image, uint8 *&bitmap, uint8 *&mask, const csRGBcolor forecolor, const csRGBcolor backcolor, const csRGBcolor *keycolor=0, bool XbitOrder=false)
| Convert an image to 1bpp, computing an appropriate bitmap (by dithering to the given foreground and background colors) and mask (from the optionally given keycolor).
static bool | ConvertTo1bppAutoColor (iImage *image, uint8 *&bitmap, uint8 *&mask, csRGBcolor &forecolor, csRGBcolor &backcolor, const csRGBcolor *keycolor=0, bool XbitOrder=false)
| Convert an image to 1bpp, computing an appropriate bitmap.
static bool | ConvertTo8bpp (iImage *image, uint8 *&pixels, csRGBpixel *&palette, const csRGBcolor *keycolor=0)
| Convert an image to 8bpp, computing an appropriate palette and sets pixels matching the (optional) keycolor to 0.
static void | StripAlphaFromPal8 (csImageMemory *image)
| Remove the alpha from an image by replacing the transparent parts with index 0.
static void | StripAlphaFromRGBA (iImage *image, csRGBpixel replaceColor)
| Remove the alpha from an image by replacing the transparent parts with `replaceColor`.

## Detailed Description

Helper class to convert images into data formats suitable for mouse cursor creation on various platforms and toolkits.

Definition at line 44 of file cursorconvert.h.

## Member Function Documentation

static bool csCursorConverter::ConvertTo1bpp | ( | iImage * | image,
|  | uint8 *& | bitmap,
|  | uint8 *& | mask,
|  | const csRGBcolor | forecolor,
|  | const csRGBcolor | backcolor,
|  | const csRGBcolor * | keycolor = `0`,
|  | bool | XbitOrder = `false` |
| ) |  |  | `[static]`

Convert an image to 1bpp, computing an appropriate bitmap (by dithering to the given foreground and background colors) and mask (from the optionally given keycolor).

static bool csCursorConverter::ConvertTo1bppAutoColor | ( | iImage * | image,
|  | uint8 *& | bitmap,
|  | uint8 *& | mask,
|  | csRGBcolor & | forecolor,
|  | csRGBcolor & | backcolor,
|  | const csRGBcolor * | keycolor = `0`,
|  | bool | XbitOrder = `false` |
| ) |  |  | `[static]`

Convert an image to 1bpp, computing an appropriate bitmap.

The difference to ConvertTo1bpp() is that this method computes appropriate foreground and background colors.

static bool csCursorConverter::ConvertTo8bpp | ( | iImage * | image,
|  | uint8 *& | pixels,
|  | csRGBpixel *& | palette,
|  | const csRGBcolor * | keycolor = `0` |
| ) |  |  | `[static]`

Convert an image to 8bpp, computing an appropriate palette and sets pixels matching the (optional) keycolor to 0.

static void csCursorConverter::StripAlphaFromPal8 | ( | csImageMemory * | image | ) | `[static]`

Remove the alpha from an image by replacing the transparent parts with index 0.

static void csCursorConverter::StripAlphaFromRGBA | ( | iImage * | image,
|  | csRGBpixel | replaceColor |
| ) |  |  | `[static]`

Remove the alpha from an image by replacing the transparent parts with `replaceColor`.

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

- csplugincommon/canvas/cursorconvert.h