MCPcopy Create free account
hub / github.com/audacity/audacity / ChangeImageColour

Function ChangeImageColour

libraries/lib-theme/ImageManipulation.cpp:37–43  ·  view source on GitHub ↗

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

Source from the content-addressed store, hash-verified

35/// pixel and the dstColour. For better control, use
36/// ChangeImageColour(wxImage, wxColour*, wxColour*) below
37std::unique_ptr<wxImage> ChangeImageColour(wxImage * srcImage, wxColour & dstColour)
38{
39 unsigned char *src = srcImage->GetData();
40 wxColour c;
41 c.Set(src[0], src[1], src[2]);
42 return ChangeImageColour(srcImage, c, dstColour);
43}
44
45///This will explicitly shift the image color from
46///srcColour to dstColour.

Callers 1

RecolourBitmapMethod · 0.85

Calls 5

GetHeightMethod · 0.80
GetAlphaMethod · 0.80
GetDataMethod · 0.45
SetMethod · 0.45
GetWidthMethod · 0.45

Tested by

no test coverage detected