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:
authorPeter Schlaile <peter@schlaile.de>2012-03-17 23:31:28 +0400
committerPeter Schlaile <peter@schlaile.de>2012-03-17 23:31:28 +0400
commit8bf1615ce3aa44e9f68b1c8483edeabaa290307a (patch)
tree6950d6ea08986c79d4e2637a555d922efb5d6e0a
parent02abb636a35b2f3dfcb430a87219f5d15cf35a77 (diff)
== Sequencer ==
Bugfix: [#28159] sequencer strip crop values on proxy not scene render size Also: IMB saturation change moved into imbuf-module.
-rw-r--r--source/blender/blenkernel/intern/sequencer.c45
-rw-r--r--source/blender/imbuf/IMB_imbuf.h1
-rw-r--r--source/blender/imbuf/intern/divers.c27
3 files changed, 50 insertions, 23 deletions
diff --git a/source/blender/blenkernel/intern/sequencer.c b/source/blender/blenkernel/intern/sequencer.c
index b57e2f3dab9..a42261d13c7 100644
--- a/source/blender/blenkernel/intern/sequencer.c
+++ b/source/blender/blenkernel/intern/sequencer.c
@@ -1171,6 +1171,20 @@ static IMB_Proxy_Size seq_rendersize_to_proxysize(int size)
return IMB_PROXY_25;
}
+static double seq_rendersize_to_scale_factor(int size)
+{
+ if (size >= 99) {
+ return 1.0;
+ }
+ if (size >= 75) {
+ return 0.75;
+ }
+ if (size >= 50) {
+ return 0.50;
+ }
+ return 0.25;
+}
+
static void seq_open_anim_file(Sequence * seq)
{
char name[FILE_MAX];
@@ -1688,6 +1702,13 @@ static ImBuf * input_preprocess(
StripTransform t= {0};
int sx,sy,dx,dy;
+ double f = seq_rendersize_to_scale_factor(
+ context.preview_render_size);
+
+ if (f != 1.0) {
+ IMB_scalefastImBuf(ibuf, ibuf->x / f, ibuf->y / f);
+ }
+
if(seq->flag & SEQ_USE_CROP && seq->strip->crop) {
c = *seq->strip->crop;
}
@@ -1728,29 +1749,7 @@ static ImBuf * input_preprocess(
}
if(seq->sat != 1.0f) {
- /* inline for now, could become an imbuf function */
- int i;
- unsigned char *rct= (unsigned char *)ibuf->rect;
- float *rctf= ibuf->rect_float;
- const float sat= seq->sat;
- float hsv[3];
-
- if(rct) {
- float rgb[3];
- for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4) {
- rgb_uchar_to_float(rgb, rct);
- rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
- hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb+1, rgb+2);
- rgb_float_to_uchar(rct, rgb);
- }
- }
-
- if(rctf) {
- for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4) {
- rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv+1, hsv+2);
- hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf+1, rctf+2);
- }
- }
+ IMB_saturation(ibuf, seq->sat);
}
mul = seq->mul;
diff --git a/source/blender/imbuf/IMB_imbuf.h b/source/blender/imbuf/IMB_imbuf.h
index a68bbb97b62..a0c737b44fc 100644
--- a/source/blender/imbuf/IMB_imbuf.h
+++ b/source/blender/imbuf/IMB_imbuf.h
@@ -375,6 +375,7 @@ void IMB_float_from_rect_simple(struct ImBuf *ibuf); /* no profile conversion */
void IMB_convert_profile(struct ImBuf *ibuf, int profile);
float *IMB_float_profile_ensure(struct ImBuf *ibuf, int profile, int *alloc);
void IMB_color_to_bw(struct ImBuf *ibuf);
+void IMB_saturation(struct ImBuf *ibuf, float sat);
/* converting pixel buffers */
void IMB_buffer_byte_from_float(unsigned char *rect_to, const float *rect_from,
diff --git a/source/blender/imbuf/intern/divers.c b/source/blender/imbuf/intern/divers.c
index 45f58ee9d17..bd9b32e77f4 100644
--- a/source/blender/imbuf/intern/divers.c
+++ b/source/blender/imbuf/intern/divers.c
@@ -750,3 +750,30 @@ void IMB_buffer_float_clamp(float *buf, int width, int height)
buf[i] = MIN2(1.0, buf[i]);
}
}
+
+/**************************** alter saturation *****************************/
+
+void IMB_saturation(ImBuf * ibuf, float sat)
+{
+ int i;
+ unsigned char *rct= (unsigned char *)ibuf->rect;
+ float *rctf= ibuf->rect_float;
+ float hsv[3];
+
+ if(rct) {
+ float rgb[3];
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rct+=4) {
+ rgb_uchar_to_float(rgb, rct);
+ rgb_to_hsv(rgb[0], rgb[1], rgb[2], hsv, hsv+1, hsv+2);
+ hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rgb, rgb+1, rgb+2);
+ rgb_float_to_uchar(rct, rgb);
+ }
+ }
+
+ if(rctf) {
+ for (i = ibuf->x * ibuf->y; i > 0; i--, rctf+=4) {
+ rgb_to_hsv(rctf[0], rctf[1], rctf[2], hsv, hsv+1, hsv+2);
+ hsv_to_rgb(hsv[0], hsv[1] * sat, hsv[2], rctf, rctf+1, rctf+2);
+ }
+ }
+}