Audacity 3.2.0
|
#include "ImageManipulation.h"
#include <wx/colour.h>
#include <wx/image.h>
#include "AllThemeResources.h"
#include "Theme.h"
Go to the source code of this file.
Functions | |
std::unique_ptr< wxImage > | ChangeImageColour (wxImage *srcImage, wxColour &dstColour) |
std::unique_ptr< wxImage > | ChangeImageColour (wxImage *srcImage, wxColour &srcColour, wxColour &dstColour) |
std::unique_ptr< wxImage > | OverlayImage (wxImage *background, wxImage *foreground, wxImage *mask, int xoff, int yoff) |
std::unique_ptr< wxImage > | OverlayImage (teBmps eBack, teBmps eForeground, int xoff, int yoff) |
The index of a bitmap resource in Theme Resources. More... | |
std::unique_ptr< wxImage > | CreateBackground (int width, int height, wxColour colour) |
std::unique_ptr< wxImage > | CreateSysBackground (int width, int height, int WXUNUSED(offset), wxColour colour) |
void | PasteSubImage (wxImage *background, wxImage *foreground, int xoff, int yoff) |
wxImage | GetSubImageWithAlpha (const wxImage &Src, const wxRect &rect) |
Provides Image Manipulation functions.
wxWidgets misses some important functions involving cutting and pasting bitmaps, and (in version 2.6.1) is patchy in support of alpha channel. This collection of functions fills that gap.
Definition in file ImageManipulation.cpp.
This looks at the first pixel in the image, and shifts the entire image by the vector difference between that pixel and the dstColour. For better control, use ChangeImageColour(wxImage, wxColour*, wxColour*) below
Definition at line 37 of file ImageManipulation.cpp.
References ChangeImageColour().
Referenced by ChangeImageColour(), and ThemeBase::RecolourBitmap().
std::unique_ptr< wxImage > ChangeImageColour | ( | wxImage * | srcImage, |
wxColour & | srcColour, | ||
wxColour & | dstColour | ||
) |
This will explicitly shift the image color from srcColour to dstColour.
Definition at line 47 of file ImageManipulation.cpp.
std::unique_ptr< wxImage > CreateBackground | ( | int | width, |
int | height, | ||
wxColour | colour | ||
) |
Definition at line 266 of file ImageManipulation.cpp.
Referenced by CreateSysBackground().
std::unique_ptr< wxImage > CreateSysBackground | ( | int | width, |
int | height, | ||
int | WXUNUSEDoffset, | ||
wxColour | colour | ||
) |
Definition at line 287 of file ImageManipulation.cpp.
References CreateBackground().
Gets a rectangle from within another image, INCLUDING the alpha channel
Definition at line 354 of file ImageManipulation.cpp.
References wxImage(), and wxT().
Referenced by ThemeBase::ReadImageCache().
The index of a bitmap resource in Theme Resources.
Takes a background image, foreground image, and mask (i.e. the alpha channel for the foreground), and returns a NEW image where the foreground has been overlaid onto the background using alpha-blending, at location (xoff, yoff).
Definition at line 177 of file ImageManipulation.cpp.
References ThemeBase::Colour(), ThemeBase::Image(), theTheme, and wxImage().
std::unique_ptr< wxImage > OverlayImage | ( | wxImage * | background, |
wxImage * | foreground, | ||
wxImage * | mask, | ||
int | xoff, | ||
int | yoff | ||
) |
Takes a background image, foreground image, and mask (i.e. the alpha channel for the foreground), and returns a NEW image where the foreground has been overlaid onto the background using alpha-blending, at location (xoff, yoff).
Definition at line 111 of file ImageManipulation.cpp.
Referenced by ToolBar::MakeAlternateImages(), and ToolBar::MakeButton().
Pastes one image into another including the alpha channel. Differs from OverlayImage in that: Happens in place to existing background image. Pastes image on top; no blending with existing background is done.
Definition at line 297 of file ImageManipulation.cpp.
Referenced by ThemeBase::CreateOneImageCache().