From ce0ac7041655ef39eb0d76ac2ca3ed5418da97c8 Mon Sep 17 00:00:00 2001 From: Lucas CHOLLET Date: Wed, 14 Feb 2024 23:08:26 -0500 Subject: [PATCH] LibGfx/CCITT: Declare reference colors as static variables --- Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp b/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp index 48805f6fc4..2850b77cb8 100644 --- a/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp +++ b/Userland/Libraries/LibGfx/ImageFormats/CCITTDecoder.cpp @@ -264,11 +264,11 @@ Optional get_terminal_code(Color color, u16 code_word, u8 code_size) return get_code_from_table(black_terminating_codes, code_word, code_size); } +constexpr auto const ccitt_white = Color::NamedColor::White; +constexpr auto const ccitt_black = Color::NamedColor::Black; + ErrorOr decode_single_ccitt3_1d_line(BigEndianInputBitStream& input_bit_stream, BigEndianOutputBitStream& decoded_bits, u32 image_width) { - auto const ccitt_white = Color::NamedColor::White; - auto const ccitt_black = Color::NamedColor::Black; - // We always flip the color when entering the loop, so let's initialize the // color with black to make the first marker actually be white. Color current_color { ccitt_black };