static IImageProcess imageProcess; //图像处理类 public static bool Init(string filename) { try { byte[] assemblyBuffer = File.ReadAllBytes(filename); ass = Assembly.Load(assemblyBuffer); //ass = Assembly.LoadFrom(filename); foreach (var t in ass.GetTypes()) { if (t.GetInterface("IImageProcess") != null) { imageProcess = (IImageProcess)Activator.CreateInstance(t); } } string pPath = Path.GetDirectoryName(filename); imageProcess.Init(pPath); return(true); } catch (Exception ee) { MessageBox.Show("加载配方初始化失败:" + ee.ToString()); return(false); } }
/// <summary> /// Create new Camera object. /// </summary> /// <param name="source">Video source.</param> /// <param name="imageProcess">The image process system.</param> /// <param name="output">To where output results.</param> /// <param name="graphicalOutput">How to change the graphical output.</param> /// <param name="pictureBox">Where to display the final image.</param> public Camera(IVideoSource source, IImageProcess imageProcess, IOutput output, GraphicalOutputDelegate graphicalOutput, PictureBox pictureBox) { if (source == null) { throw new ArgumentNullException("source"); } if (imageProcess == null) { throw new ArgumentNullException("imageProcess"); } if (output == null) { throw new ArgumentNullException("output"); } if (graphicalOutput == null) { throw new ArgumentNullException("graphicalOutput"); } if (pictureBox == null) { throw new ArgumentNullException("pictureBox"); } videoSource = source; videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame); this.imageProcess = imageProcess; this.output = output; this.graphicalOutput = graphicalOutput; this.pictureBox = pictureBox; }
public void RunProcessing(IImageProcess process) { _undoImage = Image.Clone(); BitmapImage newImage = process.Apply(Image); Image = newImage; }
private void RunProceesing(IImageProcess process) { if (DockControlHost.ActiveDocument is ImageContent) { var Doc = (ImageContent)DockControlHost.ActiveDocument; Doc.RunProcessing(process); } }
public bool Equals(IImageProcess other) { if (other is GammaCorrection == false) { return(false); } GammaCorrection corrector = other as GammaCorrection; return(Gamma == corrector.Gamma); }
public bool Equals(IImageProcess other) { if (other is GaussianSmooth == false) { return(false); } GaussianSmooth smoother = other as GaussianSmooth; return(SmoothingRadius == smoother.SmoothingRadius); }
private IImageProcess actions(IImageProcess action, String actionString) { Bitmap bitmap = bitmapFromSource(); Stopwatch sw = TimeCountStart(); action.setResouceImage(bitmap); Bitmap resBitmap = action.Process(); UIMessage(actionString, sw); setResultBitmap(resBitmap); return(action); }
public ImageHandler( IImageLoader imageLoader, IImageBrowser imageBrowser, IImagePicker imagePicker, IImageProcess imageProcess) { // Responsible for loading Images _imageLoader = imageLoader; // Responsible for browsing new Images _imageBrowser = imageBrowser; // Responsible for changing the Image index in the _imageFiles Dictionary _imagePicker = imagePicker; // Responsible for editing images _imageProcess = imageProcess; }
static IImageProcess imageProcess; //图像处理类 public static bool init(string filename) { try { ass = Assembly.LoadFrom(filename); foreach (var t in ass.GetTypes()) { if (t.GetInterface("IImageProcess") != null) { imageProcess = (IImageProcess)Activator.CreateInstance(t); } } imageProcess.Init(); } catch { MessageBox.Show("加载配方初始化失败"); return(false); } return(true); }
/// <summary> /// Create new Camera object. /// </summary> /// <param name="source">Video source.</param> /// <param name="imageProcess">The image process system.</param> /// <param name="output">To where output results.</param> /// <param name="graphicalOutput">How to change the graphical output.</param> /// <param name="pictureBox">Where to display the final image.</param> public Camera(IVideoSource source, IImageProcess imageProcess, IOutput output, GraphicalOutputDelegate graphicalOutput, PictureBox pictureBox) { if (source == null) throw new ArgumentNullException("source"); if (imageProcess == null) throw new ArgumentNullException("imageProcess"); if (output == null) throw new ArgumentNullException("output"); if (graphicalOutput == null) throw new ArgumentNullException("graphicalOutput"); if (pictureBox == null) throw new ArgumentNullException("pictureBox"); videoSource = source; videoSource.NewFrame += new NewFrameEventHandler(video_NewFrame); this.imageProcess = imageProcess; this.output = output; this.graphicalOutput = graphicalOutput; this.pictureBox = pictureBox; }
public CarImageManager(ICarImageDal carImageDal, IImageProcess imageProcess) { _carImageDal = carImageDal; _imageProcess = imageProcess; }
public Logic(IImageProcess imgProcess) { this.imageProcessor = imgProcess; }
public HomeController(IImageProcess imageProcess) { _imageProcess = imageProcess ?? throw new ArgumentNullException(nameof(imageProcess)); }