2#include <Gfx/Graph/RenderList.hpp>
3#include <Gfx/Graph/RenderedISFUtils.hpp>
5#include <score/tools/Debug.hpp>
12inline QRhiSampler::Filter parseAudioFilter(
const std::string& s)
14 if(s.empty())
return QRhiSampler::Linear;
16 for(
auto& c : v) c = (char)tolower(c);
17 if(v ==
"nearest")
return QRhiSampler::Nearest;
18 return QRhiSampler::Linear;
20inline QRhiSampler::AddressMode parseAudioWrap(
const std::string& s)
22 if(s.empty())
return QRhiSampler::ClampToEdge;
24 for(
auto& c : v) c = (char)tolower(c);
25 for(
auto& c : v) if(c ==
'-') c =
'_';
26 if(v ==
"repeat")
return QRhiSampler::Repeat;
27 if(v ==
"mirror" || v ==
"mirrored_repeat")
return QRhiSampler::Mirror;
28 return QRhiSampler::ClampToEdge;
32inline std::vector<Sampler>
33initAudioTextures(RenderList& renderer, std::list<AudioTexture>& textures)
35 std::vector<Sampler> samplers;
36 QRhi& rhi = *renderer.state.rhi;
37 for(
auto& texture : textures)
39 const auto filter = detail::parseAudioFilter(texture.filter);
40 const auto wrap = detail::parseAudioWrap(texture.wrap);
41 auto sampler = rhi.newSampler(
42 filter, filter, QRhiSampler::None, wrap, wrap);
43 sampler->setName(
"ISFNode::initAudioTextures::sampler");
46 samplers.push_back({sampler,
nullptr});
47 texture.samplers[&renderer] = {sampler,
nullptr};
Graphics rendering pipeline for ossia score.
Definition Filter/PreviewWidget.hpp:11