Audacity  2.2.0
ImageManipulation.h File Reference
#include "MemoryX.h"
#include <wx/defs.h>
#include <wx/colour.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)
 
std::unique_ptr< wxImage > CreateBackground (int width, int height, wxColour colour)
 
std::unique_ptr< wxImage > CreateAquaBackground (int width, int height, int offset)
 
std::unique_ptr< wxImage > CreateSysBackground (int width, int height, int offset, wxColour colour)
 
void PasteSubImage (wxImage *pDest, wxImage *pSrc, int x, int y)
 
wxImage GetSubImageWithAlpha (const wxImage &Src, const wxRect &rect)
 

Function Documentation

std::unique_ptr<wxImage> ChangeImageColour ( wxImage *  srcImage,
wxColour &  dstColour 
)

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

References ChangeImageColour().

Referenced by ChangeImageColour(), ToolBar::MakeRecoloredImage(), 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.

std::unique_ptr<wxImage> CreateAquaBackground ( int  width,
int  height,
int  offset 
)

Referenced by CreateSysBackground().

std::unique_ptr<wxImage> CreateBackground ( int  width,
int  height,
wxColour  colour 
)

Referenced by CreateSysBackground().

std::unique_ptr<wxImage> CreateSysBackground ( int  width,
int  height,
int  offset,
wxColour  colour 
)
wxImage GetSubImageWithAlpha ( const wxImage &  Src,
const wxRect &  rect 
)

Gets a rectangle from within another image, INCLUDING the alpha channel

Bug:
in wxWidgets, wxImage::GetSubImage should do this itself.

Referenced by ThemeBase::ReadImageCache().

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 an NEW image where the foreground has been overlaid onto the background using alpha-blending, at location (xoff, yoff).

Referenced by ToolBar::MakeAlternateImages(), and ToolBar::MakeButton().

std::unique_ptr<wxImage> OverlayImage ( teBmps  eBack,
teBmps  eForeground,
int  xoff,
int  yoff 
)

Takes a background image, foreground image, and mask (i.e. the alpha channel for the foreground), and returns an NEW image where the foreground has been overlaid onto the background using alpha-blending, at location (xoff, yoff).

References ThemeBase::Colour(), ThemeBase::Image(), and theTheme.

void PasteSubImage ( wxImage *  background,
wxImage *  foreground,
int  xoff,
int  yoff 
)

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.

Referenced by ThemeBase::CreateImageCache().