[gimp/gimp-2-10] plug-ins: move static variables for grayscale mapping to the top
- From: Jacob Boerema <jboerema src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gimp/gimp-2-10] plug-ins: move static variables for grayscale mapping to the top
- Date: Wed, 8 Jun 2022 17:29:31 +0000 (UTC)
commit ddc75a5617a0e60331d1ddbb7c6ccfaa7d56a3da
Author: Jacob Boerema <jgboerema gmail com>
Date: Tue Jun 7 18:41:00 2022 -0400
plug-ins: move static variables for grayscale mapping to the top
In preparation of using some of them earlier, we move the variables
used for grayscale mapping of 1, 2 and 4-bit per pixel images to the
top of file-tiff-load.
(cherry picked from commit 11ef2e4432c2a674da4f1bf9ead97308b32275d1)
# Conflicts:
# plug-ins/file-tiff/file-tiff-load.c
plug-ins/file-tiff/file-tiff-load.c | 74 ++++++++++++++++++-------------------
1 file changed, 37 insertions(+), 37 deletions(-)
---
diff --git a/plug-ins/file-tiff/file-tiff-load.c b/plug-ins/file-tiff/file-tiff-load.c
index ea574d4f7a..8e976ff8a1 100644
--- a/plug-ins/file-tiff/file-tiff-load.c
+++ b/plug-ins/file-tiff/file-tiff-load.c
@@ -166,6 +166,43 @@ static TiffSaveVals tsvals =
TRUE, /* alpha handling */
};
+/* Grayscale conversion mappings */
+static const guchar _1_to_8_bitmap [2] =
+{
+ 0, 255
+};
+
+static const guchar _1_to_8_bitmap_rev [2] =
+{
+ 255, 0
+};
+
+static const guchar _2_to_8_bitmap [4] =
+{
+ 0, 85, 170, 255
+};
+
+static const guchar _2_to_8_bitmap_rev [4] =
+{
+ 255, 170, 85, 0
+};
+
+static const guchar _4_to_8_bitmap [16] =
+{
+ 0, 17, 34, 51, 68, 85, 102, 119,
+ 136, 153, 170, 187, 204, 221, 238, 255
+};
+
+static const guchar _4_to_8_bitmap_rev [16] =
+{
+ 255, 238, 221, 204, 187, 170, 153, 136,
+ 119, 102, 85, 68, 51, 34, 17, 0
+};
+
+static guchar bit2byte[256 * 8];
+static guchar _2bit2byte[256 * 4];
+static guchar _4bit2byte[256 * 2];
+
/* returns a pointer into the TIFF */
static const gchar *
@@ -2216,43 +2253,6 @@ load_separate (TIFF *tif,
g_free (bw_buffer);
}
-
-static guchar bit2byte[256 * 8];
-static guchar _2bit2byte[256 * 4];
-static guchar _4bit2byte[256 * 2];
-
-static const guchar _1_to_8_bitmap [2] =
-{
- 0, 255
-};
-
-static const guchar _1_to_8_bitmap_rev [2] =
-{
- 255, 0
-};
-
-static const guchar _2_to_8_bitmap [4] =
-{
- 0, 85, 170, 255
-};
-
-static const guchar _2_to_8_bitmap_rev [4] =
-{
- 255, 170, 85, 0
-};
-
-static const guchar _4_to_8_bitmap [16] =
-{
- 0, 17, 34, 51, 68, 85, 102, 119,
- 136, 153, 170, 187, 204, 221, 238, 255
-};
-
-static const guchar _4_to_8_bitmap_rev [16] =
-{
- 255, 238, 221, 204, 187, 170, 153, 136,
- 119, 102, 85, 68, 51, 34, 17, 0
-};
-
static void
fill_bit2byte (TiffColorMode tiff_mode)
{
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]