mirror of
https://github.com/eliasstepanik/OSCADSharpDotnet7.git
synced 2026-01-12 05:58:34 +00:00
Fix for a compile error (oops), and added ImageImportOptions.cs
This commit is contained in:
parent
59e250b28d
commit
d308a517ee
@ -48,6 +48,7 @@
|
||||
<Compile Include="OSCADObject.BaseTransform.cs" />
|
||||
<Compile Include="OSCADObject.BasicTransforms.cs" />
|
||||
<Compile Include="OSCADObject.Booleans.cs" />
|
||||
<Compile Include="Solids\Imported\ImageImportOptions.cs" />
|
||||
<Compile Include="Utility\Images\AdjacentPixelMatrix.cs" />
|
||||
<Compile Include="Utility\Images\CubistImageProcessor.cs" />
|
||||
<Compile Include="Utility\Images\IImageProcessor.cs" />
|
||||
|
||||
19
OSCADSharp/OSCADSharp/Solids/Imported/ImageImportOptions.cs
Normal file
19
OSCADSharp/OSCADSharp/Solids/Imported/ImageImportOptions.cs
Normal file
@ -0,0 +1,19 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
namespace OSCADSharp.Solids.Imported
|
||||
{
|
||||
/// <summary>
|
||||
/// Configuration options for processing imported images
|
||||
/// </summary>
|
||||
public class ImageImportOptions
|
||||
{
|
||||
/// <summary>
|
||||
/// Indicates whether height-mapping should be used
|
||||
/// </summary>
|
||||
public bool HeightMapping { get; set; } = true;
|
||||
}
|
||||
}
|
||||
@ -25,19 +25,17 @@ namespace OSCADSharp.Solids.Imported
|
||||
/// 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)
|
||||
public static ImportedImage FromFile(string imagePath, ImageImportOptions options = null)
|
||||
{
|
||||
IImageProcessor processor;
|
||||
//if(mode == ImageImportMode.Cubist)
|
||||
//{
|
||||
processor = new CubistImageProcessor(imagePath);
|
||||
//}
|
||||
//else
|
||||
//{
|
||||
// processor = new PolygonalImageProcessor(imagePath);
|
||||
//}
|
||||
IImageProcessor processor;
|
||||
if(options == null)
|
||||
{
|
||||
options = new ImageImportOptions();
|
||||
}
|
||||
|
||||
processor = new CubistImageProcessor(imagePath, options.HeightMapping);
|
||||
var obj = processor.ProcessImage();
|
||||
|
||||
var img = new ImportedImage()
|
||||
|
||||
@ -1,4 +1,5 @@
|
||||
using OSCADSharp.Spatial;
|
||||
using OSCADSharp.Solids;
|
||||
using OSCADSharp.Spatial;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user