[vte/wip/sixels: 55/82] test-sixels: Minor code reformatting



commit b89fc0731898a6cbcfb0acdf4726e0bb5d793624
Author: Hans Petter Jansson <hpj cl no>
Date:   Sat Jun 13 19:59:03 2020 +0200

    test-sixels: Minor code reformatting

 src/test-sixels.c | 22 +++++++++++++---------
 1 file changed, 13 insertions(+), 9 deletions(-)
---
diff --git a/src/test-sixels.c b/src/test-sixels.c
index 2eb7f59d..e9bc4073 100644
--- a/src/test-sixels.c
+++ b/src/test-sixels.c
@@ -54,14 +54,7 @@
 #define TEST_PALETTE_SIZE_MIN 1
 #define TEST_PALETTE_SIZE_MAX 16
 
-typedef struct
-{
-        int width, height;
-        int n_colors;
-        uint32_t palette [N_COLORS_MAX];
-        uint16_t *pixels;
-}
-Image;
+/* --- Helpers --- */
 
 static int
 random_int_in_range (int min, int max)
@@ -159,6 +152,17 @@ argb_to_sixel_rgb (uint32_t argb, int *r, int *g, int *b)
         *b = transform_range (argb & 0xff, 0, 256, 0, 101);
 }
 
+/* --- Image gen and sixel conversion --- */
+
+typedef struct
+{
+        int width, height;
+        int n_colors;
+        uint32_t palette [N_COLORS_MAX];
+        uint16_t *pixels;
+}
+Image;
+
 static void
 image_init (Image *image, int width, int height, int n_colors)
 {
@@ -483,7 +487,7 @@ print_loop (const Options *options)
         }
 }
 
-/* --- Argument parsing --- */
+/* --- Argument parsing and init --- */
 
 static bool
 parse_int (const char *arg, const char *val, int *out)


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]