3#include <catch2/catch_all.hpp>
13TEST_CASE(
"PixelConversion<>::scale<T>())",
"[PixelFormat]")
23TEST_CASE(
"PixelByteSwapper<true>-swaps-bytes-for-16-bit-data",
"[PixelFormat]")
26 SECTION(
"Empty range does nothing")
28 std::vector<irsol::types::byte_t> v;
33 SECTION(
"Begin after end raises an assertion")
40 SECTION(
"Even number of bytes swaps pairs")
54 SECTION(
"Odd number of bytes swaps pairs, last byte untouched")
56 std::vector<irsol::types::byte_t> v = {
60 v == std::vector<irsol::types::byte_t>{
64 SECTION(
"Single byte does nothing")
71 SECTION(
"Longer vector swaps all pairs correctly")
102TEST_CASE(
"PixelByteSwapper<false>-is-no-op",
"[PixelFormat]")
105 SECTION(
"No-op on empty vector")
107 std::vector<irsol::types::byte_t> v;
112 SECTION(
"No-op on non-empty vector")
std::byte byte_t
Alias for a single byte used in serialization or binary data handling.
ppk::assert::AssertionException AssertionException
Utility for swapping pixel bytes in a buffer.
Helper to convert pixel values from one bit depth to another with scaling.
Represents a pixel with a given bit depth.
CHECK(m.identifier==identifier)
CHECK_THROWS_AS(irsol::protocol::Assignment(identifier, value), std::invalid_argument)