Code example for ImageTypeSpecifier

Methods: getColorModelgetSampleModel

0
 
        Utilities.ensureNonNull("reader", reader);
        // save ImageLayout 
        ImageLayout2 layout = new ImageLayout2();
        ImageTypeSpecifier its = reader.getImageTypes(0).next();
        layout.setColorModel(its.getColorModel()).setSampleModel(its.getSampleModel());
        layout.setMinX(0).setMinY(0).setWidth(reader.getWidth(0)).setHeight(reader.getHeight(0));
        layout.setTileGridXOffset(0).setTileGridYOffset(0).setTileWidth(reader.getTileWidth(0))
                .setTileHeight(reader.getTileHeight(0));
        setlayout(layout);
    } 
 
    /** 
     * Set the provided layout for this {@link GridCoverage2DReader}- 
     *  
     * @param layout the {@link ImageLayout} to set. It must be nont null 
     */ 
    protected void setlayout(ImageLayout layout) {
        Utilities.ensureNonNull("layout", layout);
        this.imageLayout = (ImageLayout) layout.clone();