rdf4j-postgis  Version 0.1.0.0
WKBRasterImageReader Class Reference

Draft java api image reader for WKB, used in postGIS 2 but can be used elsewhere. More...

Inheritance diagram for WKBRasterImageReader:
Collaboration diagram for WKBRasterImageReader:

Classes

class  InputStreamAdapter
 
class  Spi
 

Public Member Functions

 WKBRasterImageReader (ImageReaderSpi spi)
 
int getNumImages (boolean allowSearch) throws IOException
 
int getWidth (int imageIndex) throws IOException
 
int getHeight (int imageIndex) throws IOException
 
Iterator< ImageTypeSpecifier > getImageTypes (int imageIndex) throws IOException
 
IIOMetadata getStreamMetadata () throws IOException
 
IIOMetadata getImageMetadata (int imageIndex) throws IOException
 
BufferedImage read (int imageIndex, ImageReadParam param) throws IOException
 

Detailed Description

Draft java api image reader for WKB, used in postGIS 2 but can be used elsewhere.

Author
Johann Sorel (Geomatys)

Constructor & Destructor Documentation

◆ WKBRasterImageReader()

WKBRasterImageReader ( ImageReaderSpi  spi)
44  {
45  super(spi);
46  }

Referenced by WKBRasterImageReader.Spi.createReaderInstance().

Member Function Documentation

◆ getHeight()

int getHeight ( int  imageIndex) throws IOException
59  {
60  throw new UnsupportedOperationException("Not supported yet.");
61  }

◆ getImageMetadata()

IIOMetadata getImageMetadata ( int  imageIndex) throws IOException
74  {
75  throw new UnsupportedOperationException("Not supported yet.");
76  }

◆ getImageTypes()

Iterator<ImageTypeSpecifier> getImageTypes ( int  imageIndex) throws IOException
64  {
65  throw new UnsupportedOperationException("Not supported yet.");
66  }

◆ getNumImages()

int getNumImages ( boolean  allowSearch) throws IOException
49  {
50  return 1;
51  }

◆ getStreamMetadata()

IIOMetadata getStreamMetadata ( ) throws IOException
69  {
70  throw new UnsupportedOperationException("Not supported yet.");
71  }

◆ getWidth()

int getWidth ( int  imageIndex) throws IOException
54  {
55  throw new UnsupportedOperationException("Not supported yet.");
56  }

◆ read()

BufferedImage read ( int  imageIndex,
ImageReadParam  param 
) throws IOException
79  {
80  final WKBRasterReader reader = new WKBRasterReader();
81  if(input instanceof byte[]){
82  return reader.read((byte[])input);
83  }else if(input instanceof ImageInputStream){
84  return reader.read(new InputStreamAdapter((ImageInputStream)input));
85  }else{
86  InputStream stream;
87  if(input instanceof InputStream){
88  stream = (InputStream) input;
89  }else{
90  stream = org.apache.sis.internal.storage.io.IOUtilities.toInputStream((AutoCloseable) input);
91  stream = new BufferedInputStream(stream);
92  }
93  final BufferedImage image = reader.read(stream);
94  stream.close();
95  return image;
96  }
97  }

References WKBRasterReader.read().