PCIDSK::PCIDSKChannel Class Reference

Interface to one PCIDSK channel (band) or bitmap segment. More...

#include <pcidsk_channel.h>

List of all members.

Public Member Functions

virtual int GetBlockWidth () const=0
 Fetch image block width.
virtual int GetBlockHeight () const=0
 Fetch image block height.
virtual int GetBlockCount () const=0
 Fetch image block count.
virtual int GetWidth () const=0
 Fetch image width.
virtual int GetHeight () const=0
 Fetch image height.
virtual eChanType GetType () const=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 bool IsOverviewValid (int i)=0
virtual std::string GetOverviewResampling (int i)=0
virtual void SetOverviewValidity (int i, bool validity)=0
virtual std::vector< int > GetOverviewLevelMapping () const=0
 Get mapping between overview indices and overview levels.
virtual std::string GetMetadataValue (const std::string &key) const =0
virtual void SetMetadataValue (const std::string &key, const std::string &value)=0
 Set metadata value.
virtual std::vector< std::string > GetMetadataKeys () const=0
virtual void Synchronize ()=0
 Write pending information to disk.
virtual std::string GetDescription ()=0
 Fetch channel description.
virtual void SetDescription (const std::string &description)=0
 Set channel description.
virtual std::vector< std::string > GetHistoryEntries () const=0
 fetch history records
virtual void SetHistoryEntries (const std::vector< std::string > &entries)=0
 Set all history records.
virtual void PushHistory (const std::string &app, const std::string &message)=0
 Push a new history message.


Detailed Description

Interface to one PCIDSK channel (band) or bitmap segment.


Member Function Documentation

int PCIDSK::PCIDSKChannel::GetBlockWidth (  )  const [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::GetBlockHeight (  )  const [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::GetBlockCount (  )  const [pure virtual]

Fetch image block count.

Returns:
returns the number of blocks in a channel.

int PCIDSK::PCIDSKChannel::GetWidth ( void   )  const [pure virtual]

Fetch image width.

Returns:
returns the channel width in pixels.

int PCIDSK::PCIDSKChannel::GetHeight ( void   )  const [pure virtual]

Fetch image height.

Returns:
returns the channel height in pixels.

eChanType PCIDSK::PCIDSKChannel::GetType (  )  const [pure virtual]

Fetch pixel data type.

Returns:
the pixel data type for this channel.

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.

Bitmap segment access is also handled via the PCIDSKChannel interface, and the buffer contains eight pixels packed into each byte which the first pixel in the high order bit (0x80) of the first byte. Note that DataTypeSize() does not return an accurate size for bit buffers.

Parameters:
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.

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_index zero based block index to read.
buffer the buffer from which the block will be written.

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

Fetch number of overviews.

Returns:
the number of overviews available for this channel.
See also:
GetOverview()

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:
i the zero based index of the overview to fetch (from zero to GetOverviewCount()-1)
Returns:
the overview channel object.

std::vector< int > PCIDSK::PCIDSKChannel::GetOverviewLevelMapping (  )  const [pure virtual]

Get mapping between overview indices and overview levels.

This method will return a vector representing a mapping between an overview index, used with the PCIDSK::PCIDSKChannel::GetOverview method.

Note:
The overview levels may not be sorted when retrieved via this mechanism.
Returns:
a vector, where the index of the entry maps to the overview index.

void PCIDSK::PCIDSKChannel::SetMetadataValue ( const std::string &  key,
const 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:
key the key to fetch the value for.
value the 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.

std::string PCIDSK::PCIDSKChannel::GetDescription (  )  [pure virtual]

Fetch channel description.

Returns:
Returns the contents of the IHi.1 field for the channel, with trailing spaces stripped.

void PCIDSK::PCIDSKChannel::SetDescription ( const std::string &  description  )  [pure virtual]

Set channel description.

Parameters:
description a string of up to 64 characters.

std::vector< std::string > PCIDSK::PCIDSKChannel::GetHistoryEntries (  )  const [pure virtual]

fetch history records

Returns:
a vector of the 8 history records for this channel.

void PCIDSK::PCIDSKChannel::SetHistoryEntries ( const std::vector< std::string > &  entries  )  [pure virtual]

Set all history records.

Normally applications will just use the PushHistory() method. This method is used for bulk copying of history for special situations.

Parameters:
entries - should be a vector of 8 strings of at most 80 characters.

void PCIDSK::PCIDSKChannel::PushHistory ( const std::string &  app,
const std::string &  message 
) [pure virtual]

Push a new history message.

This method will push a new history message at the front of the history stack. The top seven history messages will be pushed down one to make space and the last one will be lost. The current date is automatically appended to the message.

Parameters:
app the application name, only 7 characters are used.
message the history message, only 56 characters are used.


The documentation for this class was generated from the following files:
Generated on Fri Jul 16 16:01:31 2010 for libpcidsk by  doxygen 1.5.1