Image

A namespace that provides functions for manipulating a wxImage.

Project

DatabaseCore

Include

Image.h

Summary
A namespace that provides functions for manipulating a wxImage.
Applies a color overlay to an image.
Outlines an image with one pixel of white.
Stretches an image to the given width.

Functions

Colorize

wxImage DATABASE_EXPORT_SPEC &Colorize(wxImage &image,
wxColour overlay)

Applies a color overlay to an image.  Colorize takes the given overlay color, breaks it into its component red, green, and blue colors, and then multiplies every pixel in the source image by the color percentage of the overlay color compared to white (255, 255, 255).  This has the effect of making a color overlay appear over the original image.

Parameters

imageThe image to colorize.
overlayThe color to colorize the image with.

Returns

A reference to a copy of the changed image.  This allows Image actions to be chained together.

Borderize

wxImage DATABASE_EXPORT_SPEC &Borderize(wxImage &image)

Outlines an image with one pixel of white.  Borderize takes the image, and changes every pixel along the edges of the image to white.

Parameters

imageThe image to borderize.

Returns

A reference to a copy of the changed image.  This allows Image actions to be chained together.

Taberize

wxImage DATABASE_EXPORT_SPEC &Taberize(wxImage &image,
const wxInt32 width)

Stretches an image to the given width.  Taberize takes the given image, finds its center column of pixels, and then stretches the image to fill the given width, filling in all stretched pixels per row with the one pixel in the center column.  This has the effect of keeping the ends of the image the same and having a long center section of the same pixels.

Parameters

imageThe image to taberize.
widthThe destination width of the image.

Returns

A reference to a copy of the changed image.  This allows Image actions to be chained together.

wxImage DATABASE_EXPORT_SPEC &Colorize(wxImage &image,
wxColour overlay)
Applies a color overlay to an image.
wxImage DATABASE_EXPORT_SPEC &Borderize(wxImage &image)
Outlines an image with one pixel of white.
wxImage DATABASE_EXPORT_SPEC &Taberize(wxImage &image,
const wxInt32 width)
Stretches an image to the given width.
DatabaseCore provides a set of commonly used Singletons and namespaces that handle important, but mundane aspects of game management, such as available player colors, configuration options, image maniplulation, file paths, and playing sounds.