| 46 | }; |
| 47 | |
| 48 | int getOffsetToFirstByteOfComponent(const Channel channel, |
| 49 | const PixelFormatRGB &pixelFormat, |
| 50 | const Size frameSize) |
| 51 | { |
| 52 | auto offset = pixelFormat.getChannelPosition(channel); |
| 53 | if (pixelFormat.getDataLayout() == DataLayout::Planar) |
| 54 | offset *= frameSize.width * frameSize.height; |
| 55 | return offset; |
| 56 | } |
| 57 | |
| 58 | // Convert the input format to the output RGBA format. Apply inversion, scaling, |
| 59 | // limited range conversion and alpha multiplication. The input can be any supported |
no test coverage detected