示例#1
0
        /// <summary>
        /// Creates an imported image from the specified file
        /// </summary>
        /// <param name="imagePath"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static ImportedImage FromFile(string imagePath, ImageImportOptions options = null)
        {
            IImageProcessor processor;

            if (options == null)
            {
                options = new ImageImportOptions();
            }

            processor = new CubistImageProcessor(imagePath,
                                                 Enum.GetName(typeof(ImageImportOptions.HeightMappingMode), options.HeightMapping),
                                                 options.UseGrayScale,
                                                 options.SimplificationAmount,
                                                 options.Height,
                                                 options.Width);

            var obj = processor.ProcessImage();

            var img = new ImportedImage()
            {
                m_Object = obj,
                m_Bounds = processor.ImageBounds
            };

            return(img);
        }
示例#2
0
        /// <summary>
        /// Creates an imported image from the specified file
        /// </summary>
        /// <param name="imagePath"></param>
        /// <param name="options"></param>
        /// <returns></returns>
        public static ImportedImage FromFile(string imagePath, ImageImportOptions options = null)
        {
            IImageProcessor processor;            
            if(options == null)
            {
                options = new ImageImportOptions();
            }

            processor = new CubistImageProcessor(imagePath, 
                Enum.GetName(typeof(ImageImportOptions.HeightMappingMode), options.HeightMapping), 
                options.UseGrayScale, 
                options.SimplificationAmount,
                options.Height,
                options.Width);

            var obj = processor.ProcessImage();

            var img = new ImportedImage()
            {
                m_Object = obj,
                m_Bounds = processor.ImageBounds
            };

            return img;

        }