Avoid std::find() for each pixel on HueSaturation for RGB images

This commit is contained in:
David Capello 2017-06-23 12:17:07 -03:00
parent 59c7f7dcec
commit 690d3f5a5e
2 changed files with 4 additions and 3 deletions

View File

@ -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),

View File

@ -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