Public Member Functions | |
FileWriter (Write *) | |
~FileWriter () override | |
void | finish () override |
Called when processing is finished for the current file. | |
Public Member Functions inherited from DD::Image::Writer | |
void | setFlags (FlagMask flags, bool newValue=true) |
void | clearFlags (FlagMask flags) |
bool | anyFlags (FlagMask newFlags) const |
test whether the Writer has any of the given flags | |
bool | allFlags (FlagMask newFlags) const |
test whether the Writer has all of the given flags | |
Writer (Write *i) | |
~Writer () override | |
virtual bool | movie () const |
virtual void | execute () |
void | knobs (Knob_Callback cb) override |
bool | aborted () const |
Allows a writer to check directly if its op has been aborted. | |
virtual void | setLUT (LUT *lut) |
WriterImpl * | getImpl () |
WriterImpl * | getImpl () const |
Protected Member Functions | |
bool | open () |
bool | close () |
bool | write (const void *, FILE_OFFSET) |
bool | write (FILE_OFFSET, const void *, FILE_OFFSET) |
bool | seek (FILE_OFFSET) |
FILE_OFFSET | tell () const |
std::string | getTempFileName (const char *pActualFileName=nullptr) const |
Returns a temporary file name for the current output file (e. g. filename.ext.tmp) More... | |
Protected Member Functions inherited from DD::Image::Writer | |
LUT * | lut () |
virtual LUT * | defaultLUT () const |
virtual bool | isDefaultLUTKnob (DD::Image::Knob *knob) const |
const Iop::Info & | info () const |
int | width () const |
int | height () const |
double | getPixelAspect () const |
std::pair< int, int > | getPixelAspectAsResolution () const |
virtual bool | clipToFormat () const |
virtual int | split_input (int i) const |
virtual const OutputContext & | inputContext (int n, OutputContext &c) const |
int | depth () const |
int | num_channels () const |
ChannelSet | channel_mask (int num_channels) const |
Channel | channel (int index) const |
bool | premult () const |
Iop & | input0 () |
const Iop & | input0 () const |
void | get (int y, int x, int r, ChannelMask channels, Row &row) |
const char * | filename () const |
std::string | createFileHash () |
std::string | getHash () const |
void | renameFromHash () |
void | to_byte (int z, uchar *, const float *, const float *, int W, int delta=1) |
void | to_short (int z, U16 *, const float *, const float *, int W, int bits=16, int delta=1) |
void | to_float (int z, float *, const float *, const float *, int W, int delta=1) |
void | progressFraction (double f) |
void | progressFraction (int a, int b) |
std::set< int > | executingViews () const |
Protected Attributes | |
void * | file |
Actually a FILE* but I don't want the <stdio.h> header! | |
FILE_OFFSET | offset |
Current offset into file. | |
Protected Attributes inherited from DD::Image::Writer | |
Write * | iop |
Points at the Write that created this. | |
std::string | _hash |
Related Functions | |
(Note that these are not member functions.) | |
typedef unsigned long | FILE_OFFSET |
typedef unsigned long | FILE_OFFSET |
Additional Inherited Members | |
Public Types inherited from DD::Image::Writer | |
typedef U64 | FlagMask |
Static Public Member Functions inherited from DD::Image::Writer | |
static void | flip (U16 *p, int n) |
static void | flip (U32 *p, int n) |
static void | tolsb (U32 *p, int n) |
static void | tomsb (U32 *p, int n) |
static void | tolsb (U16 *p, int n) |
static void | tomsb (U16 *p, int n) |
Static Public Attributes inherited from DD::Image::Writer | |
static const FlagMask | DONT_CHECK_INPUT0_CHANNELS |
Writer subclass to write a single Unix file. You must subclass this and implement several virtual functions to write pieces of a file. This takes care of opening and closing the file.
FileWriter::FileWriter | ( | Write * | iop | ) |
|
override |
|
protected |
Open the output file. This file is created with a temporary name so that the original file is not replaced until the write is successful. This returns false and calls iop->error() if it can't open the file.
References DD::Image::Op::critical(), file, DD::Image::Writer::filename(), getTempFileName(), DD::Image::Writer::iop, and offset.
|
protected |
Close the output file. If there have not been any errors this will mv the temporary file to the correct place.
References DD::Image::Writer::aborted(), DD::Image::Op::critical(), file, DD::Image::Writer::filename(), getTempFileName(), and DD::Image::Writer::iop.
|
protected |
Write length bytes to the file. Call iop->error() on any errors and returns false. Returns true on success.
References DD::Image::Op::critical(), file, DD::Image::Writer::iop, and offset.
Referenced by write().
|
protected |
|
protected |
Move the write pointer to offset. This is done efficiently if the pointer is already at that point. Calls iop->error() on any errors and returns false. Returns true on success.
References DD::Image::Op::critical(), file, DD::Image::Writer::iop, and offset.
Referenced by write().
|
inlineprotected |
Returns where the pointer currently is.
|
protected |
Returns a temporary file name for the current output file (e. g. filename.ext.tmp)
Returns a temporary file name for the given actual file name. e. g. filename.ext -> filename.ext.tmp Pass in NULL to use the current filename().
References DD::Image::Writer::filename().
|
related |
This type may need to be replaced on 64-bit file systems.
|
related |
This type may need to be replaced on 64-bit file systems.
©2024 The Foundry Visionmongers, Ltd. All Rights Reserved. |