コード例 #1
0
ファイル: ImageResizer.cs プロジェクト: Genteure/GPUCyclops
        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)));
        }
コード例 #2
0
ファイル: ImageResizer.cs プロジェクト: ctapang/GPUCyclops
        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));
        }