Package it.geosolutions.imageioimpl.plugins.tiff

Examples of it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi


    }

    @Test
    public void testJAIReadType() throws IOException {
        // Definition of the reader
        ImageReader reader = new TIFFImageReaderSpi().createReaderInstance();
        FileImageInputStream in = new FileImageInputStream(DataUtilities.urlToFile(granuleUrl));

        try {
            reader.setInput(in);
View Full Code Here


    }

    @Test
    public void testDirectReadType() throws IOException {
        // Definition of the reader
        ImageReader reader = new TIFFImageReaderSpi().createReaderInstance();
        FileImageInputStream in = new FileImageInputStream(DataUtilities.urlToFile(granuleUrl));

        try {
            reader.setInput(in);
            // Definition of the read type
View Full Code Here

     */
  private void getGeoJP2(final UUIDBoxMetadataNode uuid) throws IOException {
   
     CoordinateReferenceSystem coordinateReferenceSystem = null;
     final ByteArrayInputStream inputStream = new ByteArrayInputStream(uuid.getData());
         final TIFFImageReader tiffreader = (TIFFImageReader) new TIFFImageReaderSpi().createReaderInstance();
         tiffreader.setInput(ImageIO.createImageInputStream(inputStream));
         final IIOMetadata tiffmetadata = tiffreader.getImageMetadata(0);
         try {
            final GeoTiffIIOMetadataDecoder metadataDecoder = new GeoTiffIIOMetadataDecoder(tiffmetadata);
            final GeoTiffMetadata2CRSAdapter adapter = new GeoTiffMetadata2CRSAdapter(hints);
View Full Code Here

    }
  }
 
  @Test
  public void testArtifact() throws IOException{
    TIFFImageReaderSpi spi = new TIFFImageReaderSpi();
    File file = TestData.file(this, "filter.tif");
    ImageReader reader = null;
    FileImageInputStream fis = null;
    try {
      fis = new FileImageInputStream(file);
      reader = spi.createReaderInstance();
      reader.setInput(fis);
      RenderedImage image = reader.read(0);
      RenderedOp histogramOp = HistogramDescriptor.create(image, null, Integer.valueOf(1), Integer.valueOf(1), new int[]{256}, null, null, null);
      Histogram histogram = (Histogram) histogramOp.getProperty("histogram");
      int[][] bins = histogram.getBins();
View Full Code Here

    private static GridCoverage2D readInputFile(String filename) throws FileNotFoundException,
            IOException {
        final File tiff = TestData.file(MosaicTest.class, filename + ".tif");
        final File tfw = TestData.file(MosaicTest.class, filename + ".tfw");

        final TIFFImageReader reader = (it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader) new TIFFImageReaderSpi()
                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        final MathTransform transform = new WorldFileReader(tfw).getTransform();
        final GridCoverage2D coverage2D = CoverageFactoryFinder.getGridCoverageFactory(null)
View Full Code Here

    @Test
    public void testPolygonZoneGlobalStats() throws Exception {
        final File tiff = TestData.file(this, "test.tif");
        final File tfw = TestData.file(this, "test.tfw");

        final TIFFImageReader reader = (it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader) new TIFFImageReaderSpi()
                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        reader.dispose();
View Full Code Here

    @Test
    public void testPolygonZoneLocalStats() throws Exception {
        final File tiff = TestData.file(this, "test.tif");
        final File tfw = TestData.file(this, "test.tfw");

        final TIFFImageReader reader = (it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader) new TIFFImageReaderSpi()
                .createReaderInstance();
        reader.setInput(ImageIO.createImageInputStream(tiff));
        final BufferedImage image = reader.read(0);
        reader.dispose();
View Full Code Here

                    .getFeatures();

            // build the DataFile
            final File tiff = TestData.file(this, "test.tif");
            final File tfw = TestData.file(this, "test.tfw");
            reader = (it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReader) new TIFFImageReaderSpi()
                    .createReaderInstance();
            assertNotNull(reader);
            reader.setInput(ImageIO.createImageInputStream(tiff));
            final BufferedImage image = reader.read(0);
View Full Code Here

        // and the palette does not get compressed
        InputStream gzippedStream = ImageWorkerTest.class.getResource("test-data/sf-sfdem.tif.gz").openStream();
        GZIPInputStream is = new GZIPInputStream(gzippedStream);
        try {
            ImageInputStream iis = ImageIO.createImageInputStream(is);
            ImageReader reader = new TIFFImageReaderSpi().createReaderInstance(iis);
            reader.setInput(iis);
            BufferedImage bi = reader.read(0);
            if(TestData.isInteractiveTest()){
                ImageIOUtilities.visualize(bi,"before");
            }
View Full Code Here

        // and the palette does not get compressed
        InputStream gzippedStream = ImageWorkerTest.class.getResource("test-data/sf-sfdem.tif.gz").openStream();
        GZIPInputStream is = new GZIPInputStream(gzippedStream);
        try {
            ImageInputStream iis = ImageIO.createImageInputStream(is);
            ImageReader reader = new TIFFImageReaderSpi().createReaderInstance(iis);
            reader.setInput(iis);
            BufferedImage bi = reader.read(0);
            reader.dispose();
            iis.close();
            IndexColorModel icm = (IndexColorModel) bi.getColorModel();
View Full Code Here

TOP

Related Classes of it.geosolutions.imageioimpl.plugins.tiff.TIFFImageReaderSpi

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.