OpenCMISS-Zinc C++ API Documentation
 All Classes Namespaces Files Functions Typedefs Enumerations Enumerator Pages
Public Types | Public Member Functions | Protected Attributes | List of all members
OpenCMISS::Zinc::Streaminformation Class Reference

Base type listing resources and options for stream I/O. More...

#include <stream.hpp>

Inheritance diagram for OpenCMISS::Zinc::Streaminformation:
OpenCMISS::Zinc::StreaminformationImage OpenCMISS::Zinc::StreaminformationRegion

Public Types

enum  DataCompressionType {
  DATA_COMPRESSION_TYPE_INVALID = CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_INVALID, DATA_COMPRESSION_TYPE_DEFAULT = CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_DEFAULT, DATA_COMPRESSION_TYPE_NONE = CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_NONE, DATA_COMPRESSION_TYPE_GZIP = CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_GZIP,
  DATA_COMPRESSION_TYPE_BZ2 = CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_BZIP2
}
 

Public Member Functions

 Streaminformation (cmzn_streaminformation_id in_streaminformation_id)
 
 Streaminformation (const Streaminformation &streamInformation)
 
Streaminformationoperator= (const Streaminformation &streamInformation)
 
bool isValid () const
 
cmzn_streaminformation_id getId () const
 
StreamresourceFile createStreamresourceFile (const char *file_name)
 
StreamresourceMemory createStreamresourceMemory ()
 
StreamresourceMemory createStreamresourceMemoryBuffer (const void *buffer, unsigned int buffer_length)
 
enum DataCompressionType getResourceDataCompressionType (const Streamresource &resource)
 
int setResourceDataCompressionType (const Streamresource &resource, DataCompressionType dataCompressionType)
 
enum DataCompressionType getDataCompressionType ()
 
int setDataCompressionType (DataCompressionType dataCompressionType)
 
StreaminformationImage castImage ()
 
StreaminformationRegion castRegion ()
 

Protected Attributes

cmzn_streaminformation_id id
 

Detailed Description

Base type listing resources and options for stream I/O.

Base stream information type. The stream information maintains, creates and adds details to streamresources for reading from or writing to external resources. Users can create a type-specific stream information for each object with read and write functionality, currently image fields and region.

See Also
FieldImage::createStreaminformationImage
Region::createStreaminformationRegion

Member Enumeration Documentation

Describes data compression scheme used in a stream resource.

Enumerator
DATA_COMPRESSION_TYPE_INVALID 

Unspecified data compression type

DATA_COMPRESSION_TYPE_DEFAULT 

default data compression This is the default compression for streamresource. When compression type for streamresource is set to default, the DATA_COMPRESSION_TYPE set on the owning streaminformation will be used. This type cannot be set for streaminformation.

DATA_COMPRESSION_TYPE_NONE 

No data compression This is the default compression for streaminformation. This specifies the resource(s) to not have any type of compression.

DATA_COMPRESSION_TYPE_GZIP 

Gzip data compression This specifies the resource(s) is compressed using gzip. This mode is supported in all region resource(s) and analyze image format. Analyze image format expects the resource(s) in a gzip compressed tar containing an analyze header file and analyze image file.

DATA_COMPRESSION_TYPE_BZ2 

Bzip2 data compression This specifies the resource(s) is compressed using bzip2. This mode is supported in all region resource(s)and analyze image format. Analyze image format expects the resource(s) in a bzip2 compressed tar containing analyze header file and analyze image file.

Member Function Documentation

StreaminformationImage OpenCMISS::Zinc::Streaminformation::castImage ( )
inline

If the streaminformation is of image type, then this function returns the derived image stream information handle.

Returns
Handle to derived stream information image, or NULL/invalid handle if wrong type or failed.
StreaminformationRegion OpenCMISS::Zinc::Streaminformation::castRegion ( )
inline

If the streaminformation is of region type, then this function returns the region specific handle.

Returns
Handle to derived stream information region, or NULL/invalid handle if wrong type or failed.
StreamresourceFile OpenCMISS::Zinc::Streaminformation::createStreamresourceFile ( const char *  file_name)
inline

Creates a stream resource of file type with provided file_name. Corresponding read/write functions with the stream information will attempt to read/write file with the same name.

See Also
FieldImage::write
Region::write
FieldImage::read
Region::read
Streamresource::castFile

stream resource.

Parameters
file_namename of a file.
Returns
Handle to new stream resource, or NULL/invalid handle on failure.
StreamresourceMemory OpenCMISS::Zinc::Streaminformation::createStreamresourceMemory ( )
inline

Creates a stream resource of memory type with no memory buffer, the memory buffer storage in this object is reserved for write or export function calls with the stream information in the future. To input an memory buffer for reading please see cmzn_streaminformation_create_streamresource_memory_buffer.

See Also
FieldImage::write
Region::write
FieldImage::read
Region::read
Streamresource::castMemory

stream resource.

Returns
Handle to new stream resource, or NULL/invalid handle on failure.
StreamresourceMemory OpenCMISS::Zinc::Streaminformation::createStreamresourceMemoryBuffer ( const void *  buffer,
unsigned int  buffer_length 
)
inline

Creates a stream resource of memory type for the buffer of the supplied size and at the supplied buffer pointer. The resource can then be read into a Zinc object. This function does not copy the buffer, user is responsible for the lifetime of the buffer. Please make sure the buffer is valid when reading the stream information.

See Also
FieldImage::write
Region::write
FieldImage::read
Region::read
Streamresource::castMemory

stream resource.

Parameters
bufferPointer to the memory buffer
buffer_lengthlength of the buffer
Returns
Handle to new stream resource, or NULL/invalid handle on failure.
enum DataCompressionType OpenCMISS::Zinc::Streaminformation::getDataCompressionType ( )
inline

Get the specified data compression for the stream resources in streaminformation.

Returns
enum for specified data_compression_type for stream resource, CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_INVALID if failed or unset
cmzn_streaminformation_id OpenCMISS::Zinc::Streaminformation::getId ( ) const
inline

Return the C handle of the Streaminformation object.

Returns
C handle of Streaminformation if this objects is valid, 0 otherwise.
enum DataCompressionType OpenCMISS::Zinc::Streaminformation::getResourceDataCompressionType ( const Streamresource resource)
inline

Get the specified data compression for a specified streamresource in streaminformation.

Parameters
resourceHandle to the stream resource.
Returns
enum for specified data_compression_type for stream resource, CMZN_STREAMINFORMATION_DATA_COMPRESSION_TYPE_INVALID if failed or unset
bool OpenCMISS::Zinc::Streaminformation::isValid ( ) const
inline

Check if this is a valid Streaminformation object.

Returns
Status True if object is valid, false otherwise.
int OpenCMISS::Zinc::Streaminformation::setDataCompressionType ( DataCompressionType  dataCompressionType)
inline

Specify the data compression of the streamresource in the streaminformation.

Parameters
dataCompressionTypeenum to indicate the compression used in the resources in the streaminformation
Returns
status OpenCMISS::Zinc::OK if data compression successfully set, any other value if failed or data_compression_type type is not valid or unable to be set for this cmzn_streaminformation.
int OpenCMISS::Zinc::Streaminformation::setResourceDataCompressionType ( const Streamresource resource,
DataCompressionType  dataCompressionType 
)
inline

Specify the data compression of this streamresource and it will override the one specified in the owning streaminformation.

Parameters
resourceHandle to the stream resource.
dataCompressionTypeenum to indicate the compression used in the resources in the streaminformation
Returns
status OpenCMISS::Zinc::OK if domain types successfully set, any other value if failed or domain data_compression_type not valid or unable to be set for this cmzn_streaminformation_resource.

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