aboutsummaryrefslogtreecommitdiffstats
path: root/color_pipe.c
diff options
context:
space:
mode:
authorPatrick Roth <roth@stettbacher.ch>2021-07-01 10:54:34 +0200
committerPatrick Roth <roth@stettbacher.ch>2021-07-01 10:54:34 +0200
commit39529749bd4df513541bf259795ee6698f4fd679 (patch)
treef3ec2d2256d6f11f6c1b50c2815597c42c3843fd /color_pipe.c
parentworking copy (diff)
downloado3000-color-pipe-39529749bd4df513541bf259795ee6698f4fd679.tar.gz
o3000-color-pipe-39529749bd4df513541bf259795ee6698f4fd679.zip
change weights to -100.0...+100.0 per cent
The upper and lower horizontal trapeze line will change. The vertical weight is not implemented now!
Diffstat (limited to 'color_pipe.c')
-rw-r--r--color_pipe.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/color_pipe.c b/color_pipe.c
index 648e259..b0a9ddf 100644
--- a/color_pipe.c
+++ b/color_pipe.c
@@ -396,8 +396,8 @@ static void set_default_value(struct color_pipe_t *pipe) {
pipe->trapcorr_data.enable = 0;
pipe->trapcorr_data.map_init = 0;
- pipe->trapcorr_data.wv = 1.0f;
- pipe->trapcorr_data.wh = 1.0f;
+ pipe->trapcorr_data.wv = 0.0f;
+ pipe->trapcorr_data.wh = 0.0f;
pipe->trapcorr_data.wv_new = pipe->trapcorr_data.wv;
pipe->trapcorr_data.wh_new = pipe->trapcorr_data.wh;
}
@@ -877,16 +877,15 @@ void __stdcall color_pipe_stageconf_gamma(struct color_pipe_t *color_pipe, int e
/**
* Pipeline stage configuration: Isosceles Trapeze Correction
*
- * The vertical and horizontal correction weight are positive
- * numbers starting from 0. A weight of 1.0 means no correction. A weight lesser than
- * 1.0 means the upper trapeze line is shorter than the lower trapeze line.
- * Therfore a weight greater than 1.0 means the upper trapeze line is longer than
- * the lower line.
+ * The vertical and horizontal correction weight are per cent values ranging
+ * from -100.0 % to +100.0 %. A positive weight means that the upper horizontal trapeze
+ * is fixed and won't shrink while a negative value means the opposite lower line won't change.
+ * A weight of zero means not correction.
*
* @param color_pipe Pointer to pipeline context
* @param enable not 0: enable, 0: disable
- * @param wv vertical weight
- * @param wh horizontal weight
+ * @param wv vertical weight (range: -100.0 to +100.0)
+ * @param wh horizontal weight (range: -100.0 to +100.0)
*/
void __stdcall color_pipe_stageconf_trapcorr(struct color_pipe_t *color_pipe, int enable, float wv, float wh) {
// paranoia
@@ -896,11 +895,18 @@ void __stdcall color_pipe_stageconf_trapcorr(struct color_pipe_t *color_pipe, in
}
// range check
- if(wv < 0.0f) {
- wv = 0.0f;
+ if(wv < -100.0f) {
+ wv = -100.0f;
}
- if(wh < 0.0f) {
- wh = 0.0f;
+ else if(wv > 100.0) {
+ wv = 100.0f;
+ }
+
+ if(wh < -100.0f) {
+ wh = -100.0f;
+ }
+ else if(wh > 100.0) {
+ wh = 100.0f;
}
color_pipe->trapcorr_data.enable = enable;