libcineon  0.1
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
cineon::Writer Class Reference

DPX Image Writer class. More...

#include <Cineon.h>

Collaboration diagram for cineon::Writer:
Collaboration graph
[legend]

Public Member Functions

 Writer ()
 Constructor. More...
 
virtual ~Writer ()
 Destructor. More...
 
void Start ()
 Start defining the header and writing the images. More...
 
void SetFileInfo (const char *fileName, const char *creationDate=0, const char *creationTime=0)
 Set the basic file information about DPX. More...
 
void SetImageInfo (const U32 width, const U32 height)
 Set the Width and Height of the images. More...
 
int NextAvailElement () const
 Get the next available element. More...
 
void SetElement (const int element=0, const Descriptor desc=kGrayscale, const U8 bitDepth=10, const U32 pixelsPerLine=1, const U32 linesPerElement=1, const R32 lowData=~0, const R32 lowQuantity=~0, const R32 highData=~0, const R32 highQuantity=~0)
 Set the parameters on an element. More...
 
void SetOutStream (OutStream *stream)
 Set the OutStream object will use to write the files. More...
 
void SetUserData (const long size)
 Set the size of the user data area. More...
 
bool WriteHeader ()
 Write the header. More...
 
bool WriteUserData (void *data)
 Write the user data. More...
 
bool WriteElement (const int element, void *data)
 Write the entire element to the dpx file. More...
 
bool WriteElement (const int element, void *data, const DataSize size)
 
bool WriteElement (const int element, void *data, const long count)
 
bool Finish ()
 Finish up writing image. More...
 

Public Attributes

Header header
 DPX Header. More...
 

Protected Member Functions

bool WriteThrough (void *, const U32, const U32, const int, const int, const U32, const U32, char *)
 

Protected Attributes

long fileLoc
 
OutStreamfd
 

Detailed Description

DPX Image Writer class.

Constructor & Destructor Documentation

cineon::Writer::Writer ( )

Constructor.

cineon::Writer::~Writer ( )
virtual

Destructor.

Member Function Documentation

bool cineon::Writer::Finish ( )

Finish up writing image.

Returns
success true/false
int cineon::Writer::NextAvailElement ( ) const

Get the next available element.

Returns
next available
void cineon::Writer::SetElement ( const int  element = 0,
const Descriptor  desc = kGrayscale,
const U8  bitDepth = 10,
const U32  pixelsPerLine = 1,
const U32  linesPerElement = 1,
const R32  lowData = ~0,
const R32  lowQuantity = ~0,
const R32  highData = ~0,
const R32  highQuantity = ~0 
)

Set the parameters on an element.

There are 8 elements maximum in an single DPX and each element used must be set before writing the header

Parameters
elementelement number (0-7)
descimage descriptor
bitDepthbit depth of image, valid values are [8,10,12,16,32,64]
transfertransfer characteristic
colorimetriccolorimetric specification
packingpacking type
encodingencoding type
dataSign
lowData
lowQuantity
highData
highQuantity
eolnPaddingend of line padding (in bytes)
eoimPaddingend of image padding (in bytes)
void cineon::Writer::SetFileInfo ( const char *  fileName,
const char *  creationDate = 0,
const char *  creationTime = 0 
)

Set the basic file information about DPX.

Parameters
fileNamename of this created file (100 characters max)
creationTimeDatecreation time and date - format is "YYYY:MM:DD:HH:MM:SSLTZ" where HH is 24 hour time, LTZ is local time zone using either three character notation (i.e., -04) or five character notation representing hours and minutes offset from Greenwich Mean time (i.e., -0700) (24 characters max)
creatorcreator (100 characters max)
projectproject name (200 characters max)
copyrightcopyright statement (200 characters max)
encryptKeyencryption key
void cineon::Writer::SetImageInfo ( const U32  width,
const U32  height 
)

Set the Width and Height of the images.

Parameters
widthwidth of the image
heightheight of the image
void cineon::Writer::SetOutStream ( OutStream stream)

Set the OutStream object will use to write the files.

Parameters
streamOutStream object
void cineon::Writer::SetUserData ( const long  size)

Set the size of the user data area.

Parameters
sizesize of user data
void cineon::Writer::Start ( )

Start defining the header and writing the images.

bool cineon::Writer::WriteElement ( const int  element,
void *  data 
)

Write the entire element to the dpx file.

Parameters
elementelement number (0-7)
databuffer
Returns
success true/false
bool cineon::Writer::WriteElement ( const int  element,
void *  data,
const DataSize  size 
)
bool cineon::Writer::WriteElement ( const int  element,
void *  data,
const long  count 
)
bool cineon::Writer::WriteHeader ( )

Write the header.

Returns
success true/false
bool cineon::Writer::WriteThrough ( void *  data,
const U32  width,
const U32  height,
const int  noc,
const int  bytes,
const U32  eolnPad,
const U32  eoimPad,
char *  blank 
)
protected
bool cineon::Writer::WriteUserData ( void *  data)

Write the user data.

Parameters
databuffer - must match size set in Writer::SetUserData()
Returns
success true/false

Member Data Documentation

OutStream* cineon::Writer::fd
protected
long cineon::Writer::fileLoc
protected
Header cineon::Writer::header

DPX Header.


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