コード例 #1
0
 public Int(IntegerInterleavedRaster srcRas, ColorModel cm, AffineTransform xform, int maxw, bool filter) : base(cm, xform, srcRas.Width, srcRas.Height, maxw)
 {
     this.SrcRas = srcRas;
     this.InData = srcRas.DataStorage;
     this.InSpan = srcRas.ScanlineStride;
     this.InOff  = srcRas.getDataOffset(0);
     this.Filter = filter;
 }
コード例 #2
0
            public override WritableRaster MakeRaster(int w, int h)
            {
                WritableRaster           ras   = MakeRaster(ColorModel_Renamed, SrcRas, w, h);
                IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster)ras;

                OutData = iiRas.DataStorage;
                OutSpan = iiRas.ScanlineStride;
                OutOff  = iiRas.getDataOffset(0);
                return(ras);
            }
コード例 #3
0
            public override WritableRaster MakeRaster(int w, int h)
            {
                // Note that we do not pass srcRas to makeRaster since it
                // is a Byte Raster and this colorModel needs an Int Raster
                WritableRaster           ras   = MakeRaster(ColorModel_Renamed, null, w, h);
                IntegerInterleavedRaster iiRas = (IntegerInterleavedRaster)ras;

                OutData = iiRas.DataStorage;
                OutSpan = iiRas.ScanlineStride;
                OutOff  = iiRas.getDataOffset(0);
                return(ras);
            }
コード例 #4
0
        public static PaintContext GetContext(BufferedImage bufImg, AffineTransform xform, RenderingHints hints, Rectangle devBounds)
        {
            WritableRaster raster = bufImg.Raster;
            ColorModel     cm     = bufImg.ColorModel;
            int            maxw   = devBounds.Width_Renamed;
            Object         val    = hints[RenderingHints.KEY_INTERPOLATION];
            bool           filter = (val == null ? (hints[RenderingHints.KEY_RENDERING] == RenderingHints.VALUE_RENDER_QUALITY) : (val != RenderingHints.VALUE_INTERPOLATION_NEAREST_NEIGHBOR));

            if (raster is IntegerInterleavedRaster && (!filter || IsFilterableDCM(cm)))
            {
                IntegerInterleavedRaster iir = (IntegerInterleavedRaster)raster;
                if (iir.NumDataElements == 1 && iir.PixelStride == 1)
                {
                    return(new Int(iir, cm, xform, maxw, filter));
                }
            }
            else if (raster is ByteInterleavedRaster)
            {
                ByteInterleavedRaster bir = (ByteInterleavedRaster)raster;
                if (bir.NumDataElements == 1 && bir.PixelStride == 1)
                {
                    if (filter)
                    {
                        if (IsFilterableICM(cm))
                        {
                            return(new ByteFilter(bir, cm, xform, maxw));
                        }
                    }
                    else
                    {
                        return(new Byte(bir, cm, xform, maxw));
                    }
                }
            }
            return(new Any(raster, cm, xform, maxw, filter));
        }