diff options
author | Antony Riakiotakis <kalast@gmail.com> | 2015-07-13 14:58:17 +0300 |
---|---|---|
committer | Antony Riakiotakis <kalast@gmail.com> | 2015-07-13 14:58:17 +0300 |
commit | e142ae77cadf04103fbc643f21cf60891862f6a8 (patch) | |
tree | 142e25fccd5ba3e748a1652706e7e4f1220ca289 /source/blender/imbuf/intern/png.c | |
parent | 107bbee4c763c95ea5d07a3b2f08bfe3b6adb24c (diff) |
Imbuf types refactor.
ImBuf types were getting stored as bitflags in a 32bit integer which had
already run out of space. Solved the problem by separating file type to
an ftype enum, and file specific options to foptions.
Reviewed by Campbell, thanks a lot!
Diffstat (limited to 'source/blender/imbuf/intern/png.c')
-rw-r--r-- | source/blender/imbuf/intern/png.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/source/blender/imbuf/intern/png.c b/source/blender/imbuf/intern/png.c index 77a0f1dc1db..744a05c7091 100644 --- a/source/blender/imbuf/intern/png.c +++ b/source/blender/imbuf/intern/png.c @@ -140,7 +140,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) int i, bytesperpixel, color_type = PNG_COLOR_TYPE_GRAY; FILE *fp = NULL; - bool is_16bit = (ibuf->ftype & PNG_16BIT) != 0; + bool is_16bit = (ibuf->foptions.flag & PNG_16BIT) != 0; bool has_float = (ibuf->rect_float != NULL); int channels_in_float = ibuf->channels ? ibuf->channels : 4; @@ -149,7 +149,7 @@ int imb_savepng(struct ImBuf *ibuf, const char *name, int flags) /* use the jpeg quality setting for compression */ int compression; - compression = (int)(((float)(ibuf->ftype & 0xff) / 11.1111f)); + compression = (int)(((float)(ibuf->foptions.quality) / 11.1111f)); compression = compression < 0 ? 0 : (compression > 9 ? 9 : compression); if (ibuf->float_colorspace) { @@ -606,9 +606,9 @@ ImBuf *imb_loadpng(const unsigned char *mem, size_t size, int flags, char colors ibuf = IMB_allocImBuf(width, height, 8 * bytesperpixel, 0); if (ibuf) { - ibuf->ftype = PNG; + ibuf->ftype = IMB_FTYPE_PNG; if (bit_depth == 16) - ibuf->ftype |= PNG_16BIT; + ibuf->foptions.flag |= PNG_16BIT; if (png_get_valid(png_ptr, info_ptr, PNG_INFO_pHYs)) { int unit_type; |