Public Member Functions | Protected Attributes | Static Protected Attributes
CNCSJPCVilIOStream Class Reference

Wrapper class that allows you to effectively "convert" a vil_stream to a CNCSJPCIOStream. More...

#include <NCSJPCVilIOStream.h>

List of all members.

Public Member Functions

 CNCSJPCVilIOStream ()
 ~CNCSJPCVilIOStream ()
virtual CNCSError Open (vil_stream *stream, bool bWrite=false)
 Pass me the stream you want me to wrap.
virtual CNCSError Close ()
virtual bool NCS_FASTCALL Seek ()
virtual bool NCS_FASTCALL Seek (INT64 offset, Origin origin=CURRENT)
virtual INT64 NCS_FASTCALL Tell ()
virtual INT64 NCS_FASTCALL Size ()
virtual bool NCS_FASTCALL Read (void *buffer, UINT32 count)
virtual bool NCS_FASTCALL Write (void *buffer, UINT32 count)

Protected Attributes

vil_streammVilStream
 The stream I get all my data from (and write too)
vil_streampos mHomePos
 This position is my home position (ie.

Static Protected Attributes

static unsigned short mId = 0

Detailed Description

Wrapper class that allows you to effectively "convert" a vil_stream to a CNCSJPCIOStream.

This class is used by vil_j2k_image to read JPEG 2000 imagery. A couple of notes: 1) This stream's home position (ie. the place it goes when you call Seek(0,START), is the current position of the stream that is passed to Open() at the time of that call.

See also:
Open() for more info.

Known Issues: 1) As of 2/24/05, the writing capability of this class has not been tested. In theory it should work just fine though.

2) It is necessary to provide a unique string name to an open CNCSJPCIO stream. The original code always used the same name "VIL". The result is that all resources access the same J2K data, since the ecw library accesses streams by name. Only one stream with the same name can exist, which is the first one opened with that name. The fix is to provide a unique name, based on a static unsigned short integer that is maintained and appended to the stream name prefix. JLM April 13, 2009

Definition at line 35 of file NCSJPCVilIOStream.h.


Constructor & Destructor Documentation

CNCSJPCVilIOStream::CNCSJPCVilIOStream ( )

Definition at line 18 of file NCSJPCVilIOStream.cxx.

CNCSJPCVilIOStream::~CNCSJPCVilIOStream ( )

Definition at line 24 of file NCSJPCVilIOStream.cxx.


Member Function Documentation

CNCSError CNCSJPCVilIOStream::Close ( ) [virtual]

Definition at line 46 of file NCSJPCVilIOStream.cxx.

CNCSError CNCSJPCVilIOStream::Open ( vil_stream stream,
bool  bWrite = false 
) [virtual]

Pass me the stream you want me to wrap.

stream->tell() at the time of this function call will become my home position. see

See also:
mHomePos for more details on what that means.

Definition at line 27 of file NCSJPCVilIOStream.cxx.

bool NCS_FASTCALL CNCSJPCVilIOStream::Read ( void *  buffer,
UINT32  count 
) [virtual]

Definition at line 112 of file NCSJPCVilIOStream.cxx.

bool CNCSJPCVilIOStream::Seek ( ) [virtual]

Definition at line 59 of file NCSJPCVilIOStream.cxx.

bool CNCSJPCVilIOStream::Seek ( INT64  offset,
Origin  origin = CURRENT 
) [virtual]

Definition at line 64 of file NCSJPCVilIOStream.cxx.

INT64 NCS_FASTCALL CNCSJPCVilIOStream::Size ( ) [virtual]

Definition at line 107 of file NCSJPCVilIOStream.cxx.

INT64 NCS_FASTCALL CNCSJPCVilIOStream::Tell ( ) [virtual]

Definition at line 102 of file NCSJPCVilIOStream.cxx.

bool NCS_FASTCALL CNCSJPCVilIOStream::Write ( void *  buffer,
UINT32  count 
) [virtual]

Definition at line 122 of file NCSJPCVilIOStream.cxx.


Member Data Documentation

This position is my home position (ie.

mVilStream->tell() when it was passed into me). All Seek()'s with an origin of START will be relative to me. Tell() is the position relative to this position etc.

Definition at line 72 of file NCSJPCVilIOStream.h.

unsigned short CNCSJPCVilIOStream::mId = 0 [static, protected]

Definition at line 74 of file NCSJPCVilIOStream.h.

The stream I get all my data from (and write too)

Definition at line 66 of file NCSJPCVilIOStream.h.


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