libpcidsk
Public Member Functions
PCIDSK::PCIDSKChannel Class Reference

Interface to one PCIDSK channel (band). More...

#include <pcidsk_channel.h>

List of all members.

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 PCIDSKChannelGetOverview (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.

Detailed Description

Interface to one PCIDSK channel (band).


Member Function Documentation

int PCIDSK::PCIDSKChannel::GetBlockCount ( ) [pure virtual]

Fetch image block count.

Returns:
returns the number of blocks in a channel.
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.

Returns:
returns the height of a block in pixels.
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.

Returns:
returns the width of a block in pixels.
int PCIDSK::PCIDSKChannel::GetHeight ( ) [pure virtual]

Fetch image height.

Returns:
returns the channel height in pixels.
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().

Returns:
list of keys
See also:
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.

Parameters:
keythe key to fetch the value for.
Returns:
the value of the indicated metadata item, or an empty string if it does not exist on the target object.
See also:
GetMetadataKeys()
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.

Parameters:
ithe zero based index of the overview to fetch (from zero to GetOverviewCount()-1)
Returns:
the overview channel object.
int PCIDSK::PCIDSKChannel::GetOverviewCount ( ) [pure virtual]

Fetch number of overviews.

Returns:
the number of overviews available for this channel.
See also:
GetOverview()
eChanType PCIDSK::PCIDSKChannel::GetType ( ) [pure virtual]

Fetch pixel data type.

Returns:
the pixel data type for this channel.
int PCIDSK::PCIDSKChannel::GetWidth ( ) [pure virtual]

Fetch image width.

Returns:
returns the channel width in pixels.
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.

Parameters:
block_indexzero based block index to read.
bufferthe buffer into which the block will be read.
win_xoffthe x (right) offset into the block to start reading.
win_yoffthe y (down) offset into the block to start reading.
win_xsizethe width of the window to read from the block.
win_ysizethe 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).

Parameters:
keythe key to fetch the value for.
valuethe value to assign to the key. An empty string deletes the item.
See also:
GetMetadataValue()
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.

Parameters:
block_indexzero based block index to read.
bufferthe buffer from which the block will be written.

The documentation for this class was generated from the following files:

Generated for GDAL by doxygen 1.7.4.