| 869 | } |
| 870 | |
| 871 | void CheckerboardImageGenerator::operator()( void * data, vk::Extent2D & extent ) const |
| 872 | { |
| 873 | // Checkerboard of 16x16 pixel squares |
| 874 | uint8_t * pImageMemory = static_cast<uint8_t *>( data ); |
| 875 | for ( uint32_t row = 0; row < extent.height; row++ ) |
| 876 | { |
| 877 | for ( uint32_t col = 0; col < extent.width; col++ ) |
| 878 | { |
| 879 | std::array<uint8_t, 3> const & rgb = ( ( ( row & 0x10 ) == 0 ) ^ ( ( col & 0x10 ) == 0 ) ) ? m_rgb1 : m_rgb0; |
| 880 | pImageMemory[0] = rgb[0]; |
| 881 | pImageMemory[1] = rgb[1]; |
| 882 | pImageMemory[2] = rgb[2]; |
| 883 | pImageMemory[3] = 255; |
| 884 | pImageMemory += 4; |
| 885 | } |
| 886 | } |
| 887 | } |
| 888 | |
| 889 | MonochromeImageGenerator::MonochromeImageGenerator( std::array<unsigned char, 3> const & rgb ) : m_rgb( rgb ) {} |
| 890 |
nothing calls this directly
no outgoing calls
no test coverage detected