Color Tone Inline: Changes color of a pixel by hard light table
| 842 | |
| 843 | // Color Tone Inline: Changes color of a pixel by hard light table |
| 844 | static 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 | |
| 851 | static 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; |