///////////////////////////////////////////////////////
| 674 | |
| 675 | //////////////////////////////////////////////////////////// |
| 676 | void Image::setPixel(Vector2u coords, Color color) |
| 677 | { |
| 678 | assert(coords.x < m_size.x && "Image::setPixel() x coordinate is out of bounds"); |
| 679 | assert(coords.y < m_size.y && "Image::setPixel() y coordinate is out of bounds"); |
| 680 | |
| 681 | const auto index = (coords.x + coords.y * m_size.x) * 4; |
| 682 | std::uint8_t* pixel = &m_pixels[index]; |
| 683 | *pixel++ = color.r; |
| 684 | *pixel++ = color.g; |
| 685 | *pixel++ = color.b; |
| 686 | *pixel++ = color.a; |
| 687 | } |
| 688 | |
| 689 | |
| 690 | //////////////////////////////////////////////////////////// |
no outgoing calls
no test coverage detected