Nuke binary plugins 15.0.5
 
Loading...
Searching...
No Matches
DD::Image::Write Class Reference

#include <Write.h>

Inheritance diagram for DD::Image::Write:
DD::Image::Executable

Public Member Functions

 Write (Node *node=nullptr)
 
Executableexecutable () override
 
bool isWrite () const override
 
void execute () override
 
void beginExecuting () override
 
void endExecuting () override
 
int minimum_inputs () const override
 
int maximum_inputs () const override
 
ExecMode execViewMode () override
 
ExecMode execFrameMode () override
 
const std::set< int > & views () override
 
int split_input (int i) const override
 
const DD::Image::OutputContextinputContext (int, int, OutputContext &c) const override
 
const char * filename () const override
 
const char * getFilename () const override
 
const char * fname () const
 
void filename (const char *f)
 
const char * file_type () const override
 
bool set_file_type (const char *)
 
bool set_file_type_from_filename (Knob *knob=nullptr)
 
ChannelMask channels () const
 
void channels (ChannelMask m)
 
void depth (int d)
 
int depth () const
 
int num_channels () const
 
Channel channel_written_to (int i) const
 
bool raw () const
 
void raw (bool v)
 
bool premult () const
 
void premult (bool v)
 
bool reading () const
 
const MetaData::Bundle_fetchMetaData (const char *key) override
 
void input0get (int y, int x, int r, ChannelMask mask, Row &row)
 
void inputnget (int n, int y, int x, int r, ChannelMask, Row &, float fracCPU)
 
void inputnget (int n, int y, int x, int r, ChannelMask, Row &)
 
void internalError (const char *fmt,...)
 
void filetype_knobs (Knob_Callback f)
 
void knobs (Knob_Callback) override
 
int knob_changed (Knob *) override
 
const char * Class () const override
 
const char * node_help () const override
 
unsigned node_color () const override
 
Hash getHashOfInputs ()
 
void status (double f)
 
void setOutputContext (const OutputContext &lrContext) override
 
WritergetWriter ()
 
void detach () override
 
void updateDefaultLUT ()
 
OpHints opHints () const override
 Return hints to control when and how this op will be evaluated by the top-down system.
 
- Public Member Functions inherited from DD::Image::Executable
 Executable (Op *op)
 
virtual void beginExecuting ()
 
virtual void execute ()=0
 
virtual bool isExecuteThreadSafe () const
 
virtual unsigned int getFrameProgress () const
 
virtual std::string getFrameProgressMessage () const
 
virtual void endExecuting ()
 
void setViewsToExecute (const std::set< int > &view)
 
void clearViewsToExecute ()
 
const std::set< int > & viewsToExecute ()
 
virtual ExecMode execViewMode ()
 can this node be usefully executed for more than one view in sequence
 
virtual ExecMode execFrameMode ()
 can this node be usefully executed for more then one frame in sequence
 
virtual const std::set< int > & views ()
 return the views that this node will execute
 
virtual bool isWrite () const
 return true if this should be picked up by an execute of everything
 
void frameRangeKnobs (Knob_Callback)
 provide frame range knobs and a 'limit to frame range'
 
virtual bool skipForContext (const OutputContext &context) const
 
int frameRangeKnobsChanged (DD::Image::Knob *knob)
 
virtual Executableexecutable ()=0
 
virtual const char * filename () const
 

Static Public Member Functions

static const char *const * file_types ()
 
static void enableWatermarking ()
 

Static Public Attributes

static const Description d
 

Protected Member Functions

void _validate (bool) override
 
void _request (int x, int y, int r, int t, ChannelMask, int count) override
 
void engine (int y, int x, int r, ChannelMask, Row &) override
 Needed to allow different contexts to have different passthroughs.
 
void append (DD::Image::Hash &hash) override
 

Friends

class WriteImpl
 

Additional Inherited Members

- Public Types inherited from DD::Image::Executable
enum  ExecMode { WriteOne , WriteAny , WriteMany }
 

Detailed Description

This is a base class for a file writer.

All the work is done by the various subclasses of Writer. Write just chooses what subclass to instantiate and returns the output from it, and correctly destroys and instantiates new ones as needed.

Calling Iop::execute() initiates writing the file.

Member Function Documentation

◆ _validate()

void Write::_validate ( bool  for_real)
overrideprotectedvirtual

Modify the info to show what is actually written to the file. This assumes the normal behavior that the file clips to the format and writes the channels packed together as the first N channels. It assumes that if you have set the mask to "all" then you are writing a file format that preserves channel names.

Reimplemented from DD::Image::Iop.

References DD::Image::ChannelSet::all(), DD::Image::Writer::clipToFormat(), depth(), detach(), DD::Image::Op::error(), DD::Image::Enumeration_KnobI::getError(), DD::Image::Writer::getImpl(), DD::Image::Format::height(), DD::Image::IopInfoOwner::info(), DD::Image::IopInfoOwner::info_, DD::Image::Iop::input(), DD::Image::Op::inputs(), internalError(), DD::Image::Box::intersect(), DD::Image::ChannelSet::intersection(), DD::Image::Op::knob(), DD::Image::Op::node(), DD::Image::Writer::setLUT(), DD::Image::LUT::test(), DD::Image::Op::validate(), and DD::Image::Format::width().

◆ _request()

void Write::_request ( int  x,
int  y,
int  r,
int  t,
ChannelMask  m,
int  count 
)
overrideprotectedvirtual

◆ engine()

void Write::engine ( int  y,
int  x,
int  r,
ChannelMask  channels,
Row row 
)
overrideprotectedvirtual

◆ append()

void Write::append ( DD::Image::Hash hash)
overrideprotectedvirtual

Reimplemented from DD::Image::Op.

◆ executable()

Executable * Write::executable ( )
overridevirtual

Implements DD::Image::Executable.

◆ isWrite()

bool Write::isWrite ( ) const
overridevirtual

This is not true if the input is not connected (to avoid writing black frames but without producing an error) and is not true if "reading" is turned on.

Reimplemented from DD::Image::Executable.

References DD::Image::ValueStuffI::get_value(), DD::Image::Op::knob(), and DD::Image::Op::node_input().

◆ execute()

◆ beginExecuting()

void Write::beginExecuting ( )
overridevirtual

Reimplemented from DD::Image::Executable.

◆ endExecuting()

void Write::endExecuting ( )
overridevirtual

Calls finish() on the Writer if it is writing a movie file. If reading is turned on it acts like user hit the Reload button.

Reimplemented from DD::Image::Executable.

References DD::Image::Writer::finish(), and DD::Image::Writer::movie().

◆ minimum_inputs()

int DD::Image::Write::minimum_inputs ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ maximum_inputs()

int DD::Image::Write::maximum_inputs ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Op.

◆ execViewMode()

Executable::ExecMode Write::execViewMode ( )
overridevirtual

Returns WriteMany if the Writer object asks for more than one in Writer::split_input(), indicating that (most likely) more than one view is wanted. Returns WriteOne otherwise, indicating it is a waste of time to call this with different views. Nuke will detect if the filename changes when the view changes and will call this multiple times with different filenames, otherwise complain if the user asks for more than one view to execute.

Reimplemented from DD::Image::Executable.

References DD::Image::Writer::split_input(), DD::Image::Executable::WriteMany, and DD::Image::Executable::WriteOne.

◆ execFrameMode()

Executable::ExecMode Write::execFrameMode ( )
overridevirtual

Returns WriteMany if the Writer object returns true for movie(). Returns WriteOne otherwise, indicating it is a waste of time to call this with different frames. Nuke will detect if the filename changes when the frame changes and will call this multiple times with different filenames, otherwise complain if the user asks for more than one frame to execute.

Reimplemented from DD::Image::Executable.

References DD::Image::Writer::movie(), DD::Image::Executable::WriteMany, and DD::Image::Executable::WriteOne.

◆ views()

const std::set< int > & DD::Image::Write::views ( )
inlineoverridevirtual

Reimplemented from DD::Image::Executable.

◆ split_input()

int Write::split_input ( int  i) const
overridevirtual

◆ inputContext()

const OutputContext & Write::inputContext ( int  a,
int  n,
OutputContext c 
) const
overridevirtual

◆ filename()

const char * DD::Image::Write::filename ( ) const
inlineoverridevirtual

Reimplemented from DD::Image::Executable.

◆ getFilename()

const char * DD::Image::Write::getFilename ( ) const
inlineoverridevirtual

Implements DD::Image::FileOp.

◆ file_type()

const char * Write::file_type ( ) const
overridevirtual

Return the type of file this will write. This is set by set_file_type() or set_file_type_from_filename() or by validate() if neither of these is done. This is actually the null-sepearted list of names from the DD::Image::Writer::Description object.

Implements DD::Image::FileOp.

Referenced by set_file_type().

◆ set_file_type()

bool Write::set_file_type ( const char *  name)

Set the type of file the Writer will write. The type is a string like "cin" or "jpeg". Returns true if the new type is different than the previous one. Notice that if the type changes all settings on Writer-specific knobs are lost.

If this type is not found or is zero then file_type() is set to zero. If the node is then executed it will attempt to figure out the type from the filename, and if that fails it will cause an error.

file_types() returns a list of available names. You may also be able to set other names like "sgi16" that are not in this list, these typically initialize some knobs to non-default values.

References DD::Image::Writer::Description::constructor, detach(), file_type(), DD::Image::Writer::Description::find(), DD::Image::Writer::getImpl(), internalError(), DD::Image::Op::knob(), DD::Image::plugin_error(), DD::Image::ValueStuffI::set_value(), updateDefaultLUT(), and DD::Image::Knob::visible().

Referenced by set_file_type_from_filename().

◆ set_file_type_from_filename()

bool Write::set_file_type_from_filename ( Knob knob = nullptr)

If the filename has "name:" near the start, try using that to set the file type. If that fails, try using the file extension. This is automatically done by execute() and validate() if this or set_file_type() has not been called.

References DD::Image::Knob::get_text(), DD::Image::Op::knob(), DD::Image::plugin_error(), and set_file_type().

◆ depth()

int Write::depth ( ) const

Does Writer::depth(). Current implementation returns the number of channels turned on in the selector and in the input.

References DD::Image::IopInfoOwner::channels(), DD::Image::Iop::input(), DD::Image::Iop::input0(), and DD::Image::ChannelSet::size().

Referenced by _validate(), and execute().

◆ channel_written_to()

Channel Write::channel_written_to ( int  i) const

◆ _fetchMetaData()

const MetaData::Bundle & Write::_fetchMetaData ( const char *  key)
overridevirtual

Reimplemented from DD::Image::Op.

◆ inputnget()

void Write::inputnget ( int  n,
int  y,
int  x,
int  r,
ChannelMask  channels,
Row row,
float  fracCPU 
)

Get line from the input, and launch multiple threads to read other lines so they are ready to be returned when this is called next time.

References DD::Image::Iop::get(), DD::Image::Iop::input(), DD::Image::Thread::numThreads, DD::Image::IopInfoOwner::r(), DD::Image::IopInfoOwner::x(), and DD::Image::IopInfoOwner::y().

◆ internalError()

void Write::internalError ( const char *  fmt,
  ... 
)

Calls Op::error(), but prefixes "filename: " to the message.

References DD::Image::Op::critical(), strlcpy(), and vsnprintf().

Referenced by _validate(), execute(), and set_file_type().

◆ knobs()

void Write::knobs ( Knob_Callback  f)
overridevirtual

Reimplemented from DD::Image::Op.

◆ knob_changed()

int Write::knob_changed ( Knob k)
overridevirtual

Reimplemented from DD::Image::Op.

◆ Class()

const char * Write::Class ( ) const
overridevirtual

Implements DD::Image::Op.

◆ node_help()

const char * Write::node_help ( ) const
overridevirtual

Implements DD::Image::Op.

◆ node_color()

unsigned Write::node_color ( ) const
overridevirtual

Reimplemented from DD::Image::Op.

◆ setOutputContext()

void Write::setOutputContext ( const OutputContext lrContext)
overridevirtual

Reimplemented from DD::Image::Op.

◆ detach()

void Write::detach ( )
overridevirtual

Cleans up the writer when the dag is detached.

Reimplemented from DD::Image::Op.

Referenced by _validate(), and set_file_type().

◆ enableWatermarking()

void Write::enableWatermarking ( )
static

Use this to set a watermark iop to be applied immediately before all writes, without showing it on the DAG. There is no function to turn this off again, as there should be no need.

◆ updateDefaultLUT()

void Write::updateDefaultLUT ( )

Update the colorspace knob so that the 'default' entry contains text specifying what that default currently is

References DD::Image::Writer::getImpl(), DD::Image::Op::node(), and DD::Image::Op::panel_visible().

Referenced by set_file_type().

◆ opHints()

OpHints Write::opHints ( ) const
overridevirtual

Return hints to control when and how this op will be evaluated by the top-down system.

Reimplemented from DD::Image::Iop.

References DD::Image::eChainable.



©2024 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com