0 Replies Latest reply on Sep 10, 2010 8:01 AM by makc3d

    step() in flash does exactly the opposite thing

    makc3d Level 1

      Consider simple threshold filter:

      {
          parameter float threshold <
              minValue: 0.0;
              maxValue: 1.0;
              defaultValue: 0.5;
          >;
          input image4 src;
          output pixel4 dst;
          void
          evaluatePixel()
          {
              pixel4 p = sampleNearest (src, outCoord ());
              pixel3 q; q.rgb = p.rgb;
              p.r = step (threshold * 1.7320508075688772935274463415059, length (q));
              p.g = p.r;
              p.b = p.r;
              dst = p;
          }
      }
      


      This thing makes black-on-white image in cpu mode, and white-on-black in flash mode.