Clone() public method

Creates a new object that is a copy of the current instance.
public Clone ( ) : object
return object
コード例 #1
0
ファイル: Haralick.cs プロジェクト: xiubjarne/framework
        /// <summary>
        ///   Creates a new object that is a copy of the current instance.
        /// </summary>
        ///
        /// <returns>
        ///   A new object that is a copy of this instance.
        /// </returns>
        ///
        public object Clone()
        {
            var clone = new Haralick();

            clone.autoGray     = autoGray;
            clone.cellSize     = cellSize;
            clone.degrees      = degrees;
            clone.distance     = distance;
            clone.featureCount = featureCount;
            clone.features     = (HaralickDescriptorDictionary[, ])features.Clone();
            clone.matrix       = (GrayLevelCooccurrenceMatrix)matrix.Clone();
            clone.mode         = mode;
            clone.normalize    = normalize;
            return(clone);
        }
コード例 #2
0
ファイル: Haralick.cs プロジェクト: jthornca/accord-framework
        /// <summary>
        /// Creates a new object that is a copy of the current instance.
        /// </summary>
        ///
        protected override object Clone(ISet <PixelFormat> supportedFormats)
        {
            var clone = new Haralick();

            clone.SupportedFormats = supportedFormats;
            clone.autoGray         = autoGray;
            clone.cellSize         = cellSize;
            clone.degrees          = degrees;
            clone.distance         = distance;
            clone.featureCount     = featureCount;
            clone.SupportedFormats = SupportedFormats;
            if (features != null)
            {
                clone.features = (HaralickDescriptorDictionary[, ])features.Clone();
            }
            if (matrix != null)
            {
                clone.matrix = (GrayLevelCooccurrenceMatrix)matrix.Clone();
            }
            clone.mode      = mode;
            clone.normalize = normalize;
            return(clone);
        }