Skip to content

Commit

Permalink
Change order of color_description.cc to match order of stringified re…
Browse files Browse the repository at this point in the history
…presentation. (libjxl#3902)

(cherry picked from commit 169f305)
  • Loading branch information
CrushedAsian255 authored and mo271 committed Nov 26, 2024
1 parent 4a2bb8d commit 432da75
Showing 1 changed file with 7 additions and 7 deletions.
14 changes: 7 additions & 7 deletions lib/extras/dec/color_description.cc
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,13 @@ constexpr auto kJxlPrimariesNames =
{"202", JXL_PRIMARIES_2100},
{"DCI", JXL_PRIMARIES_P3}});

constexpr auto kJxlRenderingIntentNames =
to_array<EnumName<JxlRenderingIntent>>(
{{"Per", JXL_RENDERING_INTENT_PERCEPTUAL},
{"Rel", JXL_RENDERING_INTENT_RELATIVE},
{"Sat", JXL_RENDERING_INTENT_SATURATION},
{"Abs", JXL_RENDERING_INTENT_ABSOLUTE}});

constexpr auto kJxlTransferFunctionNames =
to_array<EnumName<JxlTransferFunction>>(
{{"709", JXL_TRANSFER_FUNCTION_709},
Expand All @@ -50,13 +57,6 @@ constexpr auto kJxlTransferFunctionNames =
{"HLG", JXL_TRANSFER_FUNCTION_HLG},
{"", JXL_TRANSFER_FUNCTION_GAMMA}});

constexpr auto kJxlRenderingIntentNames =
to_array<EnumName<JxlRenderingIntent>>(
{{"Per", JXL_RENDERING_INTENT_PERCEPTUAL},
{"Rel", JXL_RENDERING_INTENT_RELATIVE},
{"Sat", JXL_RENDERING_INTENT_SATURATION},
{"Abs", JXL_RENDERING_INTENT_ABSOLUTE}});

template <typename T, size_t N>
Status ParseEnum(const std::string& token,
const std::array<EnumName<T>, N>& enum_values, T* value) {
Expand Down

0 comments on commit 432da75

Please sign in to comment.