1
0
mirror of https://github.com/cookiengineer/audacity synced 2026-03-06 14:35:32 +01:00

Image manipulation functions return smart pointers

This commit is contained in:
Paul Licameli
2016-03-31 13:41:42 -04:00
parent 99cb50d6db
commit c78e91f6c1
3 changed files with 29 additions and 29 deletions

View File

@@ -8,6 +8,7 @@
**********************************************************************/
#include "MemoryX.h"
#include <wx/defs.h>
#include <wx/colour.h>
#include "Theme.h"
@@ -18,7 +19,7 @@ class wxImage;
// the entire image by the vector difference between that
// pixel and the dstColour. For better control, use
// ChangeImageColour(wxImage, wxColour*, wxColour*) below
wxImage *ChangeImageColour(wxImage * srcImage, wxColour & dstColour);
std::unique_ptr<wxImage> ChangeImageColour(wxImage * srcImage, wxColour & dstColour);
// This function takes a source image, which it assumes to
// be grayscale, and smoothly changes the overall color
@@ -27,7 +28,7 @@ wxImage *ChangeImageColour(wxImage * srcImage, wxColour & dstColour);
// Audacity uses this routines to make the buttons
// (skip-start, play, stop, record, skip-end) adapt to
// the color scheme of the user.
wxImage *ChangeImageColour(wxImage * srcImage,
std::unique_ptr<wxImage> ChangeImageColour(wxImage * srcImage,
wxColour & srcColour,
wxColour & dstColour);
@@ -36,25 +37,25 @@ wxImage *ChangeImageColour(wxImage * srcImage,
// returns an NEW image where the foreground has been
// overlaid onto the background using alpha-blending,
// at location (xoff, yoff).
wxImage *OverlayImage(wxImage * background, wxImage * foreground,
std::unique_ptr<wxImage> OverlayImage(wxImage * background, wxImage * foreground,
wxImage * mask, int xoff, int yoff);
// Same idea, but this time the mask is an alpha channel in
// the foreground bitmap, and it's all retrieved from Themes.
wxImage *OverlayImage(teBmps eBack, teBmps eForeground,
std::unique_ptr<wxImage> OverlayImage(teBmps eBack, teBmps eForeground,
int xoff, int yoff);
// Creates an image with a solid background color
wxImage *CreateBackground(int width, int height, wxColour colour);
std::unique_ptr<wxImage> CreateBackground(int width, int height, wxColour colour);
// Creates an image with the Mac OS X Aqua stripes, to be used
// as a background
wxImage *CreateAquaBackground(int width, int height, int offset);
std::unique_ptr<wxImage> CreateAquaBackground(int width, int height, int offset);
// Uses color on all OS except Mac, uses Aqua
wxImage *CreateSysBackground(int width, int height, int offset,
std::unique_ptr<wxImage> CreateSysBackground(int width, int height, int offset,
wxColour colour);
// Pastes one image into another at specified location.