34 halp_meta(name,
"Array to texture")
35 halp_meta(category,
"Visuals/Textures")
36 halp_meta(c_name,
"array_to_texture")
37 halp_meta(manual_url,
"https://ossia.io/score-docs/processes/array-to-texture.html")
38 halp_meta(uuid,
"bb5dc513-3430-4671-8c74-2bba78e53709")
42 struct : halp::val_port<
"Input", std::vector<float>>
46 struct : halp::xy_spinboxes_i32<
"Size">
50 struct : halp::enum_t<halp::custom_texture::texture_format,
"Format">
58 halp::texture_output<
"Output", halp::custom_texture> main;
63 const auto format = inputs.format;
64 const auto sz = inputs.size.value;
65 outputs.main.texture.request_format = format;
66 outputs.main.create(sz.x, sz.y);
67 std::size_t to_copy = sz.x * sz.y * outputs.main.texture.components(format);
68 const auto& value = inputs.in.value;
69 to_copy = std::min(to_copy, value.size());
71 auto* out = outputs.main.texture.bytes;
72 using enum halp::custom_texture::texture_format;
81 std::copy_n(value.data(), to_copy, (uint8_t*)out);
86 std::copy_n(value.data(), to_copy, (uint16_t*)out);
92 std::copy_n(value.data(), to_copy, (uint32_t*)out);
97 std::copy_n(value.data(), to_copy, (
float*)out);
103#if (SCORE_LIBC_HAS_FLOAT16 && SCORE_COMPILER_HAS_FLOAT16)
104 std::copy_n(value.data(), to_copy, (_Float16*)out);
111 outputs.main.upload();
Definition ArrayToTexture.hpp:32
Definition ArrayToTexture.hpp:41