aboutsummaryrefslogtreecommitdiffstats
path: root/libglitter_reorder_rasters.c
diff options
context:
space:
mode:
authorMattias Andrée <maandree@kth.se>2023-01-22 12:28:08 +0100
committerMattias Andrée <maandree@kth.se>2023-01-22 12:28:08 +0100
commitc5809a542b2e2e27febccf4f798f273223b69cb4 (patch)
treef608c9f379dd6c19d669ed1aefcdad277766568d /libglitter_reorder_rasters.c
parentFunction for enabling hardware acceleration (doesn't enable hardware acceleration yet) (diff)
downloadlibglitter-c5809a542b2e2e27febccf4f798f273223b69cb4.tar.gz
libglitter-c5809a542b2e2e27febccf4f798f273223b69cb4.tar.bz2
libglitter-c5809a542b2e2e27febccf4f798f273223b69cb4.tar.xz
Add libglitter_reorder_rasters
Signed-off-by: Mattias Andrée <maandree@kth.se>
Diffstat (limited to '')
-rw-r--r--libglitter_reorder_rasters.c15
1 files changed, 15 insertions, 0 deletions
diff --git a/libglitter_reorder_rasters.c b/libglitter_reorder_rasters.c
new file mode 100644
index 0000000..5df590e
--- /dev/null
+++ b/libglitter_reorder_rasters.c
@@ -0,0 +1,15 @@
+/* See LICENSE file for copyright and license details. */
+#include "common.h"
+
+
+void
+libglitter_reorder_rasters(void **rasters, enum libglitter_colour colour1,
+ enum libglitter_colour colour2, enum libglitter_colour colour3)
+{
+ void *channel1 = rasters[colour1];
+ void *channel2 = rasters[colour2];
+ void *channel3 = rasters[colour3];
+ rasters[0] = channel1;
+ rasters[1] = channel2;
+ rasters[2] = channel3;
+}