#308 blend docs do not match code

2.6
closed-fixed
HAL (34)
5
2013-11-04
2012-12-23
Ben Jackson
No

in1/in2/select relationship is backwards in docs.

Patch changes docs (even though docs state the more intuitive way) to avoid breaking HAL configs

Discussion

  • Ben Jackson

    Ben Jackson - 2012-12-23

    I can't attach anything (sf "could not open file for writing") so here's the patch:

    From 43a05c46eb9de207384dad4206c252703dd0bbd3 Mon Sep 17 00:00:00 2001
    From: Ben Jackson <ben@ben.com>
    Date: Sun, 23 Dec 2012 00:02:39 -0800
    Subject: [PATCH] blend: Make the docs match the component behavior

    The doc describes an obvious in1/in2/select relationship, but it is
    reversed as compared to the code. Change the docs to match the
    counterintuitive code to avoid breaking any existing HAL configurations.
    ---
    src/hal/components/blend.comp | 8 ++++----
    1 files changed, 4 insertions(+), 4 deletions(-)

    diff --git a/src/hal/components/blend.comp b/src/hal/components/blend.comp
    index b666995..10586b4 100644
    --- a/src/hal/components/blend.comp
    +++ b/src/hal/components/blend.comp
    @@ -17,12 +17,12 @@

    component blend "Perform linear interpolation between two values";

    -pin in float in1 "First input. If select is equal to 0.0, the output is equal to in1";
    -pin in float in2 "Second input. If select is equal to 1.0, the output is equal to in2";
    -pin in float select "Select input. For values between 0.0 and 1.0, the output changes linearly from in1 to in2";
    +pin in float in1 "First input. If select is equal to 1.0, the output is equal to in1";
    +pin in float in2 "Second input. If select is equal to 0.0, the output is equal to in2";
    +pin in float select "Select input. For values between 0.0 and 1.0, the output changes linearly from in2 to in1";
    pin out float out "Output value.";

    -param rw bit open "If true, select values outside the range 0.0 to 1.0 give values outside the range in1 to in2. If false, outputs are clamped to the the range in1 to in2";
    +param rw bit open "If true, select values outside the range 0.0 to 1.0 give values outside the range in2 to in1. If false, outputs are clamped to the the range in2 to in1";

    function _;
    license "GPL";
    --
    1.6.3.GIT

     
  • Chris Radek

    Chris Radek - 2013-11-04
    • status: open --> closed-fixed
    • assigned_to: John Kasunich --> Chris Radek
    • Group: --> 2.6
     
  • Chris Radek

    Chris Radek - 2013-11-04

    Thanks for fighting sourceforge and sending this patch. I was not able to get it to apply but I made the same changes by hand and set you as the author. Thank you!