MCPcopy Create free account
hub / github.com/OpenImageDebugger/OpenImageDebugger / normalize_to_rgba8_raw

Function normalize_to_rgba8_raw

src/io/buffer_export_core.cpp:216–245  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

214} // namespace
215
216RgbaImage 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
247bool export_octave_raw(const std::uint8_t* data,
248 const BufferType type,

Callers 2

normalize_to_rgba8Function · 0.85
TESTFunction · 0.85

Calls

no outgoing calls

Tested by 1

TESTFunction · 0.68