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:
authorHarley Acheson <harley.acheson@gmail.com>2021-02-22 22:52:19 +0300
committerHarley Acheson <harley.acheson@gmail.com>2021-02-22 22:52:19 +0300
commit9c395d6275a06ec6adbf5c3d1faa827adc1cf54e (patch)
treee259653d00cf3cdf8537e021f9f4894d1e16bec5
parentbe9842f65b85d64ab8b7baa686ded9c79c31227e (diff)
UI: Remove Blend Thumb Passepartout
Removal of 'camera frame' around blend file thumbnail images. Differential Revision: https://developer.blender.org/D10490 Reviewed by Brecht Van Lommel
-rw-r--r--source/blender/imbuf/IMB_thumbs.h1
-rw-r--r--source/blender/imbuf/intern/thumbs_blend.c58
-rw-r--r--source/blender/windowmanager/intern/wm_files.c6
3 files changed, 0 insertions, 65 deletions
diff --git a/source/blender/imbuf/IMB_thumbs.h b/source/blender/imbuf/IMB_thumbs.h
index a013e7e38dd..9dd0cbe895f 100644
--- a/source/blender/imbuf/IMB_thumbs.h
+++ b/source/blender/imbuf/IMB_thumbs.h
@@ -80,7 +80,6 @@ void IMB_thumb_makedirs(void);
struct ImBuf *IMB_thumb_load_blend(const char *blen_path,
const char *blen_group,
const char *blen_id);
-void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float aspect);
/* special function for previewing fonts */
struct ImBuf *IMB_thumb_load_font(const char *filename, unsigned int x, unsigned int y);
diff --git a/source/blender/imbuf/intern/thumbs_blend.c b/source/blender/imbuf/intern/thumbs_blend.c
index 0d1fa354b3e..106e4618847 100644
--- a/source/blender/imbuf/intern/thumbs_blend.c
+++ b/source/blender/imbuf/intern/thumbs_blend.c
@@ -100,61 +100,3 @@ ImBuf *IMB_thumb_load_blend(const char *blen_path, const char *blen_group, const
return ima;
}
-
-/* add a fake passepartout overlay to a byte buffer, use for blend file thumbnails */
-#define MARGIN 2
-
-void IMB_thumb_overlay_blend(unsigned int *thumb, int width, int height, float aspect)
-{
- unsigned char *px = (unsigned char *)thumb;
- int margin_l = MARGIN;
- int margin_b = MARGIN;
- int margin_r = width - MARGIN;
- int margin_t = height - MARGIN;
-
- if (aspect < 1.0f) {
- margin_l = (int)((width - ((float)width * aspect)) / 2.0f);
- margin_l += MARGIN;
- CLAMP(margin_l, MARGIN, (width / 2));
- margin_r = width - margin_l;
- }
- else if (aspect > 1.0f) {
- margin_b = (int)((height - ((float)height / aspect)) / 2.0f);
- margin_b += MARGIN;
- CLAMP(margin_b, MARGIN, (height / 2));
- margin_t = height - margin_b;
- }
-
- {
- int x, y;
- int stride_x = (margin_r - margin_l) - 2;
-
- for (y = 0; y < height; y++) {
- for (x = 0; x < width; x++, px += 4) {
- int hline = 0, vline = 0;
- if ((x > margin_l && x < margin_r) && (y > margin_b && y < margin_t)) {
- /* interior. skip */
- x += stride_x;
- px += stride_x * 4;
- }
- else if ((hline = (((x == margin_l || x == margin_r)) && y >= margin_b &&
- y <= margin_t)) ||
- (vline = (((y == margin_b || y == margin_t)) && x >= margin_l &&
- x <= margin_r))) {
- /* dashed line */
- if ((hline && y % 2) || (vline && x % 2)) {
- px[0] = px[1] = px[2] = 0;
- px[3] = 255;
- }
- }
- else {
- /* outside, fill in alpha, like passepartout */
- px[0] *= 0.5f;
- px[1] *= 0.5f;
- px[2] *= 0.5f;
- px[3] = (px[3] * 0.5f) + 96;
- }
- }
- }
- }
-}
diff --git a/source/blender/windowmanager/intern/wm_files.c b/source/blender/windowmanager/intern/wm_files.c
index 8bea2203abe..d2d080a9a68 100644
--- a/source/blender/windowmanager/intern/wm_files.c
+++ b/source/blender/windowmanager/intern/wm_files.c
@@ -1398,14 +1398,8 @@ static ImBuf *blend_file_thumb(const bContext *C,
}
if (ibuf) {
- float aspect = (scene->r.xsch * scene->r.xasp) / (scene->r.ysch * scene->r.yasp);
-
/* dirty oversampling */
IMB_scaleImBuf(ibuf, BLEN_THUMB_SIZE, BLEN_THUMB_SIZE);
-
- /* add pretty overlay */
- IMB_thumb_overlay_blend(ibuf->rect, ibuf->x, ibuf->y, aspect);
-
thumb = BKE_main_thumbnail_from_imbuf(NULL, ibuf);
}
else {