Package ae.java.awt.image

Examples of ae.java.awt.image.DataBufferUShort


        this.maxY = minY + height;
        if (!(dataBuffer instanceof DataBufferUShort)) {
           throw new RasterFormatException("ShortBandedRaster must have " +
                "ushort DataBuffers");
        }
        DataBufferUShort dbus = (DataBufferUShort)dataBuffer;

        if (sampleModel instanceof BandedSampleModel) {
            BandedSampleModel bsm = (BandedSampleModel)sampleModel;
            this.scanlineStride = bsm.getScanlineStride();
            int bankIndices[] = bsm.getBankIndices();
            int bandOffsets[] = bsm.getBandOffsets();
            int dOffsets[] = dbus.getOffsets();
            dataOffsets = new int[bankIndices.length];
            data = new short[bankIndices.length][];
            int xOffset = aRegion.x - origin.x;
            int yOffset = aRegion.y - origin.y;
            for (int i = 0; i < bankIndices.length; i++) {
View Full Code Here


                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
                                                 origin);
        } else {
            dataBuffer = new DataBufferUShort(height*scanlineStride);
            ras = Raster.createInterleavedRaster(dataBuffer,
                                                 width, height,
                                                 scanlineStride,
                                                 bands,
                                                 bandOffsets[bands],
View Full Code Here

        if(!(dataBuffer instanceof DataBufferUShort)) {
            throw new RasterFormatException("ShortInterleavedRasters must "+
                                            "have ushort DataBuffers");
        }

        DataBufferUShort dbus = (DataBufferUShort)dataBuffer;
        this.data = stealData(dbus, 0);

        // REMIND: need case for interleaved ComponentSampleModel
        if ((sampleModel instanceof PixelInterleavedSampleModel) ||
            (sampleModel instanceof ComponentSampleModel &&
             sampleModel.getNumBands() == 1)) {
            ComponentSampleModel csm = (ComponentSampleModel)sampleModel;

            this.scanlineStride = csm.getScanlineStride();
            this.pixelStride = csm.getPixelStride();
            this.dataOffsets = csm.getBandOffsets();
            int xOffset = aRegion.x - origin.x;
            int yOffset = aRegion.y - origin.y;
            for (int i = 0; i < getNumDataElements(); i++) {
                dataOffsets[i] += xOffset*pixelStride+yOffset*scanlineStride;
            }
        } else if (sampleModel instanceof SinglePixelPackedSampleModel) {
            SinglePixelPackedSampleModel sppsm =
                    (SinglePixelPackedSampleModel)sampleModel;
            this.scanlineStride = sppsm.getScanlineStride();
            this.pixelStride    = 1;
            this.dataOffsets = new int[1];
            this.dataOffsets[0] = dbus.getOffset();
            int xOffset = aRegion.x - origin.x;
            int yOffset = aRegion.y - origin.y;
            dataOffsets[0] += xOffset+yOffset*scanlineStride;
        } else {
            throw new RasterFormatException("ShortInterleavedRasters must "+
View Full Code Here

        if(!(dataBuffer instanceof DataBufferUShort)) {
            throw new RasterFormatException("ShortComponentRasters must have "+
                                            "short DataBuffers");
        }

        DataBufferUShort dbus = (DataBufferUShort)dataBuffer;
        this.data = stealData(dbus, 0);
        if (dbus.getNumBanks() != 1) {
            throw new
                RasterFormatException("DataBuffer for ShortComponentRasters"+
                                      " must only have 1 bank.");
        }
        int dbOffset = dbus.getOffset();

        if (sampleModel instanceof ComponentSampleModel) {
            ComponentSampleModel csm = (ComponentSampleModel)sampleModel;
            this.type = IntegerComponentRaster.TYPE_USHORT_SAMPLES;
            this.scanlineStride = csm.getScanlineStride();
View Full Code Here

TOP

Related Classes of ae.java.awt.image.DataBufferUShort

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.