Jump to content

spectorius

Newbies
  • Posts

    6
  • Joined

  • Last visited

Posts posted by spectorius

  1. we could creatively debate this all day :)

    my time is over midnight already (1:18 am) :)

                        if (intensity + this.brightness < 128)
                       {
                           this.rgbTable[intensity] = 0;
                       }
                       else
                       {
                           this.rgbTable[intensity] = 255;
                       }

    into

    this.rgbTable[intensity] = (intensity + this.brightness < 128) ? 0 : 255;
    

    :P:D

    p.s. i like simplicity very match :D

  2.         public static byte ClampToByte(double x) 
           {
               if (x > 255)
               {
                   return 255;
               }
               else if (x < 0)
               {
                   return 0;
               }
               else
               {
                   return (byte)x;
               }
           }

    another thing. i think the next code is some better :D :wink:

    public static byte ClampToByte(double x) 
    {
           return (byte)Math.Min(Math.Max(x, 0), 255);
    }

    That line of code does impact performance, but otherwise causes no harm.

    Why this line was there? Is it a part of the algorithm ?

    ANd, where i can read about used algoritm for Reduce Noise Effect. Thanks :wink:

×
×
  • Create New...