mirror of
https://github.com/aseprite/aseprite.git
synced 2025-03-30 04:20:23 +00:00
Avoid std::find() for each pixel on HueSaturation for RGB images
This commit is contained in:
parent
59c7f7dcec
commit
690d3f5a5e
@ -63,9 +63,9 @@ void HueSaturationFilter::applyToRgba(FilterManager* filterMgr)
|
||||
|
||||
if (filterMgr->isFirstRow()) {
|
||||
m_picks = fid->getPalettePicks();
|
||||
if (m_picks.picks() > 0) {
|
||||
m_usePalette = (m_picks.picks() > 0);
|
||||
if (m_usePalette)
|
||||
applyToPalette(filterMgr);
|
||||
}
|
||||
}
|
||||
|
||||
const Palette* pal = fid->getPalette();
|
||||
@ -83,7 +83,7 @@ void HueSaturationFilter::applyToRgba(FilterManager* filterMgr)
|
||||
|
||||
color_t c = *(src_address++);
|
||||
|
||||
if (m_picks.picks() > 0) {
|
||||
if (m_usePalette) {
|
||||
int i =
|
||||
pal->findExactMatch(rgba_getr(c),
|
||||
rgba_getg(c),
|
||||
|
@ -37,6 +37,7 @@ namespace filters {
|
||||
double m_h, m_s, m_l;
|
||||
int m_a;
|
||||
doc::PalettePicks m_picks;
|
||||
bool m_usePalette;
|
||||
};
|
||||
|
||||
} // namespace filters
|
||||
|
Loading…
x
Reference in New Issue
Block a user