Beispiel #1
0
        public FJImage Resize(double scale, ResamplingFilters technique)
        {
            int height = (int)(scale * _input.Height);
            int width  = (int)(scale * _input.Width);

            Filter resizeFilter;

            switch (technique)
            {
            case ResamplingFilters.NearestNeighbor:
                resizeFilter = new NNResize();
                break;

            case ResamplingFilters.LowpassAntiAlias:
                resizeFilter = new LowpassResize();
                break;

            default:
                throw new NotSupportedException();
            }

            return(new FJImage(_input.ColorModel, resizeFilter.Apply(_input.Raster, width, height)));
        }
Beispiel #2
0
        public FJImage Resize(double scale, ResamplingFilters technique)
        {
            int height = (int)(scale * _input.Height);
            int width = (int)(scale * _input.Width);

            Filter resizeFilter;

            switch (technique)
            {
                case ResamplingFilters.NearestNeighbor:
                    resizeFilter = new NNResize();
                    break;
                case ResamplingFilters.LowpassAntiAlias:
                    resizeFilter = new LowpassResize();
                    break;
                default:
                    throw new NotSupportedException();
            }

                        return new FJImage(_input.ColorModel, resizeFilter.Apply(_input.Raster, width, height));
        }