summaryrefslogtreecommitdiff
path: root/source
diff options
context:
space:
mode:
authorRobin Watts <robin.watts@artifex.com>2017-10-17 19:14:42 +0100
committerRobin Watts <robin.watts@artifex.com>2017-10-25 10:58:35 +0100
commita0fe91ff1467c797451b82bffbe42dc0d4e48284 (patch)
treec910497652254b424bdcbbd6a8f6bad33a21be3d /source
parent8df4061c6c81304a956a277ff521931d24bde489 (diff)
downloadmupdf-a0fe91ff1467c797451b82bffbe42dc0d4e48284.tar.xz
Add fz_new_icc_colorspace_from_stream.
Diffstat (limited to 'source')
-rw-r--r--source/fitz/colorspace.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/source/fitz/colorspace.c b/source/fitz/colorspace.c
index 0241742e..1955cd10 100644
--- a/source/fitz/colorspace.c
+++ b/source/fitz/colorspace.c
@@ -3735,6 +3735,19 @@ fz_colorspace *fz_new_icc_colorspace_from_file(fz_context *ctx, const char *name
return cs;
}
+fz_colorspace *fz_new_icc_colorspace_from_stream(fz_context *ctx, const char *name, fz_stream *in)
+{
+ fz_colorspace *cs = NULL;
+ fz_buffer *buffer = fz_read_all(ctx, in, 1024);
+ fz_try(ctx)
+ cs = fz_new_icc_colorspace(ctx, name, 0, buffer);
+ fz_always(ctx)
+ fz_drop_buffer(ctx, buffer);
+ fz_catch(ctx)
+ fz_rethrow(ctx);
+ return cs;
+}
+
/* Gets the icc data from a color space. Used in the writing out of the icc
* data for output formats.
*/