Package java.awt.image

Examples of java.awt.image.RasterFormatException


    public boolean nextLineDone() {
        boolean check = src.nextLineDone();
        if (check == dst.nextLineDone()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here


    public boolean nextPixelDone() {
        boolean check = src.nextPixelDone();
        if (check == dst.nextPixelDone()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here

    public boolean nextBandDone() {
        boolean check = src.nextBandDone();
        if (check == dst.nextBandDone()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here

    public boolean finishedLines() {
        boolean check = src.finishedLines();
        if (check == dst.finishedLines()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here

    public boolean finishedPixels() {
        boolean check = src.finishedPixels();
        if (check == dst.finishedPixels()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here

    public boolean finishedBands() {
        boolean check = src.finishedBands();
        if (check == dst.finishedBands()) {
            return check;
        }
        throw new RasterFormatException(ERROR);
    }
View Full Code Here

        try {
            inverse.transform(destRect, 0, destRect, 0, count);
        } catch (TransformException exception) {
            // At least one transformation failed. In Geotools MapProjection
            // implementation, unprojected coordinates are set to (NaN,NaN).
            RasterFormatException e = new RasterFormatException(Errors.format(
                            ErrorKeys.CANT_REPROJECT_$1, name));
            e.initCause(exception);
            throw e;
        }
        while (--index >= 0) {
            destRect[index] -= 0.5f;
        }
View Full Code Here

    {
        super(image, (ImageLayout)hints.get(JAI.KEY_IMAGE_LAYOUT), hints, false);
        this.categories = categories;
        if (categories.length != image.getSampleModel().getNumBands()) {
            // Should not happen, since SampleDimension$Descriptor has already checked it.
            throw new RasterFormatException(String.valueOf(categories.length));
        }
        permitInPlaceOperation();
    }
View Full Code Here

                }
                while (!iterator.nextPixelDone());
            }
            while (!iterator.nextLineDone());
        } catch (TransformException cause) {
            RasterFormatException exception = new RasterFormatException(Errors.format(
                    ErrorKeys.BAD_TRANSFORM_$1, Classes.getClass(tr)));
            exception.initCause(cause);
            throw exception;
        }
    }
View Full Code Here

        super(sampleModel, dataBuffer, aRegion, origin, parent);
        this.maxX = minX + width;
        this.maxY = minY + height;

        if (!(dataBuffer instanceof DataBufferByte)) {
            throw new RasterFormatException("ByteComponentRasters must have " +
                                            "byte DataBuffers");
        }

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

        if (sampleModel instanceof ComponentSampleModel) {
            ComponentSampleModel ism = (ComponentSampleModel)sampleModel;
            this.type = IntegerComponentRaster.TYPE_BYTE_SAMPLES;
            this.scanlineStride = ism.getScanlineStride();
            this.pixelStride = ism.getPixelStride();
            this.dataOffsets = ism.getBandOffsets();
            int xOffset = aRegion.x - origin.x;
            int yOffset = aRegion.y - origin.y;
            for (int i = 0; i < getNumDataElements(); i++) {
                dataOffsets[i] += dbOffset +
                    xOffset*pixelStride+yOffset*scanlineStride;
            }
        } else if (sampleModel instanceof SinglePixelPackedSampleModel) {
            SinglePixelPackedSampleModel sppsm =
                    (SinglePixelPackedSampleModel)sampleModel;
            this.type = IntegerComponentRaster.TYPE_BYTE_PACKED_SAMPLES;
            this.scanlineStride = sppsm.getScanlineStride();
            this.pixelStride    = 1;
            this.dataOffsets = new int[1];
            this.dataOffsets[0] = dbOffset;
            int xOffset = aRegion.x - origin.x;
            int yOffset = aRegion.y - origin.y;
            dataOffsets[0] += xOffset*pixelStride+yOffset*scanlineStride;
        } else {
            throw new RasterFormatException("IntegerComponentRasters must " +
                "have ComponentSampleModel or SinglePixelPackedSampleModel");
        }
        this.bandOffset = this.dataOffsets[0];

        verify(false);
View Full Code Here

TOP

Related Classes of java.awt.image.RasterFormatException

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.