Slightly simplify spectrum image generation in the colorpicker
This commit is contained in:
parent
e2022449d9
commit
5bf4f80920
1 changed files with 2 additions and 6 deletions
|
@ -918,12 +918,8 @@ void DialogColorPicker::UpdateSpectrumDisplay() {
|
||||||
|
|
||||||
template<typename Func>
|
template<typename Func>
|
||||||
static wxBitmap *make_spectrum(wxBitmap *bitmap, Func func) {
|
static wxBitmap *make_spectrum(wxBitmap *bitmap, Func func) {
|
||||||
unsigned char *spec = (unsigned char *)malloc(256*256*3);
|
wxImage spectrum_image(256, 256);
|
||||||
if (!spec) throw std::bad_alloc();
|
func(spectrum_image.GetData());
|
||||||
|
|
||||||
func(spec);
|
|
||||||
|
|
||||||
wxImage spectrum_image(256, 256, spec);
|
|
||||||
*bitmap = wxBitmap(spectrum_image);
|
*bitmap = wxBitmap(spectrum_image);
|
||||||
return bitmap;
|
return bitmap;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue