Add alpha blending for wxImage::Paste

Add test cases for wxImage::Paste.

Closes #12458.

Co-Authored-By: Rachel Mark <kramdar@gmail.com>
This commit is contained in:
Eric Raijmakers
2020-09-23 11:56:58 +02:00
committed by Vadim Zeitlin
parent 8ae9987a29
commit 6e8da8641c
13 changed files with 490 additions and 26 deletions

View File

@@ -60,6 +60,21 @@ enum wxImageResizeQuality
wxIMAGE_QUALITY_HIGH
};
/**
Constants for wxImage::Paste() for specifying alpha blending option.
@since 3.2.0
*/
enum wxImageAlphaBlendMode
{
/// Overwrite the original alpha values with the ones being pasted.
wxIMAGE_ALPHA_BLEND_OVER = 0,
/// Compose the original alpha values with the ones being pasted.
wxIMAGE_ALPHA_BLEND_COMPOSE = 1
};
/**
Possible values for PNG image type option.
@@ -803,8 +818,17 @@ public:
/**
Copy the data of the given @a image to the specified position in this image.
Takes care of the mask colour and out of bounds problems.
@param alphaBlend
This parameter (new in wx 3.2.0) determines whether the alpha values
of the original image replace (default) or are composed with the
alpha channel of this image. Notice that alpha blending overrides
the mask handling.
*/
void Paste(const wxImage& image, int x, int y);
void Paste(const wxImage& image, int x, int y,
wxImageAlphaBlendMode alphaBlend = wxIMAGE_ALPHA_BLEND_OVER);
/**
Replaces the colour specified by @e r1,g1,b1 by the colour @e r2,g2,b2.