Beispiel #1
0
 /// <summary>
 /// Initializes a new instance of the <see cref="YCbCrFiltering"/> class.
 /// </summary>
 ///
 /// <param name="yRange">Range of Y component.</param>
 /// <param name="cbRange">Range of Cb component.</param>
 /// <param name="crRange">Range of Cr component.</param>
 ///
 public YCbCrFiltering(Range yRange, Range cbRange, Range crRange) :
     this()
 {
     this.yRange  = yRange;
     this.cbRange = cbRange;
     this.crRange = crRange;
 }
Beispiel #2
0
 /// <summary>
 /// Initializes a new instance of the <see cref="HSLFiltering"/> class.
 /// </summary>
 ///
 /// <param name="hue">Range of hue component.</param>
 /// <param name="saturation">Range of saturation component.</param>
 /// <param name="luminance">Range of luminance component.</param>
 ///
 public HSLFiltering(IntRange hue, Range saturation, Range luminance) :
     this()
 {
     this.hue        = hue;
     this.saturation = saturation;
     this.luminance  = luminance;
 }
Beispiel #3
0
        /// <summary>
        /// Initializes a new instance of the <see cref="ContinuousHistogram"/> class.
        /// </summary>
        ///
        /// <param name="values">Values of the histogram.</param>
        /// <param name="range">Range of random values.</param>
        ///
        /// <remarks>Values of the integer array are treated as total amount of hits on the
        /// corresponding subranges, which are calculated by splitting the specified range into
        /// required amount of consequent ranges (see <see cref="ContinuousHistogram"/> class
        /// description for more information).
        /// </remarks>
        ///
        public ContinuousHistogram(int[] values, Range range)
        {
            this.values = values;
            this.range  = range;

            Update();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="ContinuousHistogram"/> class.
        /// </summary>
        /// 
        /// <param name="values">Values of the histogram.</param>
        /// <param name="range">Range of random values.</param>
        /// 
        /// <remarks>Values of the integer array are treated as total amount of hits on the
        /// corresponding subranges, which are calculated by splitting the specified range into
        /// required amount of consequent ranges (see <see cref="ContinuousHistogram"/> class
        /// description for more information).
        /// </remarks>
        /// 
        public ContinuousHistogram(int[] values, Range range)
        {
            this.values = values;
            this.range = range;

            Update();
        }
Beispiel #5
0
 /// <summary>
 ///   Indicates whether the current object is equal to another object of the same type.
 /// </summary>
 ///
 /// <param name="other">An object to compare with this object.</param>
 ///
 /// <returns>
 ///   true if the current object is equal to the <paramref name="other" /> parameter; otherwise, false.
 /// </returns>
 ///
 public bool Equals(Range other)
 {
     return(this == other);
 }
Beispiel #6
0
 /// <summary>
 ///   Computes the intersection between two ranges.
 /// </summary>
 ///
 /// <param name="range">The second range for which the intersection should be calculated.</param>
 ///
 /// <returns>An new <see cref="Range"/> structure containing the intersection
 /// between this range and the <paramref name="range"/> given as argument.</returns>
 ///
 public Range Intersection(Range range)
 {
     return(new Range(System.Math.Max(this.Min, range.Min), System.Math.Min(this.Max, range.Max)));
 }
Beispiel #7
0
 /// <summary>
 ///   Check if the specified range overlaps with the range.
 /// </summary>
 ///
 /// <param name="range">Range to check for overlapping.</param>
 ///
 /// <returns>
 ///   <b>True</b> if the specified range overlaps with the range or <b>false</b> otherwise.
 /// </returns>
 ///
 public bool IsOverlapping(Range range)
 {
     return((IsInside(range.min)) || (IsInside(range.max)) ||
            (range.IsInside(min)) || (range.IsInside(max)));
 }
Beispiel #8
0
 /// <summary>
 ///   Check if the specified range is inside of the range.
 /// </summary>
 ///
 /// <param name="range">Range to check.</param>
 ///
 /// <returns>
 ///   <b>True</b> if the specified range is inside of the range or <b>false</b> otherwise.
 /// </returns>
 ///
 public bool IsInside(Range range)
 {
     return((IsInside(range.min)) && (IsInside(range.max)));
 }