[vte/wip/sixels: 65/111] test-sixels: Minor code reformatting
- From: Christian Persch <chpe src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [vte/wip/sixels: 65/111] test-sixels: Minor code reformatting
- Date: Sat, 8 Aug 2020 18:43:01 +0000 (UTC)
commit 768fc690524e43207abe3df382d3cf4e7595a0d3
Author: Hans Petter Jansson <hpj cl no>
Date: Sat Aug 8 20:42:49 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]