コード例 #1
0
 public CameraImageDownloading(ICameraInfoHelper cameraInfoHelper = null,
                               IImageManipulator imageSaver       = null,
                               IWebClientFactory webClientFactory = null)
 {
     _cameraInfoHelper = cameraInfoHelper ?? new CameraInfoHelper();
     _imageSaver       = imageSaver ?? new LocalImageManipulator();
     _webClientFactory = webClientFactory ?? new CustomWebClientFactory();
 }
コード例 #2
0
 public DlpCollectionProcess()
 {
     _cameraImageDownloading = new CameraImageDownloading();
     _openAlprWrapper        = new OpenAlprWrapper();
     _dlpHelper        = new DetectedPlateHelper();
     _fileNamer        = new ImageFileNamer();
     _imageManipulator = new LocalImageManipulator(_fileNamer);
     _locationToUrl    = new LocationToUrlConverter();
 }
コード例 #3
0
 public void TestSetup()
 {
     _fakeCameraImageDownloading = A.Fake <ICameraImageDownloading>();
     _fakeOpenAlprWrapper        = A.Fake <IOpenAlprWrapper>();
     _fakeDlpHelper            = A.Fake <IDetectedPlateHelper>();
     _fakeImageSaver           = A.Fake <IImageManipulator>();
     _fakeFileNamer            = A.Fake <IImageFileNamer>();
     _fakeLocationUrlConverter = A.Fake <ILocationToUrlConverter>();
 }
コード例 #4
0
 public FileService(ILogger <FileService> logger, IDbServicesFactory factory, FileServiceConfig config,
                    S3Provider provider, IImageManipulator imageManip)
 {
     this.dbFactory  = factory;
     this.config     = config;
     this.s3Provider = provider;
     this.logger     = logger;
     this.imageManip = imageManip;
 }
コード例 #5
0
 public Model()
 {
     // INSTANTIATE '_images' as a new Dictionary to store a key and an Image object:
     _images = new Dictionary <string, Image>();
     // INSTANTIATE '_manipulator' as an instance of ImageManipulator:
     _manipulator = new ImageManipulator();
     // INSTANTIATE '_imageFactory' as an instance of ImageFactory:
     _imageFactory = new ImageFactory();
 }
コード例 #6
0
 public ImageCurator(
     IImageManipulator imageManipulator,
     IRedditImageFetcher redditImageFetcher,
     ISubredditConfigRepository subredditConfigRepository
     )
 {
     this.imageManipulator          = imageManipulator;
     this.redditImageFetcher        = redditImageFetcher;
     this.subredditConfigRepository = subredditConfigRepository;
 }
コード例 #7
0
 public StoreChainLogoManager(
     IOptions <StoreChainLogoBlobOptions> options,
     ISpeedwaveBlobContainer <StoreChainLogoBlobContainer> blobContainer,
     IImageManipulator imageManipulator,
     IMd5Hasher md5Hasher)
 {
     BlobContainer    = blobContainer;
     Options          = options.Value;
     ImageManipulator = imageManipulator;
     Md5Hasher        = md5Hasher;
 }
コード例 #8
0
 public ItemPictureManager(
     IOptions <ItemPicturesBlobOptions> options,
     ISpeedwaveBlobContainer <ItemPicturesBlobContainer> blobContainer,
     IImageManipulator imageManipulator,
     IMd5Hasher md5Hasher)
 {
     BlobContainer    = blobContainer;
     Options          = options.Value;
     ImageManipulator = imageManipulator;
     Md5Hasher        = md5Hasher;
 }
コード例 #9
0
 public CategoryThumbnailManager(
     IOptions <CategoryThumbnailsBlobOptions> options,
     ISpeedwaveBlobContainer <CategoryThumbnailsBlobContainer> blobContainer,
     IMd5Hasher md5Hasher,
     IImageManipulator imageManipulator)
 {
     BlobContainer    = blobContainer;
     Options          = options.Value;
     ImageManipulator = imageManipulator;
     Md5Hasher        = md5Hasher;
 }
コード例 #10
0
 public CategoryThumbnailManager(
     ISpeedwaveBlobContainer blobContainer,
     IImageManipulator imageManipulator,
     IOptions <SpeedwaveBlobOptions> options,
     IRepository <CategoryEntity, int> categoryRepository,
     IMd5Hasher md5Hasher)
 {
     BlobContainer      = blobContainer;
     ImageManipulator   = imageManipulator;
     CategoryRepository = categoryRepository;
     Options            = options.Value;
     Md5Hasher          = md5Hasher;
 }
コード例 #11
0
        public MainForm(
            IHttpFilesHelper _httpFilesHelper,
            IImageManipulator _imageManipulator,
            ICloudHelper _iCloudHelper
            )
        {
            InitializeComponent();

            this._httpFilesHelper  = _httpFilesHelper;
            this._imageManipulator = _imageManipulator;

            this._cloudHelper = _iCloudHelper;
            _iCloudHelper.Config("DefaultEndpointsProtocol=https;AccountName=cs2f2fa088b7edfx4579xb65;AccountKey=7pBk9brJlUj2mmDOyesFhPLkymjv2DGYSCvV8OH5DeKUBAnLihVDDqbIzyFgkRABhdo/xthfP5CfZfDhPlFc9Q==;EndpointSuffix=core.windows.net");
        }
コード例 #12
0
 public DlpCollectionProcess(ICameraImageDownloading cameraImageDownloading = null,
                             IOpenAlprWrapper openAlprWrapper      = null,
                             IDetectedPlateHelper dlpHelper        = null,
                             IImageFileNamer fileNamer             = null,
                             IImageManipulator imageSaver          = null,
                             ILocationToUrlConverter locationToUrl = null)
 {
     _cameraImageDownloading = cameraImageDownloading ?? new CameraImageDownloading();
     _openAlprWrapper        = openAlprWrapper ?? new OpenAlprWrapper();
     _dlpHelper        = dlpHelper ?? new DetectedPlateHelper();
     _fileNamer        = fileNamer ?? new ImageFileNamer();
     _imageManipulator = imageSaver ?? new LocalImageManipulator(fileNamer);
     _locationToUrl    = locationToUrl ?? new LocationToUrlConverter();
 }
コード例 #13
0
 public ResizeCommand(bool applyToTarget, IImageManipulator manipulator, word width, word height, word percentage, bool maintainAspect, OutOfBoundsMode horizontalBph, OutOfBoundsMode verticalBph, byte count, bool useThresholds, bool useCenteredGrid, float radius)
 {
     this._applyToTarget  = applyToTarget;
     this.Manipulator     = manipulator;
     this.Width           = width;
     this.Height          = height;
     this.MaintainAspect  = maintainAspect;
     this.HorizontalBph   = horizontalBph;
     this.VerticalBph     = verticalBph;
     this.Count           = count;
     this.UseThresholds   = useThresholds;
     this.UseCenteredGrid = useCenteredGrid;
     this.Radius          = radius;
     this.Percentage      = percentage;
 }
コード例 #14
0
 public SlideShowPictureManager(
     IGuidGenerator guidGenerator,
     IOptions <SlideShowBlobOptions> options,
     IOptions <XmlSettings> xmlSettings,
     ISpeedwaveBlobContainer <SlideShowBlobContainer> blobContainer,
     IMd5Hasher md5Hasher,
     IImageManipulator imageManipulator)
 {
     BlobContainer    = blobContainer;
     ImageManipulator = imageManipulator;
     Md5Hasher        = md5Hasher;
     Options          = options.Value;
     XmlSettings      = xmlSettings.Value;
     GuidGenerator    = guidGenerator;
 }
コード例 #15
0
 /// <summary>
 /// METHOD: Initialise, a method which initialises the Controller
 /// </summary>
 public void Initialise()
 {
     // INSTANTIATE _collectionView
     _collectionView = new CollectionView(AddImage);
     // _imgManipulator as new ImageManipulator
     _imgManipulator = new ImageManipulator();
     // INSTANTIATE _fileDialog
     _fileDialog = new OpenFileDialog();
     // INSTANTIATE _dvController as a new DisplayViewController
     _dvController = new DisplayViewController(Execute);
     // _imgCollection as new ImageCollection
     _imgCollection = new ImageCollection(_dvController.InitialiseDisplay);
     // SET multiselection on the file dialog to true
     _fileDialog.Multiselect = true;
     // RUN the the new collection view
     Application.Run(_collectionView);
 }
コード例 #16
0
        /// <summary>
        /// Gets the list of supported parameters for the given manipulator.
        /// </summary>
        /// <param name="manipulator">The manipulator.</param>
        /// <returns>A text representing the supported parameters.</returns>
        private static string _GetSupportedParameterStringFromManipulator(IImageManipulator manipulator)
        {
            if (manipulator == null)
            {
                return(null);
            }

            var result = new List <string>();

            if (manipulator.SupportsWidth)
            {
                result.Add("width");
            }

            if (manipulator.SupportsHeight)
            {
                result.Add("height");
            }

            if (manipulator.SupportsRepetitionCount)
            {
                result.Add(ScriptSerializer.REPEAT_PARAMETER_NAME);
            }

            if (manipulator.SupportsThresholds)
            {
                result.Add(ScriptSerializer.THRESHOLDS_PARAMETER_NAME);
            }

            if (manipulator.SupportsRadius)
            {
                result.Add(ScriptSerializer.RADIUS_PARAMETER_NAME);
            }

            if (manipulator.SupportsGridCentering)
            {
                result.Add(ScriptSerializer.CENTERED_GRID_PARAMETER_NAME);
            }

            return(result.Count < 1 ? null : " (" + string.Join(", ", result) + ")");
        }
コード例 #17
0
        /// <summary>
        /// Filters the image.
        /// </summary>
        /// <param name="source">The source.</param>
        /// <param name="method">The method.</param>
        /// <param name="targetWidth">Width of the target.</param>
        /// <param name="targetHeight">Height of the target.</param>
        /// <param name="horizontalBh">The horizontal bounds handling.</param>
        /// <param name="verticalBh">The vertical bounds handling.</param>
        /// <param name="useThresholds">if set to <c>true</c> [use thresholds].</param>
        /// <param name="useCenteredGrid">if set to <c>true</c> [use centered grid].</param>
        /// <param name="repetitionCount">The repetition count.</param>
        /// <param name="radius">The radius.</param>
        /// <returns></returns>
        internal static cImage FilterImage(cImage source, IImageManipulator method, ushort targetWidth, ushort targetHeight, OutOfBoundsMode horizontalBh, OutOfBoundsMode verticalBh, bool useThresholds, bool useCenteredGrid, byte repetitionCount, float radius)
        {
            Contract.Requires(source != null);
            sPixel.AllowThresholds           = useThresholds;
            source.HorizontalOutOfBoundsMode = horizontalBh;
            source.VerticalOutOfBoundsMode   = verticalBh;

            cImage result          = null;
            var    scaler          = method as AScaler;
            var    interpolator    = method as Interpolator;
            var    planeExtractor  = method as PlaneExtractor;
            var    resampler       = method as Resampler;
            var    radiusResampler = method as RadiusResampler;

            if (scaler != null)
            {
                result = source;
                for (var i = 0; i < repetitionCount; i++)
                {
                    result = scaler.Apply(result);
                }
            }
            else if (interpolator != null)
            {
                if (targetWidth <= 0 || targetHeight <= 0)
                {
                    MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                else
                {
                    result = interpolator.Apply(source, targetWidth, targetHeight);
                }
            }
            else if (planeExtractor != null)
            {
                result = planeExtractor.Apply(source);
            }
            else if (resampler != null)
            {
                if (targetWidth <= 0 || targetHeight <= 0)
                {
                    MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                else
                {
                    result = resampler.Apply(source, targetWidth, targetHeight, useCenteredGrid);
                }
            }
            else if (radiusResampler != null)
            {
                if (targetWidth <= 0 || targetHeight <= 0)
                {
                    MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
                }
                else
                {
                    result = radiusResampler.Apply(source, targetWidth, targetHeight, radius, useCenteredGrid);
                }
            }

            return(result);
        }
コード例 #18
0
 public ResizeCommand(bool applyToTarget, IImageManipulator manipulator, word width, word height, word percentage, bool maintainAspect, OutOfBoundsMode horizontalBph, OutOfBoundsMode verticalBph, byte count, bool useThresholds, bool useCenteredGrid, float radius) {
   this._applyToTarget = applyToTarget;
   this._manipulator = manipulator;
   this._width = width;
   this._height = height;
   this._maintainAspect = maintainAspect;
   this._horizontalBph = horizontalBph;
   this._verticalBph = verticalBph;
   this._count = count;
   this._useThresholds = useThresholds;
   this._useCenteredGrid = useCenteredGrid;
   this._radius = radius;
   this._percentage = percentage;
 }
コード例 #19
0
 public override void SetUp()
 {
     base.SetUp();
     _imageLayoutBuilder = new ImageLayoutBuilder();
     _ImageManipulator   = new NoodleImageManipulator(_imageLayoutBuilder);
 }
コード例 #20
0
 /// <summary>
 /// Initializes a new instance of the <see cref="ExcelManipulator"/> class.
 /// </summary>
 /// <param name="bySquareEncoder">The BySquare encoder.</param>
 /// <param name="imageManipulator">The image manipulator.</param>
 /// <param name="progressReporter">The progress reporter.</param>
 public ExcelManipulator(IBySquareEncoder bySquareEncoder, IImageManipulator imageManipulator, IProgress <int> progressReporter) : this(progressReporter)
 {
     this.BySquareEncoder  = bySquareEncoder;
     this.ImageManipulator = imageManipulator;
 }
コード例 #21
0
 public HomeController(IImageManipulator imageManipulator)
 {
     _imageManipulator = imageManipulator;
 }
コード例 #22
0
ファイル: MainForm.cs プロジェクト: Acecool/2dimagefilter
    /// <summary>
    /// Filters the image.
    /// </summary>
    /// <param name="source">The source.</param>
    /// <param name="method">The method.</param>
    /// <param name="targetWidth">Width of the target.</param>
    /// <param name="targetHeight">Height of the target.</param>
    /// <param name="horizontalBh">The horizontal bounds handling.</param>
    /// <param name="verticalBh">The vertical bounds handling.</param>
    /// <param name="useThresholds">if set to <c>true</c> [use thresholds].</param>
    /// <param name="useCenteredGrid">if set to <c>true</c> [use centered grid].</param>
    /// <param name="repetitionCount">The repetition count.</param>
    /// <param name="radius">The radius.</param>
    /// <returns></returns>
    internal static cImage FilterImage(cImage source, IImageManipulator method, ushort targetWidth, ushort targetHeight, OutOfBoundsMode horizontalBh, OutOfBoundsMode verticalBh, bool useThresholds, bool useCenteredGrid, byte repetitionCount, float radius) {
      Contract.Requires(source != null);
      sPixel.AllowThresholds = useThresholds;
      source.HorizontalOutOfBoundsMode = horizontalBh;
      source.VerticalOutOfBoundsMode = verticalBh;

      cImage result = null;
      var scaler = method as AScaler;
      var interpolator = method as Interpolator;
      var planeExtractor = method as PlaneExtractor;
      var resampler = method as Resampler;
      var radiusResampler = method as RadiusResampler;

      if (scaler != null) {
        result = source;
        for (var i = 0; i < repetitionCount; i++)
          result = scaler.Apply(result);
      } else if (interpolator != null)
        if (targetWidth <= 0 || targetHeight <= 0)
          MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
        else
          result = interpolator.Apply(source, targetWidth, targetHeight);
      else if (planeExtractor != null)
        result = planeExtractor.Apply(source);
      else if (resampler != null)
        if (targetWidth <= 0 || targetHeight <= 0)
          MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
        else
          result = resampler.Apply(source, targetWidth, targetHeight, useCenteredGrid);
      else if (radiusResampler != null)
        if (targetWidth <= 0 || targetHeight <= 0)
          MessageBox.Show(Resources.txNeedWidthAndHeightAboveZero, Resources.ttNeedWidthAndHeightAboveZero, MessageBoxButtons.OK, MessageBoxIcon.Stop);
        else
          result = radiusResampler.Apply(source, targetWidth, targetHeight, radius, useCenteredGrid);

      return (result);
    }
コード例 #23
0
ファイル: CLI.cs プロジェクト: Acecool/2dimagefilter
    /// <summary>
    /// Gets the list of supported parameters for the given manipulator.
    /// </summary>
    /// <param name="manipulator">The manipulator.</param>
    /// <returns>A text representing the supported parameters.</returns>
    private static string _GetSupportedParameterStringFromManipulator(IImageManipulator manipulator) {
      if (manipulator == null)
        return (null);

      var result = new List<string>();

      if (manipulator.SupportsWidth)
        result.Add("width");

      if (manipulator.SupportsHeight)
        result.Add("height");

      if (manipulator.SupportsRepetitionCount)
        result.Add(ScriptSerializer.REPEAT_PARAMETER_NAME);

      if (manipulator.SupportsThresholds)
        result.Add(ScriptSerializer.THRESHOLDS_PARAMETER_NAME);

      if (manipulator.SupportsRadius)
        result.Add(ScriptSerializer.RADIUS_PARAMETER_NAME);

      if (manipulator.SupportsGridCentering)
        result.Add(ScriptSerializer.CENTERED_GRID_PARAMETER_NAME);

      return (result.Count < 1 ? null : " (" + string.Join(", ", result) + ")");
    }
コード例 #24
0
 /// <summary>
 /// METHOD: Inject, injects the ImageManipulator into the image data
 /// </summary>
 /// <param name="pImgMan"></param>
 public void Inject(IImageManipulator pImgMan)
 {
     // SET imageManipulator in this class
     // to the image manipulator passed in
     _imgMan = pImgMan;
 }
コード例 #25
0
 public override void SetUp()
 {
     base.SetUp();
     _imageLayoutBuilder = new ImageLayoutBuilder();
     _ImageManipulator = new NoodleImageManipulator(_imageLayoutBuilder);
 }