/// <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); }
/// <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; }