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

Method GetColorAt

src/bitmap.cpp:293–305  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

291}
292
293Color Bitmap::GetColorAt(int x, int y) const {
294 if (x < 0 || x >= width() || y < 0 || y >= height()) {
295 return {};
296 }
297
298 Color color;
299
300 const uint8_t* pos = &reinterpret_cast<const uint8_t*>(pixels())[y * pitch() + x * bpp()];
301 uint32_t pixel = *reinterpret_cast<const uint32_t*>(pos);
302 format.uint32_to_rgba(pixel, color.red, color.green, color.blue, color.alpha);
303
304 return color;
305}
306
307void Bitmap::HueChangeBlit(int x, int y, Bitmap const& src, Rect const& src_rect_, double hue_) {
308 Rect dst_rect(x, y, 0, 0), src_rect = src_rect_;

Callers 2

RenderImplMethod · 0.80
TextDrawUnderlinedFunction · 0.80

Calls 1

uint32_to_rgbaMethod · 0.45

Tested by

no test coverage detected