[Bf-blender-cvs] [3de92e5f218] soc-2021-vse-strip-thumbnails: Fix pixel errors when drawing first thumb

Aditya Y Jeppu noreply at git.blender.org
Sat Aug 14 20:17:34 CEST 2021


Commit: 3de92e5f21838902670403207e81bcaa627b938b
Author: Aditya Y Jeppu
Date:   Sat Aug 14 23:42:39 2021 +0530
Branches: soc-2021-vse-strip-thumbnails
https://developer.blender.org/rB3de92e5f21838902670403207e81bcaa627b938b

Fix pixel errors when drawing first thumb

===================================================================

M	source/blender/editors/space_sequencer/sequencer_draw.c
M	source/blender/imbuf/intern/rectop.c
M	source/blender/sequencer/intern/render.c

===================================================================

diff --git a/source/blender/editors/space_sequencer/sequencer_draw.c b/source/blender/editors/space_sequencer/sequencer_draw.c
index 05134910830..04a38c2c3fd 100644
--- a/source/blender/editors/space_sequencer/sequencer_draw.c
+++ b/source/blender/editors/space_sequencer/sequencer_draw.c
@@ -1321,9 +1321,6 @@ static void thumbnail_call_for_job(const bContext *C, Editing *ed, View2D *v2d,
   }
 }
 
-/* TODO(AYJ) : Decrease Opacity of images when overlay over another strip
- */
-
 static void draw_seq_strip_thumbnail(View2D *v2d,
                                      const bContext *C,
                                      SpaceSeq *sseq,
@@ -1403,10 +1400,9 @@ static void draw_seq_strip_thumbnail(View2D *v2d,
         break;
     }
 
-    // TODO(AYJ) : Fix pixel errors in the first frame when cropping
     cropx_min = (cut_off / pixelx) / (zoom_y / pixely);
     cropx_max = ((x2 - x1) / pixelx) / (zoom_y / pixely);
-    BLI_rcti_init(&crop, (int)(cropx_min), (int)(cropx_max)-1, 0, (int)(image_y)-1);
+    BLI_rcti_init(&crop, (int)(cropx_min), (int)image_x, 0, (int)(image_y)-1);
 
     /* Get the image */
     ibuf = SEQ_get_thumbnail(&context, seq, roundf(x1), &crop, clipped, false);
diff --git a/source/blender/imbuf/intern/rectop.c b/source/blender/imbuf/intern/rectop.c
index 4b5d68b9c13..e3e21cf83ef 100644
--- a/source/blender/imbuf/intern/rectop.c
+++ b/source/blender/imbuf/intern/rectop.c
@@ -266,7 +266,7 @@ void IMB_rect_crop(ImBuf *ibuf, const rcti *crop)
   };
   BLI_assert(size_dst[0] > 0 && size_dst[1] > 0);
   BLI_assert(crop->xmin >= 0 && crop->ymin >= 0);
-  BLI_assert(crop->xmax < ibuf->x && crop->ymax < ibuf->y);
+  BLI_assert(crop->xmax <= ibuf->x && crop->ymax <= ibuf->y);
 
   if ((size_dst[0] == ibuf->x) && (size_dst[1] == ibuf->y)) {
     return;
diff --git a/source/blender/sequencer/intern/render.c b/source/blender/sequencer/intern/render.c
index 3006deb1748..7e43950edca 100644
--- a/source/blender/sequencer/intern/render.c
+++ b/source/blender/sequencer/intern/render.c
@@ -2087,10 +2087,6 @@ ImBuf *SEQ_get_thumbnail(SeqRenderData *context,
       crop->xmin = 0;
       crop->ymin = 0;
     }
-    if (crop->xmax >= ibuf->x || crop->ymax >= ibuf->y) {
-      crop->xmax = ibuf->x - 1;
-      crop->ymax = ibuf->y - 1;
-    }
     IMB_rect_crop(temp, crop);
     if (temp != NULL) {
       IMB_freeImBuf(ibuf);



More information about the Bf-blender-cvs mailing list