22 #ifndef SCI_GRAPHICS_REMAP32_H 23 #define SCI_GRAPHICS_REMAP32_H 25 #include "common/algorithm.h" 26 #include "common/array.h" 27 #include "common/scummsys.h" 28 #include "sci/graphics/helpers.h" 38 kRemapToPercentGray = 4
42 #pragma mark SingleRemap 136 Color _originalColors[237];
143 bool _originalColorsChanged[237];
148 Color _idealColors[237];
155 bool _idealColorsChanged[237];
165 int _matchDistances[237];
181 bool updateBrightness();
189 bool updateSaturation();
197 bool updateSaturationAndBrightness();
215 int colorDistance(
const Color &a,
const Color &b)
const;
225 int16 matchColor(
const Color &color,
const int minimumDistance,
int &outDistance,
const bool *
const blockedIndexes)
const;
229 #pragma mark GfxRemap32 240 inline uint8 getRemapCount()
const {
return _numActiveRemaps; }
241 inline uint8 getStartColor()
const {
return _remapStartColor; }
242 inline uint8 getEndColor()
const {
return _remapEndColor; }
243 inline uint8 getBlockedRangeStart()
const {
return _blockedRangeStart; }
244 inline int16 getBlockedRangeCount()
const {
return _blockedRangeCount; }
250 void remapOff(
const uint8 color);
262 void remapByRange(
const uint8 color,
const int16 from,
const int16 to,
const int16 delta);
268 void remapByPercent(
const uint8 color,
const int16 percent);
274 void remapToGray(
const uint8 color,
const int8 gray);
281 void remapToPercentGray(
const uint8 color,
const int16 gray,
const int16 percent);
289 void blockRange(
const uint8 from,
const int16 count);
302 const uint8 index = _remapEndColor - color;
306 if (index >= _remaps.size()) {
309 return (_remaps[index].
_type != kRemapNone);
317 inline uint8
remapColor(
const uint8 sourceColor,
const uint8 targetColor)
const {
318 const uint8 index = _remapEndColor - sourceColor;
319 assert(index < _remaps.size());
321 assert(singleRemap._type != kRemapNone);
328 if (targetColor >= _remapStartColor) {
331 return singleRemap._remapColors[targetColor];
341 bool remapAllTables(
const bool paletteUpdated);
349 uint8 _remapStartColor;
354 uint8 _remapEndColor;
359 uint8 _numActiveRemaps;
364 SingleRemapsList _remaps;
375 uint8 _blockedRangeStart;
381 int16 _blockedRangeCount;
386 #endif // SCI_GRAPHICS_REMAP32_H int16 _delta
Definition: remap32.h:70
RemapType _type
Definition: remap32.h:54
Definition: remap32.h:234
uint8 remapColor(const uint8 sourceColor, const uint8 targetColor) const
Definition: remap32.h:317
Definition: serializer.h:79
bool remapEnabled(uint8 color) const
Definition: remap32.h:301
Definition: serializer.h:308
Definition: helpers.h:233
uint8 _from
Definition: remap32.h:59
int16 _percent
Definition: remap32.h:79
uint8 _remapColors[237]
Definition: remap32.h:107
uint8 _gray
Definition: remap32.h:85
uint8 _to
Definition: remap32.h:64