/// <summary>
 /// Gets the hash code
 /// </summary>
 /// <returns>Hash code</returns>
 public override int GetHashCode()
 {
     unchecked // Overflow is fine, just wrap
     {
         int hashCode = 41;
         if (FileId != null)
         {
             hashCode = hashCode * 59 + FileId.GetHashCode();
         }
         if (PageRange != null)
         {
             hashCode = hashCode * 59 + PageRange.GetHashCode();
         }
         hashCode = hashCode * 59 + RoiLeft.GetHashCode();
         hashCode = hashCode * 59 + RoiTop.GetHashCode();
         hashCode = hashCode * 59 + RoiWidth.GetHashCode();
         hashCode = hashCode * 59 + RoiHeight.GetHashCode();
         hashCode = hashCode * 59 + GammaCorrection.GetHashCode();
         hashCode = hashCode * 59 + Brightness.GetHashCode();
         hashCode = hashCode * 59 + Contrast.GetHashCode();
         hashCode = hashCode * 59 + Saturation.GetHashCode();
         hashCode = hashCode * 59 + AutoContrastEnhancement.GetHashCode();
         hashCode = hashCode * 59 + ContrastHistogramStretch.GetHashCode();
         return(hashCode);
     }
 }
Exemple #2
0
        public override int GetHashCode()
        {
            var hashCode = brightness?.GetHashCode() ?? 0;

            hashCode = (hashCode * 397) ^ color?.GetHashCode() ?? 0;
            hashCode = (hashCode * 397) ^ elevation?.GetHashCode() ?? 0;
            hashCode = (hashCode * 397) ^ iconTheme?.GetHashCode() ?? 0;
            hashCode = (hashCode * 397) ^ actionsIconTheme?.GetHashCode() ?? 0;
            hashCode = (hashCode * 397) ^ textTheme?.GetHashCode() ?? 0;
            return(hashCode);
        }
Exemple #3
0
        /// <summary>
        ///     Initializes a new instance of the <see cref="ColorInfo" /> struct.
        /// </summary>
        /// <param name="color">The color.</param>
        public ColorInfo(Color color) : this()
        {
            Color = color;
            Count = 1;

            Hue        = color.GetHue();
            Saturation = color.GetSaturation();
            Brightness = color.GetBrightness();

            HueHashCode        = Hue.GetHashCode();
            SaturationHashCode = Saturation.GetHashCode();
            BrightnessHashCode = Brightness.GetHashCode();
        }
Exemple #4
0
 public override int GetHashCode()
 {
     unchecked {
         var hashCode = primary.GetHashCode();
         hashCode = (hashCode * 397) ^ primaryVariant.GetHashCode();
         hashCode = (hashCode * 397) ^ secondary.GetHashCode();
         hashCode = (hashCode * 397) ^ secondaryVariant.GetHashCode();
         hashCode = (hashCode * 397) ^ surface.GetHashCode();
         hashCode = (hashCode * 397) ^ background.GetHashCode();
         hashCode = (hashCode * 397) ^ error.GetHashCode();
         hashCode = (hashCode * 397) ^ onPrimary.GetHashCode();
         hashCode = (hashCode * 397) ^ onSecondary.GetHashCode();
         hashCode = (hashCode * 397) ^ onSurface.GetHashCode();
         hashCode = (hashCode * 397) ^ onBackground.GetHashCode();
         hashCode = (hashCode * 397) ^ onError.GetHashCode();
         hashCode = (hashCode * 397) ^ brightness.GetHashCode();
         return(hashCode);
     }
 }
Exemple #5
0
 /// <summary>
 /// Calculates Hash code for this color.
 /// </summary>
 /// <returns></returns>
 public override int GetHashCode()
 {
     return(Hue.GetHashCode() ^ Saturation.GetHashCode() ^
            Brightness.GetHashCode());
 }
Exemple #6
0
        public override int GetHashCode()
        {
            int hash = 1;

            if (CameraDev.Length != 0)
            {
                hash ^= CameraDev.GetHashCode();
            }
            if (FrameId.Length != 0)
            {
                hash ^= FrameId.GetHashCode();
            }
            if (PixelFormat.Length != 0)
            {
                hash ^= PixelFormat.GetHashCode();
            }
            if (IoMethod != 0)
            {
                hash ^= IoMethod.GetHashCode();
            }
            if (Width != 0)
            {
                hash ^= Width.GetHashCode();
            }
            if (Height != 0)
            {
                hash ^= Height.GetHashCode();
            }
            if (FrameRate != 0)
            {
                hash ^= FrameRate.GetHashCode();
            }
            if (Monochrome != false)
            {
                hash ^= Monochrome.GetHashCode();
            }
            if (Brightness != 0)
            {
                hash ^= Brightness.GetHashCode();
            }
            if (Contrast != 0)
            {
                hash ^= Contrast.GetHashCode();
            }
            if (Saturation != 0)
            {
                hash ^= Saturation.GetHashCode();
            }
            if (Sharpness != 0)
            {
                hash ^= Sharpness.GetHashCode();
            }
            if (Gain != 0)
            {
                hash ^= Gain.GetHashCode();
            }
            if (AutoFocus != false)
            {
                hash ^= AutoFocus.GetHashCode();
            }
            if (Focus != 0)
            {
                hash ^= Focus.GetHashCode();
            }
            if (AutoExposure != false)
            {
                hash ^= AutoExposure.GetHashCode();
            }
            if (Exposure != 0)
            {
                hash ^= Exposure.GetHashCode();
            }
            if (AutoWhiteBalance != false)
            {
                hash ^= AutoWhiteBalance.GetHashCode();
            }
            if (WhiteBalance != 0)
            {
                hash ^= WhiteBalance.GetHashCode();
            }
            if (BytesPerPixel != 0)
            {
                hash ^= BytesPerPixel.GetHashCode();
            }
            if (TriggerInternal != 0)
            {
                hash ^= TriggerInternal.GetHashCode();
            }
            if (TriggerFps != 0)
            {
                hash ^= TriggerFps.GetHashCode();
            }
            if (ChannelName.Length != 0)
            {
                hash ^= ChannelName.GetHashCode();
            }
            if (DeviceWaitMs != 0)
            {
                hash ^= DeviceWaitMs.GetHashCode();
            }
            if (SpinRate != 0)
            {
                hash ^= SpinRate.GetHashCode();
            }
            if (OutputType != 0)
            {
                hash ^= OutputType.GetHashCode();
            }
            if (compressConf_ != null)
            {
                hash ^= CompressConf.GetHashCode();
            }
            return(hash);
        }
 public override int GetHashCode()
 {
     return(Brightness.GetHashCode());
 }