From 1f2126bd9ff50c8ea6f7c99f0e1bae978ffcecf6 Mon Sep 17 00:00:00 2001 From: Yay295 Date: Sat, 20 Apr 2024 20:11:17 -0500 Subject: [PATCH] add special modes --- src/libImaging/Mode.c | 35 +++++++++++++++++++++++++++++++++-- src/libImaging/Mode.h | 16 ++++++++++++++++ 2 files changed, 49 insertions(+), 2 deletions(-) diff --git a/src/libImaging/Mode.c b/src/libImaging/Mode.c index 5b9c9dae1..2bd09bda5 100644 --- a/src/libImaging/Mode.c +++ b/src/libImaging/Mode.c @@ -24,6 +24,15 @@ CREATE_MODE(Mode, MODE_RGBX, {"RGBX"}) CREATE_MODE(Mode, MODE_RGBa, {"RGBa"}) CREATE_MODE(Mode, MODE_YCbCr, {"YCbCr"}) +CREATE_MODE(Mode, MODE_BGR_15, {"BGR;15"}) +CREATE_MODE(Mode, MODE_BGR_16, {"BGR;16"}) +CREATE_MODE(Mode, MODE_BGR_24, {"BGR;24"}) + +CREATE_MODE(Mode, MODE_I_16, {"I;16"}) +CREATE_MODE(Mode, MODE_I_16L, {"I;16L"}) +CREATE_MODE(Mode, MODE_I_16B, {"I;16B"}) +CREATE_MODE(Mode, MODE_I_16N, {"I;16N"}) + const Mode * const MODES[] = { IMAGING_MODE_1, IMAGING_MODE_CMYK, @@ -41,6 +50,16 @@ const Mode * const MODES[] = { IMAGING_MODE_RGBX, IMAGING_MODE_RGBa, IMAGING_MODE_YCbCr, + + IMAGING_MODE_BGR_15, + IMAGING_MODE_BGR_16, + IMAGING_MODE_BGR_24, + + IMAGING_MODE_I_16, + IMAGING_MODE_I_16L, + IMAGING_MODE_I_16B, + IMAGING_MODE_I_16N, + NULL }; @@ -75,8 +94,14 @@ ALIAS_MODE_AS_RAWMODE(RGBX) ALIAS_MODE_AS_RAWMODE(RGBa) ALIAS_MODE_AS_RAWMODE(YCbCr) -CREATE_MODE(RawMode, RAWMODE_BGR_15, {"BGR;15"}) -CREATE_MODE(RawMode, RAWMODE_BGR_16, {"BGR;16"}) +ALIAS_MODE_AS_RAWMODE(BGR_15) +ALIAS_MODE_AS_RAWMODE(BGR_16) +ALIAS_MODE_AS_RAWMODE(BGR_24) + +ALIAS_MODE_AS_RAWMODE(I_16) +ALIAS_MODE_AS_RAWMODE(I_16L) +ALIAS_MODE_AS_RAWMODE(I_16B) +ALIAS_MODE_AS_RAWMODE(I_16N) const RawMode * const RAWMODES[] = { IMAGING_RAWMODE_1, @@ -98,6 +123,12 @@ const RawMode * const RAWMODES[] = { IMAGING_RAWMODE_BGR_15, IMAGING_RAWMODE_BGR_16, + IMAGING_RAWMODE_BGR_24, + + IMAGING_RAWMODE_I_16, + IMAGING_RAWMODE_I_16L, + IMAGING_RAWMODE_I_16B, + IMAGING_RAWMODE_I_16N, NULL }; diff --git a/src/libImaging/Mode.h b/src/libImaging/Mode.h index 2d4d27c31..6491beb81 100644 --- a/src/libImaging/Mode.h +++ b/src/libImaging/Mode.h @@ -27,6 +27,15 @@ extern const Mode * const IMAGING_MODE_RGBX; extern const Mode * const IMAGING_MODE_RGBa; extern const Mode * const IMAGING_MODE_YCbCr; +extern const Mode * const IMAGING_MODE_BGR_15; +extern const Mode * const IMAGING_MODE_BGR_16; +extern const Mode * const IMAGING_MODE_BGR_24; + +extern const Mode * const IMAGING_MODE_I_16; +extern const Mode * const IMAGING_MODE_I_16L; +extern const Mode * const IMAGING_MODE_I_16B; +extern const Mode * const IMAGING_MODE_I_16N; + const Mode * findMode(const char * const name); @@ -53,6 +62,13 @@ extern const RawMode * const IMAGING_RAWMODE_YCbCr; extern const RawMode * const IMAGING_RAWMODE_BGR_15; extern const RawMode * const IMAGING_RAWMODE_BGR_16; +extern const RawMode * const IMAGING_RAWMODE_BGR_24; +extern const RawMode * const IMAGING_RAWMODE_BGR_32; + +extern const RawMode * const IMAGING_RAWMODE_I_16; +extern const RawMode * const IMAGING_RAWMODE_I_16L; +extern const RawMode * const IMAGING_RAWMODE_I_16B; +extern const RawMode * const IMAGING_RAWMODE_I_16N; const RawMode * findRawMode(const char * const name);