Interface to one PCIDSK channel (band). More...
#include <pcidsk_channel.h>
Public Member Functions | |
virtual int | GetBlockWidth ()=0 |
Fetch image block width. | |
virtual int | GetBlockHeight ()=0 |
Fetch image block height. | |
virtual int | GetBlockCount ()=0 |
Fetch image block count. | |
virtual int | GetWidth ()=0 |
Fetch image width. | |
virtual int | GetHeight ()=0 |
Fetch image height. | |
virtual eChanType | GetType ()=0 |
Fetch pixel data type. | |
virtual int | ReadBlock (int block_index, void *buffer, int win_xoff=-1, int win_yoff=-1, int win_xsize=-1, int win_ysize=-1)=0 |
read block of image data from disk. | |
virtual int | WriteBlock (int block_index, void *buffer)=0 |
write block of image data from disk. | |
virtual int | GetOverviewCount ()=0 |
Fetch number of overviews. | |
virtual PCIDSKChannel * | GetOverview (int i)=0 |
Fetch Overview. | |
virtual std::string | GetMetadataValue (std::string key)=0 |
Fetch metadata value. | |
virtual void | SetMetadataValue (std::string key, std::string value)=0 |
Set metadata value. | |
virtual std::vector< std::string > | GetMetadataKeys ()=0 |
Fetch metadata keys. | |
virtual void | Synchronize ()=0 |
Write pending information to disk. |
Interface to one PCIDSK channel (band).
int PCIDSK::PCIDSKChannel::GetBlockCount | ( | ) | [pure virtual] |
Fetch image block count.
int PCIDSK::PCIDSKChannel::GetBlockHeight | ( | ) | [pure virtual] |
Fetch image block height.
Channel (band) access is done in blocks according to the natural blocking of the data. For PIXEL, BAND and some FILE interleaved files a block is one scanline. For tiled files it is a tile.
int PCIDSK::PCIDSKChannel::GetBlockWidth | ( | ) | [pure virtual] |
Fetch image block width.
Channel (band) access is done in blocks according to the natural blocking of the data. For PIXEL, BAND and some FILE interleaved files a block is one scanline. For tiled files it is a tile.
int PCIDSK::PCIDSKChannel::GetHeight | ( | ) | [pure virtual] |
Fetch image height.
std::vector< std::string > PCIDSK::PCIDSKChannel::GetMetadataKeys | ( | ) | [pure virtual] |
Fetch metadata keys.
Returns a vector of metadata keys that occur on this object. The values associated with each may be fetched with GetMetadataValue().
std::string PCIDSK::PCIDSKChannel::GetMetadataValue | ( | std::string | key | ) | [pure virtual] |
Fetch metadata value.
Note that the returned pointer is to an internal structure and it may become invalid if another thread modifies the metadata for this object.
key | the key to fetch the value for. |
PCIDSK::PCIDSKChannel * PCIDSK::PCIDSKChannel::GetOverview | ( | int | i | ) | [pure virtual] |
Fetch Overview.
This method fetches a pointer to the requested overview. The return PCIDSKChannel object remains owned by the parent PCIDSKChannel but may be otherwise accessed using the normal PCIDSKChannel mechanisms. The size of the overview in pixels and lines will reveal it's decimation factor relative to the base image.
i | the zero based index of the overview to fetch (from zero to GetOverviewCount()-1) |
int PCIDSK::PCIDSKChannel::GetOverviewCount | ( | ) | [pure virtual] |
Fetch number of overviews.
eChanType PCIDSK::PCIDSKChannel::GetType | ( | ) | [pure virtual] |
Fetch pixel data type.
int PCIDSK::PCIDSKChannel::GetWidth | ( | ) | [pure virtual] |
Fetch image width.
int PCIDSK::PCIDSKChannel::ReadBlock | ( | int | block_index, | |
void * | buffer, | |||
int | win_xoff = -1 , |
|||
int | win_yoff = -1 , |
|||
int | win_xsize = -1 , |
|||
int | win_ysize = -1 | |||
) | [pure virtual] |
read block of image data from disk.
The buffer into which imagery is read should be preallocated large enough to hold GetBlockWidth() * GetBlockHeight() * DataTypeSize(GetType()) bytes, or win_xsize*win_ysize*DataType(GetType()) if subwindowing is being used. Image data is returned in the pixel data type reported by GetType() and in the local systems byte order (for types larger than one byte).
For scanline oriented images the block index is the scanline index. For tiled images the block_index starts at 0 at the top left tile. The tile to the right of that is 1, and the first tile in the second row is equal to "blocks_per_row".
Partial (incomplete) blocks at the right or bottom of images that are not a multiple of the block width or height in size will be zero filled out to the block size.
The win_xoff, win_yoff, win_xsize, and win_ysize parameters may be used to select a subwindow of the desired block. By default the whole block is returned.
block_index | zero based block index to read. | |
buffer | the buffer into which the block will be read. | |
win_xoff | the x (right) offset into the block to start reading. | |
win_yoff | the y (down) offset into the block to start reading. | |
win_xsize | the width of the window to read from the block. | |
win_ysize | the height of the window to read from the block. |
void PCIDSK::PCIDSKChannel::SetMetadataValue | ( | std::string | key, | |
std::string | value | |||
) | [pure virtual] |
Set metadata value.
Assign the metadata value associated with the passed key on this object. The file needs to be open for update. Note that keys should be well formed tokens (no special characters, spaces, etc).
key | the key to fetch the value for. | |
value | the value to assign to the key. An empty string deletes the item. |
void PCIDSK::PCIDSKChannel::Synchronize | ( | ) | [pure virtual] |
Write pending information to disk.
Some write and update operations on PCIDSK files are not written to disk immediately after write calls. This method will ensure that any pending writes are flushed through to disk.
NOTE: Currently this method does not invalidate read-cached information. At some point in the future it might be extended to do this as well.
int PCIDSK::PCIDSKChannel::WriteBlock | ( | int | block_index, | |
void * | buffer | |||
) | [pure virtual] |
write block of image data from disk.
The buffer from which imagery is read should be preallocated large enough to hold GetBlockWidth() * GetBlockHeight() * DataTypeSize(GetType()) bytes. Image data is expected in the pixel data type reported by GetType() and in the local systems byte order (for types larger than one byte).
For scanline oriented images the block index is the scanline index. For tiled images the block_index starts at 0 at the top left tile. The tile to the right of that is 1, and the first tile in the second row is equal to "blocks_per_row".
Partial (incomplete) blocks at the right or bottom of images that are not a multiple of the block width or height in size may be zero filled out to the block size.
block_index | zero based block index to read. | |
buffer | the buffer from which the block will be written. |