Beatmup
|
Set of handy operations with images. More...
Functions | |
InternalBitmap * | makeCopy (AbstractBitmap &bitmap) |
Makes a copy of a bitmap. More... | |
InternalBitmap * | makeCopy (AbstractBitmap &bitmap, PixelFormat pixelFormat) |
Makes a copy of a bitmap converting the data to a given pixel format. More... | |
InternalBitmap * | makeCopy (AbstractBitmap &bitmap, Context &context, PixelFormat pixelFormat) |
Makes a copy of a bitmap for a given Context converting the data to a given pixel format. More... | |
InternalBitmap * | chessboard (Context &context, int width, int height, int cellSize, PixelFormat pixelFormat=BinaryMask) |
Renders a chessboard image. More... | |
void | noise (AbstractBitmap &bitmap, IntRectangle area) |
Replaces a rectangular area in a bitmap by random noise. More... | |
void | noise (AbstractBitmap &bitmap) |
Fills a given bitmap with random noise. More... | |
void | makeOpaque (AbstractBitmap &bitmap, IntRectangle area) |
Makes a bitmap area opaque. More... | |
void | invert (AbstractBitmap &input, AbstractBitmap &output) |
Inverses colors of an image in a pixelwise fashion. More... | |
IntPoint | scanlineSearch (AbstractBitmap &source, pixint4 val, const IntPoint &startFrom) |
Goes through a bitmap in scanline order (left to right, top to bottom) until a pixel of a given color is met. More... | |
IntPoint | scanlineSearch (AbstractBitmap &source, pixfloat4 val, const IntPoint &startFrom) |
Set of handy operations with images.
InternalBitmap * Beatmup::BitmapTools::makeCopy | ( | AbstractBitmap & | bitmap | ) |
Makes a copy of a bitmap.
The copy is done in an AbstractTask run in the default thread pool of the context the bitmap is attached to.
[in] | bitmap | The bitmap to copy |
Definition at line 72 of file tools.cpp.
InternalBitmap * Beatmup::BitmapTools::makeCopy | ( | AbstractBitmap & | bitmap, |
PixelFormat | pixelFormat | ||
) |
Makes a copy of a bitmap converting the data to a given pixel format.
The copy is done in an AbstractTask run in the default thread pool of the context the bitmap is attached to.
[in] | bitmap | The bitmap to copy |
[in] | pixelFormat | Pixel format of the copy |
InternalBitmap * Beatmup::BitmapTools::makeCopy | ( | AbstractBitmap & | bitmap, |
Context & | context, | ||
PixelFormat | pixelFormat | ||
) |
Makes a copy of a bitmap for a given Context converting the data to a given pixel format.
Can be used to exchange image content between different instances of Context. The copy is done in an AbstractTask run in the default thread pool of the source bitmap context.
[in] | bitmap | The bitmap to copy |
[in] | context | The Context instance the copy is associated with |
[in] | pixelFormat | Pixel format of the copy |
Definition at line 82 of file tools.cpp.
InternalBitmap * Beatmup::BitmapTools::chessboard | ( | Context & | context, |
int | width, | ||
int | height, | ||
int | cellSize, | ||
PixelFormat | pixelFormat = BinaryMask |
||
) |
Renders a chessboard image.
[in] | context | A Context instance |
[in] | width | Width in pixels of the resulting bitmap |
[in] | height | Height in pixels of the resulting bitmap |
[in] | cellSize | Size of a single chessboard cell in pixels |
[in] | pixelFormat | Pixel format of the resulting bitmap |
Definition at line 91 of file tools.cpp.
void Beatmup::BitmapTools::noise | ( | AbstractBitmap & | bitmap, |
IntRectangle | area | ||
) |
Replaces a rectangular area in a bitmap by random noise.
[in] | bitmap | The bitmap |
[in] | area | The area in pixels to process |
Definition at line 100 of file tools.cpp.
void Beatmup::BitmapTools::noise | ( | AbstractBitmap & | bitmap | ) |
Fills a given bitmap with random noise.
[in] | bitmap | The bitmap to fill |
Definition at line 126 of file tools.cpp.
void Beatmup::BitmapTools::makeOpaque | ( | AbstractBitmap & | bitmap, |
IntRectangle | area | ||
) |
Makes a bitmap area opaque.
Applies for bitmaps having the alpha channel (of QuadByte and QuadFloat pixel formats). Bitmaps of other pixel formats remain unchanged.
[in] | bitmap | The bitmap |
[in] | area | The area in pixels to process |
Definition at line 131 of file tools.cpp.
void Beatmup::BitmapTools::invert | ( | AbstractBitmap & | input, |
AbstractBitmap & | output | ||
) |
Inverses colors of an image in a pixelwise fashion.
[in] | input | The input image. Its content unchanged. |
[in] | output | The output image. |
Definition at line 155 of file tools.cpp.
IntPoint Beatmup::BitmapTools::scanlineSearch | ( | AbstractBitmap & | source, |
pixint4 | val, | ||
const IntPoint & | startFrom | ||
) |
Goes through a bitmap in scanline order (left to right, top to bottom) until a pixel of a given color is met.
[in] | source | The bitmap to scan |
[in] | val | The color value to look for |
[in] | startFrom | Starting pixel position |
Definition at line 195 of file tools.cpp.
IntPoint Beatmup::BitmapTools::scanlineSearch | ( | AbstractBitmap & | source, |
pixfloat4 | val, | ||
const IntPoint & | startFrom | ||
) |