TuttleOFX  1
dpx::Writer Class Reference

DPX Image Writer class. More...

#include <DPX.h>

Collaboration diagram for dpx::Writer:

Public Member Functions

 Writer ()
 Constructor.
virtual ~Writer ()
 Destructor.
void Start ()
 Start defining the header and writing the images.
void SetFileInfo (const char *fileName, const char *creationTimeDate=0, const char *creator=0, const char *project=0, const char *copyright=0, const U32 encryptKey=~0, const bool swapEndian=false)
 Set the basic file information about DPX.
void SetImageInfo (const U32 width, const U32 height)
 Set the Width and Height of the images.
int NextAvailElement () const
 Get the next available element.
void SetElement (const int element=0, const Descriptor desc=kRGB, const U8 bitDepth=10, const Characteristic transfer=kLogarithmic, const Characteristic colorimetric=kLogarithmic, const Packing packing=kFilledMethodA, const Encoding encoding=kNone, const U32 dataSign=0, const U32 lowData=~0, const R32 lowQuantity=std::numeric_limits< float >::quiet_NaN(), const U32 highData=~0, const R32 highQuantity=std::numeric_limits< float >::quiet_NaN(), const U32 eolnPadding=0, const U32 eoimPadding=0)
 Set the parameters on an element.
void SetOutStream (OutStream *stream)
 Set the OutStream object will use to write the files.
void SetUserData (const long size)
 Set the size of the user data area.
bool WriteHeader ()
 Write the header.
bool WriteUserData (void *data)
 Write the user data.
bool WriteElement (const int element, void *data)
 Write the entire element to the dpx file.
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.

Data Fields

Header header
 DPX Header.

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.

Definition at line 298 of file DPX.h.


Constructor & Destructor Documentation

dpx::Writer::Writer ( )

Constructor.

Definition at line 43 of file Writer.cpp.

dpx::Writer::~Writer ( ) [virtual]

Destructor.

Definition at line 48 of file Writer.cpp.


Member Function Documentation

bool dpx::Writer::Finish ( )

Finish up writing image.

Returns:
success true/false

Definition at line 398 of file Writer.cpp.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

int dpx::Writer::NextAvailElement ( ) const

Get the next available element.

Returns:
next available

Definition at line 97 of file Writer.cpp.

References dpx::kUndefinedDescriptor, and MAX_ELEMENTS.

void dpx::Writer::SetElement ( const int  element = 0,
const Descriptor  desc = kRGB,
const U8  bitDepth = 10,
const Characteristic  transfer = kLogarithmic,
const Characteristic  colorimetric = kLogarithmic,
const Packing  packing = kFilledMethodA,
const Encoding  encoding = kNone,
const U32  dataSign = 0,
const U32  lowData = ~0,
const R32  lowQuantity = std::numeric_limits<float>::quiet_NaN(),
const U32  highData = ~0,
const R32  highQuantity = std::numeric_limits<float>::quiet_NaN(),
const U32  eolnPadding = 0,
const U32  eoimPadding = 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)

Definition at line 146 of file Writer.cpp.

References MAX_ELEMENTS.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

void dpx::Writer::SetFileInfo ( const char *  fileName,
const char *  creationTimeDate = 0,
const char *  creator = 0,
const char *  project = 0,
const char *  copyright = 0,
const U32  encryptKey = ~0,
const bool  swapEndian = false 
)

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
swapEndianwhether to write the image header in reverse to native endianness

Definition at line 58 of file Writer.cpp.

References dpx::SwapBytes().

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

Here is the call graph for this function:

void dpx::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

Definition at line 88 of file Writer.cpp.

References dpx::kLeftToRightTopToBottom.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

void dpx::Writer::SetOutStream ( OutStream stream)

Set the OutStream object will use to write the files.

Parameters:
streamOutStream object

Definition at line 111 of file Writer.cpp.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

void dpx::Writer::SetUserData ( const long  size)

Set the size of the user data area.

Parameters:
sizesize of user data

Definition at line 133 of file Writer.cpp.

void dpx::Writer::Start ( )

Start defining the header and writing the images.

Definition at line 53 of file Writer.cpp.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

bool dpx::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

Definition at line 199 of file Writer.cpp.

References dpx::kUndefinedDescriptor, and MAX_ELEMENTS.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render(), and tuttle::plugin::dpx::writer::DPXWriterProcess< View >::writeImage().

bool dpx::Writer::WriteElement ( const int  element,
void *  data,
const DataSize  size 
)
bool dpx::Writer::WriteElement ( const int  element,
void *  data,
const long  count 
)

Definition at line 179 of file Writer.cpp.

References dpx::kUndefinedDescriptor, and MAX_ELEMENTS.

bool dpx::Writer::WriteHeader ( )

Write the header.

Returns:
success true/false

Definition at line 117 of file Writer.cpp.

References OutStream::kStart.

Referenced by tuttle::plugin::dpx::writer::DPXWriterPlugin::render().

bool dpx::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]

Definition at line 345 of file Writer.cpp.

References height.

bool dpx::Writer::WriteUserData ( void *  data)

Write the user data.

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

Definition at line 139 of file Writer.cpp.


Field Documentation

OutStream* dpx::Writer::fd [protected]

Definition at line 439 of file DPX.h.

long dpx::Writer::fileLoc [protected]

Definition at line 438 of file DPX.h.


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