Example #1
0
 private void CalculateMap(Range inRange, Range outRange, byte[] map)
 {
     double num = 0.0;
     double num2 = 0.0;
     if (inRange.Max != inRange.Min)
     {
         num = ((double) (outRange.Max - outRange.Min)) / ((double) (inRange.Max - inRange.Min));
         num2 = outRange.Min - (num * inRange.Min);
     }
     for (int i = 0; i < 0x100; i++)
     {
         byte max = (byte) i;
         if (max >= inRange.Max)
         {
             max = (byte) outRange.Max;
         }
         else if (max <= inRange.Min)
         {
             max = (byte) outRange.Min;
         }
         else
         {
             max = (byte) ((num * max) + num2);
         }
         map[i] = max;
     }
 }
Example #2
0
 public ColorFiltering()
 {
     this.red = new Range(0, 0xff);
     this.green = new Range(0, 0xff);
     this.blue = new Range(0, 0xff);
     this.fillOutsideRange = true;
 }
Example #3
0
 public HSLFiltering()
 {
     this.hue = new Range(0, 0x167);
     this.saturation = new RangeD(0.0, 1.0);
     this.luminance = new RangeD(0.0, 1.0);
     this.fillOutsideRange = true;
     this.updateH = true;
     this.updateS = true;
     this.updateL = true;
 }
Example #4
0
 public ColorFiltering(Range red, Range green, Range blue)
 {
     this.red = new Range(0, 0xff);
     this.green = new Range(0, 0xff);
     this.blue = new Range(0, 0xff);
     this.fillOutsideRange = true;
     this.red = red;
     this.green = green;
     this.blue = blue;
 }
Example #5
0
		public void FrequencyFilter(Range range) {
			if (this.fmode) {
				int num = this.width >> 1;
				int num2 = this.height >> 1;
				int min = (int)range.Min;
				int max = (int)range.Max;
				for (int i = 0; i < this.height; i++) {
					int num6 = i - num2;
					for (int j = 0; j < this.width; j++) {
						int num8 = j - num;
						int num9 = (int)Math.Sqrt((double)((num8 * num8) + (num6 * num6)));
						if ((num9 > max) || (num9 < min)) {
							this.data[i, j].Re = 0f;
							this.data[i, j].Im = 0f;
						}
					}
				}
			}
		}