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

Function color_tone_alpha

src/bitmap.cpp:851–857  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

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;
853 uint8_t r = ((uint32_t)hard_light.table[tone.red][(src_pixel >> rs) & 0xFF]) * a / 255;
854 uint8_t g = ((uint32_t)hard_light.table[tone.green][(src_pixel >> gs) & 0xFF]) * a / 255;
855 uint8_t b = ((uint32_t)hard_light.table[tone.blue][(src_pixel >> bs) & 0xFF]) * a / 255;
856 src_pixel = ((uint32_t)r << rs) | ((uint32_t)g << gs) | ((uint32_t)b << bs) | ((uint32_t)a << as);
857}
858
859void Bitmap::ToneBlit(int x, int y, Bitmap const& src, Rect const& src_rect, const Tone &tone, Opacity const& opacity) {
860 if (opacity.IsTransparent()) {

Callers 1

ToneBlitMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected