From aafab8f3a54cc61998ddb355c5226dd5d471a5cd Mon Sep 17 00:00:00 2001
From: Michael Vrhel <michael.vrhel@artifex.com>
Date: Fri, 13 Oct 2017 08:56:35 -0700
Subject: Add interface for setting icc space to bgr format

This is needed so that we can have bgr formatting with
something other than the default sRGB
---
 source/fitz/colorspace.c | 12 ++++++++++++
 1 file changed, 12 insertions(+)

(limited to 'source')

diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index 41d96af6..b168b014 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -3646,6 +3646,18 @@ int fz_colorspace_is_lab_icc(fz_context *ctx, const fz_colorspace *cs)
 	return cs && cs->clamp == clamp_lab_icc;
 }
 
+void fz_set_icc_bgr(fz_context *ctx, fz_colorspace *cs)
+{
+	fz_iccprofile *profile;
+
+	if (cs == NULL || !fz_colorspace_is_icc(ctx, cs))
+		return;
+
+	profile = cs->data;
+	profile->bgr = 1;
+	return;
+}
+
 fz_colorspace *
 fz_new_icc_colorspace(fz_context *ctx, const char *name, int num, fz_buffer *buf)
 {
-- 
cgit v1.2.3