MCPcopy Create free account
hub / github.com/EasyRPG/Player / color_tone

Function color_tone

src/bitmap.cpp:844–849  ·  view source on GitHub ↗

Color Tone Inline: Changes color of a pixel by hard light table

Source from the content-addressed store, hash-verified

842
843// Color Tone Inline: Changes color of a pixel by hard light table
844static inline void color_tone(uint32_t &src_pixel, const Tone& tone, const int rs, const int gs, const int bs, const int as) {
845 src_pixel = ((uint32_t)hard_light.table[tone.red][(src_pixel >> rs) & 0xFF] << rs)
846 | ((uint32_t)hard_light.table[tone.green][(src_pixel >> gs) & 0xFF] << gs)
847 | ((uint32_t)hard_light.table[tone.blue][(src_pixel >> bs) & 0xFF] << bs)
848 | ((uint32_t)((src_pixel >> as) & 0xFF) << as);
849}
850
851static inline void color_tone_alpha(uint32_t &src_pixel, const Tone& tone, const int rs, const int gs, const int bs, const int as) {
852 uint8_t a = (src_pixel >> as) & 0xFF;

Callers 1

ToneBlitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected