aboutsummaryrefslogtreecommitdiffstats
path: root/libglitter_reorder_rasters.c
diff options
context:
space:
mode:
Diffstat (limited to 'libglitter_reorder_rasters.c')
-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;
+}