[Bf-blender-cvs] [63540ace16e] temp-openjpeg23: Correct pointer use
Campbell Barton
noreply at git.blender.org
Wed Jan 17 16:34:13 CET 2018
Commit: 63540ace16e31c121dd569d9b2faf2bb47a37103
Author: Campbell Barton
Date: Fri Nov 17 23:10:45 2017 +1100
Branches: temp-openjpeg23
https://developer.blender.org/rB63540ace16e31c121dd569d9b2faf2bb47a37103
Correct pointer use
===================================================================
M source/blender/imbuf/intern/jp2.c
===================================================================
diff --git a/source/blender/imbuf/intern/jp2.c b/source/blender/imbuf/intern/jp2.c
index 7a766e44a6b..fba0b0e3305 100644
--- a/source/blender/imbuf/intern/jp2.c
+++ b/source/blender/imbuf/intern/jp2.c
@@ -315,14 +315,14 @@ static opj_stream_t *opj_stream_create_from_file(
/** \} */
static ImBuf *imb_load_jp2_stream(
- opj_stream_t stream, OPJ_CODEC_FORMAT p_format,
+ opj_stream_t *stream, OPJ_CODEC_FORMAT p_format,
int flags, char colorspace[IM_MAX_SPACE]);
ImBuf *imb_load_jp2(const unsigned char *mem, size_t size, int flags, char colorspace[IM_MAX_SPACE])
{
const OPJ_CODEC_FORMAT format = (size > JP2_FILEHEADER_SIZE) ? format_from_header(mem) : OPJ_CODEC_UNKNOWN;
struct BufInfo buf_wrapper = { .buf = mem, .cur = mem, .len = size, };
- opj_stream_t stream = opj_stream_create_from_buffer(&buf_wrapper, OPJ_J2K_STREAM_CHUNK_SIZE, true);
+ opj_stream_t *stream = opj_stream_create_from_buffer(&buf_wrapper, OPJ_J2K_STREAM_CHUNK_SIZE, true);
ImBuf *ibuf = imb_load_jp2_stream(stream, format, flags, colorspace);
opj_stream_destroy(stream);
return ibuf;
@@ -354,7 +354,7 @@ ImBuf *imb_load_jp2_filepath(const char *filepath, int flags, char colorspace[IM
static ImBuf *imb_load_jp2_stream(
- opj_stream_t stream, const OPJ_CODEC_FORMAT format,
+ opj_stream_t *stream, const OPJ_CODEC_FORMAT format,
int flags, char colorspace[IM_MAX_SPACE])
{
if (format == OPJ_CODEC_UNKNOWN) {
@@ -1181,11 +1181,11 @@ static opj_image_t *ibuftoimage(ImBuf *ibuf, opj_cparameters_t *parameters)
return image;
}
-int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t stream, int flags);
+int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t *stream, int flags);
int imb_save_jp2(struct ImBuf *ibuf, const char *filepath, int flags)
{
- opj_stream_t stream = opj_stream_create_from_file(filepath, OPJ_J2K_STREAM_CHUNK_SIZE, false, NULL);
+ opj_stream_t *stream = opj_stream_create_from_file(filepath, OPJ_J2K_STREAM_CHUNK_SIZE, false, NULL);
if (stream == NULL) {
return 0;
}
@@ -1195,22 +1195,22 @@ int imb_save_jp2(struct ImBuf *ibuf, const char *filepath, int flags)
}
/* Found write info at http://users.ece.gatech.edu/~slabaugh/personal/c/bitmapUnix.c */
-int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t stream, int UNUSED(flags))
+int imb_save_jp2_stream(struct ImBuf *ibuf, opj_stream_t *stream, int UNUSED(flags))
{
int quality = ibuf->foptions.quality;
-
+
opj_cparameters_t parameters; /* compression parameters */
opj_image_t *image = NULL;
-
+
/* set encoding parameters to default values */
opj_set_default_encoder_parameters(¶meters);
-
+
/* compression ratio */
/* invert range, from 10-100, 100-1
* where jpeg see's 1 and highest quality (lossless) and 100 is very low quality*/
parameters.tcp_rates[0] = ((100 - quality) / 90.0f * 99.0f) + 1;
-
+
parameters.tcp_numlayers = 1; /* only one resolution */
parameters.cp_disto_alloc = 1;
More information about the Bf-blender-cvs
mailing list