Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.blender.org/blender.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCampbell Barton <campbell@blender.org>2022-05-05 03:41:00 +0300
committerCampbell Barton <campbell@blender.org>2022-05-05 03:44:25 +0300
commitd0c2fd05701056d545cce0e6b44260c4fe071bcb (patch)
treee11cdb47af2eb0c0d6faec740e31802d1eb76eb9 /source/blender/imbuf
parentd3c895fc41d7a2d4ec677c4cd70f656a28f8edb1 (diff)
Cleanup: use 'r_' prefix for return arguments
Diffstat (limited to 'source/blender/imbuf')
-rw-r--r--source/blender/imbuf/intern/IMB_filetype.h18
-rw-r--r--source/blender/imbuf/intern/jpeg.c24
-rw-r--r--source/blender/imbuf/intern/readimage.c2
3 files changed, 23 insertions, 21 deletions
diff --git a/source/blender/imbuf/intern/IMB_filetype.h b/source/blender/imbuf/intern/IMB_filetype.h
index bcca6f9fd85..67d1aefeacb 100644
--- a/source/blender/imbuf/intern/IMB_filetype.h
+++ b/source/blender/imbuf/intern/IMB_filetype.h
@@ -36,15 +36,17 @@ typedef struct ImFileType {
char colorspace[IM_MAX_SPACE]);
/** Load an image from a file. */
struct ImBuf *(*load_filepath)(const char *filepath, int flags, char colorspace[IM_MAX_SPACE]);
- /** Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either
+ /**
+ * Load/Create a thumbnail image from a filepath. `max_thumb_size` is maximum size of either
* dimension, so can return less on either or both. Should, if possible and performant, return
- * dimensions of the full-size image in width_r & height_r. */
+ * dimensions of the full-size image in r_width & r_height.
+ */
struct ImBuf *(*load_filepath_thumbnail)(const char *filepath,
const int flags,
const size_t max_thumb_size,
- size_t *width_r,
- size_t *height_r,
- char colorspace[IM_MAX_SPACE]);
+ char colorspace[IM_MAX_SPACE],
+ size_t *r_width,
+ size_t *r_height);
/** Save to a file (or memory if #IB_mem is set in `flags` and the format supports it). */
bool (*save)(struct ImBuf *ibuf, const char *filepath, int flags);
void (*load_tile)(struct ImBuf *ibuf,
@@ -155,9 +157,9 @@ struct ImBuf *imb_load_jpeg(const unsigned char *buffer,
struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
const int flags,
const size_t max_thumb_size,
- size_t *width_r,
- size_t *height_r,
- char colorspace[IM_MAX_SPACE]);
+ char colorspace[IM_MAX_SPACE],
+ size_t *r_width,
+ size_t *r_height);
/** \} */
diff --git a/source/blender/imbuf/intern/jpeg.c b/source/blender/imbuf/intern/jpeg.c
index d76bd00df57..80fcceb0aa7 100644
--- a/source/blender/imbuf/intern/jpeg.c
+++ b/source/blender/imbuf/intern/jpeg.c
@@ -42,8 +42,8 @@ static boolean handle_app1(j_decompress_ptr cinfo);
static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo,
int flags,
int max_size,
- size_t *width_r,
- size_t *height_r);
+ size_t *r_width,
+ size_t *r_height);
static const uchar jpeg_default_quality = 75;
static uchar ibuf_quality;
@@ -253,8 +253,8 @@ static boolean handle_app1(j_decompress_ptr cinfo)
static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo,
int flags,
int max_size,
- size_t *width_r,
- size_t *height_r)
+ size_t *r_width,
+ size_t *r_height)
{
JSAMPARRAY row_pointer;
JSAMPLE *buffer = NULL;
@@ -278,11 +278,11 @@ static ImBuf *ibJpegImageFromCinfo(struct jpeg_decompress_struct *cinfo,
cinfo->out_color_space = JCS_CMYK;
}
- if (width_r) {
- *width_r = cinfo->image_width;
+ if (r_width) {
+ *r_width = cinfo->image_width;
}
- if (height_r) {
- *height_r = cinfo->image_height;
+ if (r_height) {
+ *r_height = cinfo->image_height;
}
if (max_size > 0) {
@@ -489,9 +489,9 @@ ImBuf *imb_load_jpeg(const unsigned char *buffer,
struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
const int flags,
const size_t max_thumb_size,
- size_t *width_r,
- size_t *height_r,
- char colorspace[IM_MAX_SPACE])
+ char colorspace[IM_MAX_SPACE],
+ size_t *r_width,
+ size_t *r_height)
{
struct jpeg_decompress_struct _cinfo, *cinfo = &_cinfo;
struct my_error_mgr jerr;
@@ -550,7 +550,7 @@ struct ImBuf *imb_thumbnail_jpeg(const char *filepath,
jpeg_create_decompress(cinfo);
jpeg_stdio_src(cinfo, infile);
- ImBuf *ibuf = ibJpegImageFromCinfo(cinfo, flags, max_thumb_size, width_r, height_r);
+ ImBuf *ibuf = ibJpegImageFromCinfo(cinfo, flags, max_thumb_size, r_width, r_height);
fclose(infile);
return ibuf;
diff --git a/source/blender/imbuf/intern/readimage.c b/source/blender/imbuf/intern/readimage.c
index 81347bce588..805a7e8d687 100644
--- a/source/blender/imbuf/intern/readimage.c
+++ b/source/blender/imbuf/intern/readimage.c
@@ -258,7 +258,7 @@ struct ImBuf *IMB_thumb_load_image(const char *filepath,
if (type->load_filepath_thumbnail) {
ibuf = type->load_filepath_thumbnail(
- filepath, flags, max_thumb_size, &width, &height, colorspace);
+ filepath, flags, max_thumb_size, colorspace, &width, &height);
}
else {
/* Skip images of other types if over 100MB. */