| 741 | } |
| 742 | |
| 743 | static size_t nChannelsInPixelFormat(Texture::PixelFormat pixelFormat) { |
| 744 | switch (pixelFormat) { |
| 745 | case Texture::PixelFormat::R: return 1; |
| 746 | case Texture::PixelFormat::RA: return 2; |
| 747 | case Texture::PixelFormat::RGB: return 3; |
| 748 | case Texture::PixelFormat::RGBA: return 4; |
| 749 | default: throw runtime_error{"Unsupported pixel format for texture."}; |
| 750 | } |
| 751 | } |
| 752 | |
| 753 | static size_t bitsPerSampleInComponentFormat(Texture::ComponentFormat componentFormat) { |
| 754 | switch (componentFormat) { |
no outgoing calls
no test coverage detected