MCPcopy Create free account
hub / github.com/KhronosGroup/KTX-Software / determineTargetOrigin

Method determineTargetOrigin

tools/ktx/command_create.cpp:2815–2829  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2813}
2814
2815void CommandCreate::determineTargetOrigin(const ImageInput& in, ImageSpec& target,
2816 ImageSpec::Origin& usedSourceOrigin) {
2817 determineSourceOrigin(in, usedSourceOrigin);
2818 target.setOrigin(usedSourceOrigin);
2819
2820 if (options.convertTexcoordOrigin.has_value()) {
2821 if (usedSourceOrigin.unspecified()) {
2822 fatal(rc::INVALID_FILE, "Cannot convert texcoord origin as no information about the origin "
2823 "is available in the input file \"{}\". Use --{} to specify one.",
2824 in.filename(), OptionsCreate::kAssignTexcoordOrigin);
2825 } else if (options.convertTexcoordOrigin.value() != usedSourceOrigin) {
2826 target.setOrigin(options.convertTexcoordOrigin.value());
2827 }
2828 }
2829}
2830
2831void CommandCreate::checkSpecsMatch(const ImageInput& currentFile, const ImageSpec& firstSpec) {
2832 const FormatDescriptor& firstFormat = firstSpec.format();

Callers

nothing calls this directly

Calls 4

fatalClass · 0.85
setOriginMethod · 0.80
unspecifiedMethod · 0.80
valueMethod · 0.45

Tested by

no test coverage detected