DD::Image::Read Class Reference

Inherits DD::Image::PlanarIop, DD::Image::CodecOp, DD::Image::FileRead, and DD::Image::ReadFileKnobOwner.

Inherited by DD::Image::TimelineRead.

Public Member Functions

virtual FileHandler * handler () const
virtual CodecHandlercodec_handler () const
void close ()
const char * getFilename () const
ReadergetReader ()
const ReadergetReader () const
virtual DD::Image::DopeItemFlags::Mask getDopeItemFlags () const
virtual bool shouldHideInDopeSheet (Knob *knob) const
void set_file_type (const char *fileType)
virtual const char * file_type () const
void setReadFormat (const Format *fmt)
void setFullSizeFormat (const Format *fmt)
void setFormat (const Format *fmt)
void setUpdateFileTypeKnobFlag (const bool updateFileTypeKnobFlag)
FormatPair & getFormats ()
const FormatPair & getFormats () const
const DD::Image::FormatgetReadFormat () const
const Formatexpected_full_size_format () const
const Formatexpected_format () const
const Formatexpected_read_format () const
const Formatread_format () const
bool videosequence () const
 Read (Node *node=nullptr)
void append (Hash &)
void retrieveInfo ()
void setIgnoreCachedErrors (bool ignoreCachedErrors)
void frame_for_reader (int n)
int frame_for_reader () const
void filename (const char *f)
const char * filename () const
void view_for_reader (int view)
int view_for_reader () const
virtual ViewSet splitForViews () const
int current_view (const DD::Image::OutputContext *oc) const
void expectedFrameRange (int first, int last)
int expected_first_frame () const
int expected_last_frame () const
int first_frame () const
int last_frame () const
int colorspace () const
void colorspace (int v)
bool raw () const
void raw (bool v)
bool premult () const
void premult (bool v)
bool autoAlpha () const
void autoAlpha (bool v)
void knobs (Knob_Callback)
int knob_changed (Knob *)
int knob_change_finished (Knob *knob, bool changeByUser)
bool invalidate (Hash hash)
bool invalidate ()
int output_type () const
bool ignore_missing_clip () const
void output_type (int v)
void force_near_frame (bool b)
void force_format (bool b)
OpHints opHints () const override
const char * Class () const
const char * node_help () const
- Public Member Functions inherited from DD::Image::PlanarIop
 PlanarIop (Node *node)
virtual void getRequests (const Box &box, const ChannelSet &channels, int count, RequestOutput &reqData) const
virtual bool renderFullPlanes () const
 Whether this PlanarIop needs to render in full planes.
Box expandToFullTiles (const Box &box) const
 This expands the bounding box so as to cover the full extent of all overlapping tiles.
ChannelSet expandChannelsToFullPlanes (const ChannelSet &channelSet)
PlanarI::PlaneSet expandToFullPlanes (ChannelSet channelSet)
LocalPlaneCache * getCache () override
 Return the planar cache for this iop.
- Public Member Functions inherited from DD::Image::Iop
void fetchPlane (ImagePlane &imagePlane)
void force_validate (bool for_real=true) override
IopImpl * pImpl ()
Iopiop () override
 Cast to an Iop. This is much cheaper and safer than using dynamic_cast.
const Iopiop () const override
virtual ~Iop ()
bool test_input (int, Op *) const override
Opdefault_input (int) const override
Iopinput (int n) const
Iopinput (int n, int m) const
Iopinput0 () const
Iopinput1 () const
Cache * cache () const
bool cached () const
void cached (bool b)
virtual void in_channels (int, ChannelSet &) const
ChannelMask out_channels () const
int raw_channels_from () const
virtual bool pass_transform () const
void request (int x, int y, int r, int t, ChannelMask channels, int count)
void request (DD::Image::Box box, ChannelMask channels, int count)
void request (ChannelMask channels, int count)
void _copyState (Iop *input)
const BoxrequestedBox () const
const BoxunclampedRequestedBox () const
ChannelMask requested_channels () const
ChannelMask multi_requested_channels () const
ChannelMask unclamped_requested_channels () const
int requested_count () const
virtual void get (int y, int x, int r, ChannelMask, Row &)
void at (int x, int y, Pixel &out)
float at (int x, int y, Channel)
ChannelSet peek (int x, int y, int r, int t, Pixel &out)
bool peek (int x, int y, int w, int h, ChannelMask pixelChannels, PixelCallbackI &callback)
virtual TransformgetTransform ()
virtual bool set_texturemap (ViewerContext *, bool gl=true)
virtual TextureImage get_texturemap (ViewerContext *ctx)
virtual void unset_texturemap (ViewerContext *)
virtual bool shade_GL (ViewerContext *, GeoInfo &)
virtual void vertex_shader (VertexContext &)
virtual void fragment_shader (const VertexContext &, Pixel &out)
virtual void displacement_shader (const VertexContext &vtx, VArray &out)
virtual float displacement_bound () const
virtual void blending_shader (const Pixel &in, Pixel &out)
virtual void render_state (GeoInfoRenderState &state)
virtual void sample (float cx, float cy, float w, float h, Filter *, Pixel &out)
void sample (float cx, float cy, float w, float h, Pixel &out)
virtual void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Filter *filter, Pixel &out)
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Pixel &out)
virtual float sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
void build_handles (ViewerContext *) override
virtual void inputsAttached ()
virtual void gpuEngine_useTextureTransform (bool useTransform)
 GPU support code. More...
virtual void gpuEngine_setupTextureTransform (const Matrix4 &postOpTransform)
virtual const char * gpuEngine_decl () const
virtual const char * gpuEngine_body () const
virtual Hash gpuEngine_shader_hash_at (double time)
virtual int gpuEngine_getNumRequiredTexUnits () const
virtual void gpuEngine_GL_begin (GPUContext *context)
virtual void gpuEngine_GL_end (GPUContext *context)
virtual IopviewerPassThrough () const
- Public Member Functions inherited from DD::Image::Op
PrevalidateResult preValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)
OprootOp () const
bool preValidateAborted (int treeStartingVersion, PrevalidateResult &result) const
const OutputSetgetOutputs () const
 return all the outputs of this node
virtual void setInputsValid (bool nowValid)
 set whether the input ops are valid (are for the right context)
bool inputsValid () const
 return whether the input ops are valid (are for the right context)
virtual bool can_clone () const
 returns whether or not an op can be cloned in the dag
bool haveHash () const
 return true if the hash() value is meaningful and globally unique
virtual std::vector< DD::Image::OutputContextgetPrevVersionsWanted () const
const MetaData::BundlefetchMetaData (const char *keyname)
Node * node () const
DD::Image::NodeI * getNode () const
void node (Node *v)
OpfirstOp () const
void firstOp (Op *v)
Opparent () const
void parent (Op *lpOp)
virtual void detach ()
 node has been deleted in DAG
virtual void attach ()
 node has been created in DAG
virtual void pre_write_knobs ()
int replace_knobs (Knob *afterthis, int n, void(*f)(void *, Knob_Callback), void *, const char *fileExt=nullptr)
int add_knobs (void(*f)(void *, Knob_Callback), void *, Knob_Callback)
void set_unlicensed ()
Knobknob (const char *name) const
Knobknob (int) const
bool pushed () const
bool panel_visible () const
bool node_disabled () const
bool node_selected () const
unsigned node_gl_color () const
void * field (const char *name)
void * field (const char *name, int &type)
void * set_field (const char *name, const void *source, int size)
void * get_field (const char *name, void *dest, int size)
void beginHandle (HandleType command, ViewerContext *ctx, EventCallback *cb, int index, float x=0, float y=0, float z=0, ViewerContext::Cursor cursor=ViewerContext::kNoCursor)
void endHandle (ViewerContext *ctx)
void addTime (OpTimer::Category category, long long microsecondsCPU, long long microsecondsWall, bool isTopLevel=true)
void getPerformanceInfo (OpTimer::Category category, OpTimer::PerformanceInfo &info) const
 return the amount of CPU time taken by this op
virtual bool inputs_clockwise () const
 whether unconnected inputs on the DAG should be arranged clockwise or anticlockwise (default)
virtual std::vector< int > input_order () const
virtual int inputArrows (int nodeInputs) const
bool script_command (const char *command, bool py=true, bool eval=true) const
bool script_expand (const char *str) const
HandlesMode anyHandles (ViewerContext *ctx)
void add_draw_handle (ViewerContext *)
virtual void draw_handle (ViewerContext *)
virtual void add_input_handle (int input, ViewerContext *)
void add_op_handle (ViewerContext *ctx)
void add_knob_handle (Knob *, ViewerContext *)
virtual int getViewableModes () const
virtual int optional_input () const
virtual int minimum_inputs () const
virtual int maximum_inputs () const
int inputs () const
int node_inputs () const
Opnode_input (int, GenerateType=OUTPUT_OP) const
Opnode_input (int, GenerateType, const DD::Image::OutputContext *outputContext) const
Opinput_op (int n=0) const
virtual void inputs (int n)
Opinput (int) const
int inputNumber (int input, int offset) const
Opinput (int input, int offset) const
Opinput0 () const
 return the primary input More...
Opinput1 () const
 return the second input, if it exists More...
const std::vector< Op * > & getInputs () const
const std::vector< Op * > & getChildren () const
virtual void set_input (int i, Op *op, int input, int offset)
void set_input0 (Op *op)
void set_input (int i, Op *op)
void set_input (int i, Op &op)
void set_input (int input, int offset, Op *op)
const OutputContextoutputContext () const
virtual void setOutputContext (const OutputContext &c)
virtual float uses_input (int) const
virtual void build_splits ()
virtual int split_input (int) const
virtual const OutputContextinputContext (int n, int offset, OutputContext &) const
virtual const OutputContextinputUIContext (int n, OutputContext &) const
const Hashhash () const
virtual bool frameTransformImplemented () const
virtual bool frameTransformDownstream (const OutputContext &context, unsigned int input, float inFrame, float &outFrame) const
virtual bool frameTransformUpstream (const OutputContext &context, unsigned int input, float outFrame, float &inFrame) const
virtual DD::Image::KnobgetDopeItemKnob () const
virtual ViewSet viewsProduced () const
virtual ViewSet viewsWantOn (int i) const
bool requested () const
void setRequested ()
void forgetRequestShallow ()
void forget_request ()
void forget_request (std::set< Op * > &forgotten)
virtual const char * node_shape () const
DD::Image::Hash curveHash () const
bool opCurrent () const
virtual unsigned node_color () const
virtual const char * input_label (int, char *) const
virtual std::string input_longlabel (int) const
void node_redraw ()
void print_name (std::ostream &o) const
NodeContext nodeContext () const
std::string node_name () const
void invalidateSameHash ()
bool invalidate ()
bool invalidate (const Hash &hash)
bool update (const Box *=nullptr)
void asapUpdate ()
void asapUpdate (const Box &box, int direction=0)
void validate (bool for_real=true)
void update_handles () const
bool valid () const
 Returns true if it has been validated - including if there was an error. More...
bool real_valid () const
 Returns true if it has been real-validated - including if there was an error. More...
bool inErrorState () const
bool inInvalidState () const
bool opened () const
void open ()
void unopen ()
bool running () const
void running (bool v)
bool not_closed () const
void close ()
void callCloseAfter (double seconds)
void copyState (Op *input)
bool cached () const
void cached (bool b)
virtual Executableexecutable ()
void setKnobsToContext (const OutputContext &)
void gotoContext (const OutputContext &, bool update)
void progressFraction (double fraction, StatusFlags flags=StatusNone)
void progressFraction (int a, int b, StatusFlags flags=StatusNone)
void progressMessage (const char *fmt,...)
void progressModalMessage (const char *fmt,...)
void progressDismiss ()
int slowness () const
void slowness (int newval)
virtual bool firstEngineRendersWholeRequest () const
virtual bool updateUI (const OutputContext &context)
const Formatinput_format () const
const OutputContextuiContext () const
void error (const char *fmt,...)
void warning (const char *fmt,...)
void critical (const char *fmt,...)
void debug (const char *fmt,...)
void abort () const
 Abort all trees the op is in.
bool aborted () const
 True if one of the trees the op is in was aborted; ops should check this while processing and return quickly when true.
void cancel () const
 Cancel all trees the op is in. Make sure you also call abort() to stop processing.
bool cancelled () const
 True if one of the trees the op is in was cancelled (by user interaction)
bool addToTree (OpTree *lpTree)
 Returns true if the op was added to the tree, or false if its reference count increased.
bool removeFromTree (OpTree *lpTree)
 Returns false if the op was removed from the tree, or true if its reference count decreased.
bool isInTree (OpTree *lpTree) const
 Checks if an op is in a particular tree, for debugging purposes.
bool isInAnyTree () const
 Checks if an op is in any tree at all.
OpTreeHandlergetTreeHandler () const
 Returns the treeHandler for a given Op.
bool hasError () const
bool opOrChildHasError () const
const OpgetErroredOp () const
void setPopUpScheme (PopUpScheme lScheme)
PopUpScheme getPopUpScheme () const
bool arePopUpsEnabled ()
 Returns whether a pop-up should be enabled for the next message, modifying internal data when necessary.
OpMessageHandlergetMsgHandler ()
const OpMessageHandlergetMsgHandler () const
std::string getDebugInfo () const
 Returns a string of debug information about the op. For internal use.
std::string getDetailedDebugInfo () const
bool tryValidate (bool for_real=true)
virtual GeoOpgeoOp ()
 Cast to a GeoOp. This is much cheaper and safer than using dynamic_cast.
virtual const GeoOpgeoOp () const
virtual ParticleOpparticleOp ()
 Cast to a ParticleOp. This is much cheaper and safer than using dynamic_cast.
virtual const ParticleOpparticleOp () const
virtual DeepOnlyOpdeepOnlyOp ()
 Cast to a DeepOnlyOp. This is much cheaper and safer than using dynamic_cast.
virtual const DeepOnlyOpdeepOnlyOp () const
virtual std::string getLibraryName () const
 Return a label and version string to display library version info for the Node.
virtual VersionInfo getLibraryVersion () const
const std::string libraryDisplayName () const
virtual const char * displayName () const
virtual std::string docsPath () const
virtual bool onAction (const ViewerContext *c, const DD::Image::Flags f, void *d)
Opget (const Description *description)
- Public Member Functions inherited from DD::Image::IopInfoOwner
const Infoinfo () const
int x () const
int y () const
int r () const
int t () const
int w () const
int h () const
bool is_constant () const
int clampx (int x) const
int clampy (int y) const
const Formatformat () const
const Formatfull_size_format () const
int ydirection () const
bool black_outside () const
ChannelMask channels () const
const GeneralInfogeneralInfo () const
const Info2Dinfo2D () const
int first_frame () const
int last_frame () const
void format (const Format &f)
void full_size_format (const Format &f)
- Public Member Functions inherited from DD::Image::PlanarI
Box getOutputBox () const
PlaneID getRequestedPlaneFromChannel (Channel channel)
 mFnDeprecatedInNuke13 ("GetPlaneFromChannel(Channel) has been deprecated.") static PlaneID GetPlaneFromChannel(Channel channel)
PlaneSet getAllPlanes (const ChannelSet &channels)
ChannelSet getAllChannels (const ChannelSet &channels)
virtual bool stripesCanBeRenderedInParallel ()
- Public Member Functions inherited from DD::Image::CodecOp
 mFnDeprecatedInNuke14 ("codec_options_knobs(Knob_Callback f) has been deprecated.") virtual void codec_options_knobs(Knob_Callback f)
 mFnDeprecatedInNuke14 ("add_codec_knobs(const void* id, const char* fileExt) has been deprecated.") void add_codec_knobs(const void *id
 mFnDeprecatedInNuke14 ("codec_knobs() has been deprecated.") int codec_knobs() const
- Public Member Functions inherited from DD::Image::FileOp
 FileOp ()
virtual ~FileOp ()
void Reload_Button (Knob_Callback f)
int version () const
void setVersion (int newVersion)
void internalError (const char *fmt,...)
void internalErrorV (const char *fmt, va_list args)
int replaced_knobs () const
int extra_knobs () const
Knobplacemarker () const
KnobextraPlacemarker () const
virtual void filehandler_knobs (Knob_Callback f)
virtual int filehandler_knob_changed (Knob *k)
virtual int filehandler_knob_change_finished (Knob *k, bool changeByUser)
virtual void filehandler_extra_knobs (Knob_Callback f)
virtual void replaceable_knobs (Knob_Callback f)
virtual void extra_knobs (Knob_Callback f)
void replace_knobs (const void *id, const char *fileExt)
 Change the set of knobs in response to the user changing the filename or the file type pulldown. More...
const void * replaced_knobs_id () const
void add_extra_knobs (const void *id, const char *fileExt)
const void * extra_knobs_id () const

Static Public Attributes

static const char * CLASS
static const Description d
- Static Public Attributes inherited from DD::Image::Iop
static bool sPreserveCaches
- Static Public Attributes inherited from DD::Image::Op
static unsigned current_request_pass
static void(* node_redraw_cb )(const Op *)
static void(* print_name_cb )(std::ostream &, const Op *)
static void(* status_callback )(const Op *, float, float, const char *, StatusFlags)
static constexpr int kInvalidVersion
static constexpr VersionInfo kUnsetVersion

Protected Member Functions

virtual Opop ()
Readercreate_reader (const char *fname) const
void make_format (const char *fileName)
void make_format ()
void make_reader ()
void make_reader_base ()
ReadfirstRead ()
const ReadfirstRead () const
const Reader::Descriptionformat_for_name (const char *)
void asengine (int y, int x, int r, ChannelMask channels, Row &row)
const MetaData::Bundle_fetchMetaData (const char *key)
void _validate (bool)
void _open ()
void engine (int y, int x, int r, ChannelMask, Row &)
void _request (int x, int y, int r, int t, ChannelMask chans, int count)
virtual bool useStripes () const
virtual size_t stripeHeight () const
virtual PackedPreference packedPreference () const
virtual void renderStripe (ImagePlane &imagePlane)
virtual void doFetchPlane (ImagePlane &imagePlane)
virtual PlanarIgetPlanarI ()
virtual PlanarI::PlaneID getPlaneFromChannel (Channel chan)
void _close ()
- Protected Member Functions inherited from DD::Image::PlanarIop
void getRowFromPlanes (int y, int x, int r, const DD::Image::ChannelSet &channels, DD::Image::Row &row)
 Helper function used by engine() to lock the planar cache and call through renderStripe().
virtual ImagePlane renderStripe (size_t stripe, const ChannelSet &planeID)
 Render the given stripe and planeID and return the ImagePlane.
size_t getStripeCount () const override
 Implementation of this function based on useStripes() and stripeHeight(). More...
Box getStripeBox (int idx) const override
 Implementation of these functions based on useStripes() and stripeHeight(). More...
size_t rowToStripeIndex (int y) const override
ChannelSet getRawChannels (const ChannelSet &channels) const
 Determines the set of channels to pass through.
PlaneID getPlaneIDToRender (const ChannelSet &channels)
 Get all the planes that we need to go through to render the given channels.
PlaneSet getPlaneIDsToRender (const ChannelSet &channels)
- Protected Member Functions inherited from DD::Image::Iop
 Iop (Node *node)
virtual void _invalidate () override
bool inUse () const override
void copy_info (int input)
void copy_info (int input, ChannelMask)
void copy_info ()
void clear_info ()
void merge_info (int input=0)
void merge_info (int input, ChannelMask)
void mergeFrameRange (int input)
void set_out_channels (ChannelMask m)
void set_out_channels (ChannelSetInit m)
void set_out_channels (Channel z)
void raw_channels_from (int n)
void set_out_channels (ChannelMask m, int n)
IopasIop (Op *op) const
TransformgetDefaultTransform () const
template<class TileType >
void doSample (float cx, float cy, float w, float h, Filter *, Pixel &out)
template<class TileType >
float do_sample_shadowmap (Iop *map, bool map_is_one_over_z, float cx, float cy, float W, float H, Filter *filter, float Pz)
- Protected Member Functions inherited from DD::Image::Op
 Op (Node *node)
 The constructor is protected so only subclasses can create the base class.
Opcreate (Node *node, const char *name)
Opcreate (const char *name)
HandlesMode anyInputHandles (ViewerContext *)
 return if any of the inputs (recursively) wish to draw handles More...
HandlesMode anyKnobHandles (ViewerContext *)
 return if any of the knobs on this node wish to draw handles More...
void build_input_handles (ViewerContext *)
void build_knob_handles (ViewerContext *)
void disallowNoTrees ()
 Call this to tell the op that it should always have op trees for normal behaviour (for internal use)
virtual HandlesMode doAnyHandles (ViewerContext *ctx)
virtual PrevalidateResult doPreValidate (ViewerContext *ctx=nullptr, PreValidateContext *=nullptr)

Protected Attributes

ReaderFormat * _fileformat
const Reader::Description_reader_type
const DD::Image::Description_readerdesc
Iop::Info _readerInfo
bool _errorOnConstructor
bool _readerInfoOk
bool videosequence_
bool force_near_frame_
bool force_format_
Hash _filehash
bool _ignoreCachedErrors
int frame_for_reader_
bool frame_for_reader_valid_
int view_for_reader_
const char * filename_
const char * file_type_
int colorspace_
bool raw_
bool premult_
bool autoAlpha_
int _outputType
int _frameRange [2]
bool _proxyscale
float _sx
float _sy
float _tx
float _ty
Format _localFormat
MetaData::Bundle _meta
FormatPair _formats
const Format_readFormat
DD::Image::RecursiveLock _makeReaderLock
- Protected Attributes inherited from DD::Image::Iop
ChannelSet out_channels_
 protected so validate() can directly modify it
int raw_channels_from_
- Protected Attributes inherited from DD::Image::Op
bool _haveHash
 whether the _hash actually has been set by a call to invalidate(Hash) ever.
- Protected Attributes inherited from DD::Image::IopInfoOwner
Info info_
- Protected Attributes inherited from DD::Image::FileOp
bool _readerError
 whether or not the reader is in error (set by internalError)
std::string _readerErrorString
 the last reader error (set by internalError)

Additional Inherited Members

- Public Types inherited from DD::Image::Op
enum  HandlesMode { eNoHandles, eHandlesUncooked, eHandlesCooked, eHandlesMax }
enum  PrevalidateResult { eFinished, eCancelled, eAbandoned }
 This is a tribool return value. Do not extend.
enum  HandleType {
  eNone, eMouseLeftClick, eMouseRightClick, eMouseMove,
  eMouseDrag, eMouseRelease, eSelectionChanged, eSelectionChangeFinished,
  eHandleDragTranslate, eHandleDragRotate, eHandleDragScale, eHandleDragPivot,
enum  ViewableModes { eViewableMode2D, eViewableMode3D, eViewableMode3D_2DReference }
enum  GenerateType {
enum  NodeContext { eNodeGraph, eTimeline, eOpGraph }
enum  StatusFlags { StatusNone, StatusModal, StatusUseCallback }
enum  PopUpScheme {
  ePU_Never, ePU_Done, ePU_Once, ePU_Default,
 Pop-up schemes determine when pop-up messages are displayed for op errors. More...
enum  VersionComponents { eMajor, eMinor, ePoint, eRevision }
typedef std::pair< int, DD::Image::Op * > Output
 Combination of input number and pointer to Op.
typedef std::set< OutputOutputSet
 Set of all outputs from this Op.
typedef std::map< Hash, std::vector< unsigned int > > ItemSelectionList
typedef bool( EventCallback) (Op *op, EventContext eventCtx)
using VersionInfo = std::tuple< int, int, int, int >
- Public Types inherited from DD::Image::IopInfoOwner
typedef IopInfo Info
- Public Types inherited from DD::Image::PlanarI
enum  PackedPreference { ePackedPreferenceNone, ePackedPreferencePacked, ePackedPreferenceUnpacked }
typedef ChannelSet PlaneID
typedef std::set< PlaneIDPlaneSet
- Public Types inherited from DD::Image::ReadFileKnobOwner
enum  {
- Static Public Member Functions inherited from DD::Image::PlanarIop
static void EnablePlaneInterests ()
static void DisablePlaneInterests ()
- Static Public Member Functions inherited from DD::Image::Iop
static Iopdefault_input (const OutputContext &)
static Opdefault_input (const Op *op)
static Channel channel (const char *name)
static const char * channel_name (Channel c)
- Static Public Member Functions inherited from DD::Image::Op
static int treeVersion ()
 get the current tree version
static bool nukeBusy ()
 is nuke processing something on a parallel thread?
static Opcreate (Node *node, const char *name, Op *p_op)
static Opcreate (const char *name, Op *p_op)
static void resetTimers ()
 reset all the performance timers
static void setTimingEnabled (bool enabled)
 turn performance timing on or off
static bool isTimingEnabled ()
 return whether performance timing is on or not
static const char * script_result (bool py=false)
static void script_unlock ()
static void all_forget_request ()
static void new_request_pass ()
static double callPendingClose (double seconds)
static void clearPendingClose ()
static Operror_op ()
static const char * error_message ()
static void clearAbortAndError ()
 To be removed.
static void SetDefaultPopUpEnable (bool lEnable)
 This is used by Nuke to indicate when ops using the default pop-up scheme should show pop-ups. Not recommended for customisation.
static std::string getVersionInfoStr (const VersionInfo &versionInfo)
static const Descriptionfind_description (const char *name, const Op *op_)
static int message_f (char t, const char *,...)
static int message_vf (char t, const char *, va_list)
static void add_timeout (float t, TimeoutHandler, void *v=nullptr)
static void repeat_timeout (float t, TimeoutHandler, void *=nullptr)
static bool has_timeout (TimeoutHandler, void *=nullptr)
static void remove_timeout (TimeoutHandler, void *=nullptr)
- Static Public Member Functions inherited from DD::Image::FileOp
static const char * StripPrefix (const char *filename, std::string *prefix=nullptr)
static const char * StripSuffix (const char *filename, std::string *suffix=nullptr)
static bool GetFormatAndName (const char *fname, std::string &format, std::string &name)
static const char *const * file_types (const char *suffix, const char *altsuffix, const char **prefixBlacklist, const char **extras, const char **obsoleteIDs=nullptr)
 Return an array of names of file types known about. This is generated by searching the pluigin directories for any plugins called "*Writer.plugin_ext". The first location in the array is a blank string for 'unknown' and the array is NULL-terminated. More...
static void AddAlias (const char *from, const char *to)
static const char * LookupAlias (const char *from)
- Static Public Member Functions inherited from DD::Image::FileRead
static void closeFile (const std::string &filename)
- Public Attributes inherited from DD::Image::Op
const MetaData::BundlemetaCache
Hash metaCacheHash
- Public Attributes inherited from DD::Image::CodecOp
const char * fileExt

Detailed Description

Return an image from the outside world. The image is identified by the filename (which may just be a string interpreted by one of the reader implementations and not an actual file on the disk), and by the frame() if it is a movie file.

If the filename is null a black frame of the expected_format() (or video if no format is given) is produced. This is done so that a new Read in Nuke will not produce an error.

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

Member Function Documentation

void Read::make_format ( const char *  fileName)

Open the file and create the Reader object.

References DD::Image::Knob::get_text(), and DD::Image::ReaderDescription::names.

const MetaData::Bundle & Read::_fetchMetaData ( const char *  key)

We can't return this directly, because the Reader might get deleted (thus invalidating the reference) when the Read is closed.

So, let us make a local copy to store it in, which is guaranteed to be around for as long as we need it. We can put some non-reader specific things in this, also.

Reimplemented from DD::Image::Op.

References DD::Image::ReaderDescription::label.

void Read::_validate ( bool  for_real)

validate() will destroy any previous Reader and open a new one if the filename has changed or the version number has changed (the version number is incremented by the reload button).

After opening the file, it copies the info_ from the Reader object. This will have been initialized with expected_first_frame(), expected_last_frame(), expected_format(), and expected_full_size_format(), but the Reader subclass may have changed this information.

For Nuke, this may be called with for_real set to false. In this case it does not try to open the file. Instead it assumes everything is at the expected settings. Anything that actually needs the data will open the file.

Reimplemented from DD::Image::Iop.

References DD::Image::IopInfoOwner::full_size_format(), DD::Image::Enumeration_KnobI::getError(), and DD::Image::LUT::test().

void Read::_open ( )

Calls open() on the reader object.

Reimplemented from DD::Image::PlanarIop.

void Read::engine ( int  y,
int  x,
int  r,
ChannelMask  channels,
Row row 
bool Read::useStripes ( ) const

implementation of PlanarIop::useStripes()

Reimplemented from DD::Image::PlanarIop.

size_t Read::stripeHeight ( ) const

implementation of PlanarIop::stripeHeight()

Reimplemented from DD::Image::PlanarIop.

PlanarI::PackedPreference Read::packedPreference ( ) const

implementation of PlanarIop::packedPreference()

Reimplemented from DD::Image::PlanarIop.

void Read::renderStripe ( ImagePlane imagePlane)
void Read::doFetchPlane ( ImagePlane imagePlane)

implementation of Iop::packedPreference(). Calls Iop::doFetchPlane() or PlanarIop::doFetchPlane() depending on whether the reader supports planar.

Reimplemented from DD::Image::PlanarIop.

PlanarI * Read::getPlanarI ( )

implementation of PlanarIop::getPlanarI

Reimplemented from DD::Image::PlanarIop.

PlanarI::PlaneID Read::getPlaneFromChannel ( Channel  chan)

implementation of PlanarI::getPlaneFromChannel

this is only defined for channels that the reader actually supports, otherwise return plane consisting of individual layer.

Reimplemented from DD::Image::PlanarI.

void Read::_close ( )

Call this to close any current file. This will free up resources. Nuke calls this automatically after a timeout.

open() will reopen the file, but it assumes the file is the same one. You must call invalidate() if there is a possibility the existence, readability, or dimensions of the file has changed.

Reimplemented from DD::Image::Iop.

const Format * DD::Image::Read::expected_full_size_format ( ) const

This is the Format the Read will output as full_size_format(). If it is NULL or is equal to expected_read_format() then the format() is returned.

const Format * DD::Image::Read::expected_format ( ) const

If not NULL then this is the proxyfied version of the expected_full_size_format and will be used as the output format(). If this is NULL then the read format is used and you better not try to set any proxy scaling.

const Format * DD::Image::Read::expected_read_format ( ) const

This is the format to assume file is in if it has the correct dimensions. If the dimensions are wrong then Format::find() is used to locate or create a correct format, but the pixel_aspect from this format is used as a hint.

If this is NULL (the default value) then Format::find() is always called with a pixel aspect of 1.

Referenced by DD::Image::Reader::set_info().

void Read::append ( Hash hash)

Indicate that the frame number, view, autoAlpha, and LUT may affect the output.

Reimplemented from DD::Image::Op.

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

void Read::setIgnoreCachedErrors ( bool  ignoreCachedErrors)

Setter for ignoreCachedErrors flag which is used by the renderFrames() function to force-invalidate read ops which depend on previous writes in the op tree.

void Read::expectedFrameRange ( int  first,
int  last 

Set the frame range returned if the image file itself does not contain a frame range.

Implements DD::Image::ReadFileKnobOwner.

void DD::Image::Read::colorspace ( int  v)

Make the Reader use LUT::builtin(v) to convert the data, unless v is zero in which case the Reader chooses the LUT itself (for most Readers the default LUT is sRGB). Zero is the default value.

void DD::Image::Read::raw ( bool  v)

Sets the LUT to LUT::LINEAR (overriding the colorspace() setting). Some Reader types may examine this setting and use it to turn off other processing, such as conversion from YUV space.

void DD::Image::Read::premult ( bool  v)

Indicates that data should be divided by the alpha channel before being run through the LUT, and then multiplied again afterwards. This will convert data that was premultiplied in the file's colorspace into data that is premultiplied in linear colorspace.

This makes a difference if the LUT is anything other than LUT::LINEAR for any pixels where the alpha is greater than zero and less than one.

void DD::Image::Read::output_type ( int  v)

Sets exactly what is in the pixels that the Read produces. This is used by Nuke to produce results with the correct size and channels for missing frames, such as out-of-range frame numbers, or missing files in the middle of the range. This is done by setting the filename to an actual existing file, but using this to make the read produce black or a checkerboard.

  • IMAGE returns the data from the file.
  • BLACK returns zero in all channels and sets the bounding box to 1x1.
  • CHECKERBOARD produces a box pattern for all channels and sets the bounding box to the format.

Implements DD::Image::ReadFileKnobOwner.

void DD::Image::Read::force_near_frame ( bool  b)

Force the read node to use near frame in case of error !

Implements DD::Image::ReadFileKnobOwner.

void DD::Image::Read::force_format ( bool  b)

Force the read node to output at the expected format !

©2022 The Foundry Visionmongers, Ltd. All Rights Reserved.