| 214 | } // namespace |
| 215 | |
| 216 | RgbaImage normalize_to_rgba8_raw(const std::uint8_t* data, |
| 217 | const BufferType type, |
| 218 | const int width, |
| 219 | const int height, |
| 220 | const int channels, |
| 221 | const int step, |
| 222 | const std::array<float, 8>& bc_comp, |
| 223 | const char* pixel_layout) { |
| 224 | using enum BufferType; |
| 225 | switch (type) { |
| 226 | case UnsignedByte: |
| 227 | return normalize_to_rgba8_impl<std::uint8_t>( |
| 228 | data, width, height, channels, step, bc_comp, pixel_layout); |
| 229 | case UnsignedShort: |
| 230 | return normalize_to_rgba8_impl<std::uint16_t>( |
| 231 | data, width, height, channels, step, bc_comp, pixel_layout); |
| 232 | case Short: |
| 233 | return normalize_to_rgba8_impl<std::int16_t>( |
| 234 | data, width, height, channels, step, bc_comp, pixel_layout); |
| 235 | case Int32: |
| 236 | return normalize_to_rgba8_impl<std::int32_t>( |
| 237 | data, width, height, channels, step, bc_comp, pixel_layout); |
| 238 | case Float32: |
| 239 | [[fallthrough]]; |
| 240 | case Float64: |
| 241 | return normalize_to_rgba8_impl<float>( |
| 242 | data, width, height, channels, step, bc_comp, pixel_layout); |
| 243 | } |
| 244 | return RgbaImage{}; |
| 245 | } |
| 246 | |
| 247 | bool export_octave_raw(const std::uint8_t* data, |
| 248 | const BufferType type, |
no outgoing calls