diff options
author | Campbell Barton <ideasman42@gmail.com> | 2020-03-25 09:58:58 +0300 |
---|---|---|
committer | Campbell Barton <ideasman42@gmail.com> | 2020-03-25 09:58:58 +0300 |
commit | 2bc791437e3b8e42c1369daf15c72934474b1e73 (patch) | |
tree | f2202c3753c8288bea47d3c0edd10bcf01cdf339 /source/blender/blenkernel | |
parent | c3764fe1e80670cd578df7bbc5c37c267e81013a (diff) |
Cleanup: use 'r_' prefix for output arguments
Also pass some args as 'const'.
Diffstat (limited to 'source/blender/blenkernel')
-rw-r--r-- | source/blender/blenkernel/BKE_image.h | 10 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/image.c | 50 | ||||
-rw-r--r-- | source/blender/blenkernel/intern/tracking_region_tracker.c | 16 |
3 files changed, 38 insertions, 38 deletions
diff --git a/source/blender/blenkernel/BKE_image.h b/source/blender/blenkernel/BKE_image.h index 4ce740a1f5a..0d8b6efb4b1 100644 --- a/source/blender/blenkernel/BKE_image.h +++ b/source/blender/blenkernel/BKE_image.h @@ -322,12 +322,12 @@ struct ImageTile *BKE_image_get_tile_from_iuser(struct Image *ima, struct ImageU int BKE_image_get_tile_from_pos(struct Image *ima, const float uv[2], - float new_uv[2], - float ofs[2]); + float r_uv[2], + float r_ofs[2]); -void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *width, int *height); -void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float size[2]); -void BKE_image_get_aspect(struct Image *image, float *aspx, float *aspy); +void BKE_image_get_size(struct Image *image, struct ImageUser *iuser, int *r_width, int *r_height); +void BKE_image_get_size_fl(struct Image *image, struct ImageUser *iuser, float r_size[2]); +void BKE_image_get_aspect(struct Image *image, float *r_aspx, float *r_aspy); /* image_gen.c */ void BKE_image_buf_fill_color( diff --git a/source/blender/blenkernel/intern/image.c b/source/blender/blenkernel/intern/image.c index 953b738213a..5dca9bf2ac5 100644 --- a/source/blender/blenkernel/intern/image.c +++ b/source/blender/blenkernel/intern/image.c @@ -578,16 +578,16 @@ ImageTile *BKE_image_get_tile_from_iuser(Image *ima, ImageUser *iuser) int BKE_image_get_tile_from_pos(struct Image *ima, const float uv[2], - float new_uv[2], - float ofs[2]) + float r_uv[2], + float r_ofs[2]) { float local_ofs[2]; - if (ofs == NULL) { - ofs = local_ofs; + if (r_ofs == NULL) { + r_ofs = local_ofs; } - copy_v2_v2(new_uv, uv); - zero_v2(ofs); + copy_v2_v2(r_uv, uv); + zero_v2(r_ofs); if ((ima->source != IMA_SRC_TILED) || uv[0] < 0.0f || uv[1] < 0.0f || uv[0] >= 10.0f) { return 0; @@ -600,9 +600,9 @@ int BKE_image_get_tile_from_pos(struct Image *ima, if (BKE_image_get_tile(ima, tile_number) == NULL) { return 0; } - ofs[0] = ix; - ofs[1] = iy; - sub_v2_v2(new_uv, ofs); + r_ofs[0] = ix; + r_ofs[1] = iy; + sub_v2_v2(r_uv, r_ofs); return tile_number; } @@ -5341,7 +5341,7 @@ bool BKE_image_has_alpha(struct Image *image) } } -void BKE_image_get_size(Image *image, ImageUser *iuser, int *width, int *height) +void BKE_image_get_size(Image *image, ImageUser *iuser, int *r_width, int *r_height) { ImBuf *ibuf = NULL; void *lock; @@ -5351,22 +5351,22 @@ void BKE_image_get_size(Image *image, ImageUser *iuser, int *width, int *height) } if (ibuf && ibuf->x > 0 && ibuf->y > 0) { - *width = ibuf->x; - *height = ibuf->y; + *r_width = ibuf->x; + *r_height = ibuf->y; } else if (image != NULL && image->type == IMA_TYPE_R_RESULT && iuser != NULL && iuser->scene != NULL) { Scene *scene = iuser->scene; - *width = (scene->r.xsch * scene->r.size) / 100; - *height = (scene->r.ysch * scene->r.size) / 100; + *r_width = (scene->r.xsch * scene->r.size) / 100; + *r_height = (scene->r.ysch * scene->r.size) / 100; if ((scene->r.mode & R_BORDER) && (scene->r.mode & R_CROP)) { - *width *= BLI_rctf_size_x(&scene->r.border); - *height *= BLI_rctf_size_y(&scene->r.border); + *r_width *= BLI_rctf_size_x(&scene->r.border); + *r_height *= BLI_rctf_size_y(&scene->r.border); } } else { - *width = IMG_SIZE_FALLBACK; - *height = IMG_SIZE_FALLBACK; + *r_width = IMG_SIZE_FALLBACK; + *r_height = IMG_SIZE_FALLBACK; } if (image != NULL) { @@ -5374,25 +5374,25 @@ void BKE_image_get_size(Image *image, ImageUser *iuser, int *width, int *height) } } -void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float size[2]) +void BKE_image_get_size_fl(Image *image, ImageUser *iuser, float r_size[2]) { int width, height; BKE_image_get_size(image, iuser, &width, &height); - size[0] = (float)width; - size[1] = (float)height; + r_size[0] = (float)width; + r_size[1] = (float)height; } -void BKE_image_get_aspect(Image *image, float *aspx, float *aspy) +void BKE_image_get_aspect(Image *image, float *r_aspx, float *r_aspy) { - *aspx = 1.0; + *r_aspx = 1.0; /* x is always 1 */ if (image) { - *aspy = image->aspy / image->aspx; + *r_aspy = image->aspy / image->aspx; } else { - *aspy = 1.0f; + *r_aspy = 1.0f; } } diff --git a/source/blender/blenkernel/intern/tracking_region_tracker.c b/source/blender/blenkernel/intern/tracking_region_tracker.c index 6e8d4146d12..7e37e438e24 100644 --- a/source/blender/blenkernel/intern/tracking_region_tracker.c +++ b/source/blender/blenkernel/intern/tracking_region_tracker.c @@ -75,8 +75,8 @@ static void uint8_rgba_to_float_gray(const unsigned char *rgba, static float *track_get_search_floatbuf(ImBuf *ibuf, MovieTrackingTrack *track, MovieTrackingMarker *marker, - int *width_r, - int *height_r) + int *r_width, + int *r_height) { ImBuf *searchibuf; float *gray_pixels; @@ -85,8 +85,8 @@ static float *track_get_search_floatbuf(ImBuf *ibuf, searchibuf = BKE_tracking_get_search_imbuf(ibuf, track, marker, false, true); if (!searchibuf) { - *width_r = 0; - *height_r = 0; + *r_width = 0; + *r_height = 0; return NULL; } @@ -106,8 +106,8 @@ static float *track_get_search_floatbuf(ImBuf *ibuf, IMB_freeImBuf(searchibuf); - *width_r = width; - *height_r = height; + *r_width = width; + *r_height = height; return gray_pixels; } @@ -138,7 +138,7 @@ static ImBuf *tracking_context_get_keyframed_ibuf(MovieClip *clip, MovieTrackingTrack *track, int curfra, bool backwards, - MovieTrackingMarker **marker_keyed_r) + MovieTrackingMarker **r_marker_keyed) { MovieTrackingMarker *marker_keyed; int keyed_framenr; @@ -150,7 +150,7 @@ static ImBuf *tracking_context_get_keyframed_ibuf(MovieClip *clip, keyed_framenr = marker_keyed->framenr; - *marker_keyed_r = marker_keyed; + *r_marker_keyed = marker_keyed; return tracking_context_get_frame_ibuf(clip, user, clip_flag, keyed_framenr); } |