Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion tests/cts
Submodule cts updated 876 files
26 changes: 26 additions & 0 deletions tools/imageio/imageio.h
Original file line number Diff line number Diff line change
Expand Up @@ -211,6 +211,32 @@ constexpr bool operator!=(const ImageSpec::Origin& lhs, const ImageSpec::Origin&
return lhs.x != rhs.x || lhs.y != rhs.y || lhs.z != rhs.z;
}

[[nodiscard]] inline std::string toString(const ImageSpec::Origin& o) noexcept {
std::string str;
switch (o.x) {
case ImageSpec::Origin::eLeft: str = "left"; break;
case ImageSpec::Origin::eRight: str = "right"; break;
case ImageSpec::Origin::eUnspecified: str = "unspecified"; break;
default: assert(false && "Invalid origin.x");
}
str += ",";
switch (o.y) {
case ImageSpec::Origin::eTop: str += "top"; break;
case ImageSpec::Origin::eBottom: str += "bottom"; break;
case ImageSpec::Origin::eUnspecified: str += "unspecified"; break;
default: assert(false && "Invalid origin.y");
}
str += ",";
switch (o.z) {
case ImageSpec::Origin::eFront: str += "front"; break;
case ImageSpec::Origin::eBack: str += "back"; break;
case ImageSpec::Origin::eUnspecified: str += "unspecified"; break;
default: assert(false && "Invalid origin.z");
}

return str;
}

typedef std::function<void(const std::string&)> WarningCallbackFunction;

enum class ImageInputFormatType {
Expand Down
Loading