///////////////////////////////////////////////////////
| 689 | |
| 690 | //////////////////////////////////////////////////////////// |
| 691 | Color Image::getPixel(Vector2u coords) const |
| 692 | { |
| 693 | assert(coords.x < m_size.x && "Image::getPixel() x coordinate is out of bounds"); |
| 694 | assert(coords.y < m_size.y && "Image::getPixel() y coordinate is out of bounds"); |
| 695 | |
| 696 | const auto index = (coords.x + coords.y * m_size.x) * 4; |
| 697 | const std::uint8_t* pixel = &m_pixels[index]; |
| 698 | return {pixel[0], pixel[1], pixel[2], pixel[3]}; |
| 699 | } |
| 700 | |
| 701 | |
| 702 | //////////////////////////////////////////////////////////// |
no outgoing calls
no test coverage detected