MCPcopy Create free account
hub / github.com/OpenLoco/OpenLoco / getPixel

Method getPixel

src/Gfx/src/PngImage.cpp:24–35  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22 }
23
24 Colour32 PngImage::getPixel(int x, int y)
25 {
26 const size_t index = (y * width + x) * channels;
27 assert(index + channels <= imageData.size());
28
29 return {
30 imageData[index + 0],
31 imageData[index + 1],
32 imageData[index + 2],
33 imageData[index + 3]
34 };
35 }
36
37 static void libpngErrorHandler(png_structp, png_const_charp error_msg)
38 {

Callers 1

generateMethod · 0.80

Calls 1

sizeMethod · 0.45

Tested by

no test coverage detected