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:
Diffstat (limited to 'source/blender/blenkernel/intern/tracking_util.c')
-rw-r--r--source/blender/blenkernel/intern/tracking_util.c28
1 files changed, 15 insertions, 13 deletions
diff --git a/source/blender/blenkernel/intern/tracking_util.c b/source/blender/blenkernel/intern/tracking_util.c
index 250b575aa14..505f705857b 100644
--- a/source/blender/blenkernel/intern/tracking_util.c
+++ b/source/blender/blenkernel/intern/tracking_util.c
@@ -754,19 +754,6 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
ibuf->y / (1 << downscale));
}
- if (input_mode == LIBMV_IMAGE_MODE_RGBA) {
- BLI_assert(ibuf->channels == 3 || ibuf->channels == 4);
- /* pass */
- }
- else /* if (input_mode == LIBMV_IMAGE_MODE_MONO) */ {
- ImBuf *grayscale_ibuf = make_grayscale_ibuf_copy(final_ibuf);
- if (final_ibuf != orig_ibuf) {
- /* We dereference original frame later. */
- IMB_freeImBuf(final_ibuf);
- }
- final_ibuf = grayscale_ibuf;
- }
-
if (transform != NULL) {
libmv_FloatImage input_image, output_image;
ibuf_to_float_image(final_ibuf, &input_image);
@@ -780,6 +767,21 @@ static ImBuf *accessor_get_ibuf(TrackingImageAccessor *accessor,
libmv_floatImageDestroy(&output_image);
}
+ if (input_mode == LIBMV_IMAGE_MODE_RGBA) {
+ BLI_assert(ibuf->channels == 3 || ibuf->channels == 4);
+ /* pass */
+ }
+ else /* if (input_mode == LIBMV_IMAGE_MODE_MONO) */ {
+ if (final_ibuf->channels != 1) {
+ ImBuf *grayscale_ibuf = make_grayscale_ibuf_copy(final_ibuf);
+ if (final_ibuf != orig_ibuf) {
+ /* We dereference original frame later. */
+ IMB_freeImBuf(final_ibuf);
+ }
+ final_ibuf = grayscale_ibuf;
+ }
+ }
+
/* it's possible processing stil didn't happen at this point,
* but we really need a copy of the buffer to be transformed
* and to be put to the cache.