PageRenderTime 24ms CodeModel.GetById 14ms app.highlight 7ms RepoModel.GetById 2ms app.codeStats 0ms

/src/nuke/OCIOLogConvert/OCIOLogConvert.h

http://github.com/imageworks/OpenColorIO
C++ Header | 101 lines | 33 code | 23 blank | 45 comment | 0 complexity | 19597fb7df98a3e8158f01f25365afb9 MD5 | raw file
  1#ifndef INCLUDED_OCIO_NUKE_LOGCONVERT_H_
  2#define INCLUDED_OCIO_NUKE_LOGCONVERT_H_
  3
  4// Include these early, for Nuke's headers under gcc 4.4.2.
  5#include <memory>
  6#include <cstdarg>
  7
  8#include <DDImage/PixelIop.h>
  9#include <DDImage/Row.h>
 10#include <DDImage/Knob.h>
 11
 12#include <OpenColorIO/OpenColorIO.h>
 13namespace OCIO = OCIO_NAMESPACE;
 14
 15
 16/*!
 17 * Iop that uses OpenColorIO to perform colorspace conversions
 18 */
 19class OCIOLogConvert : public DD::Image::PixelIop {
 20
 21    protected:
 22        int modeindex;
 23        
 24        OCIO::ConstProcessorRcPtr processor;
 25    public:
 26        static const char* modes[];
 27
 28        OCIOLogConvert(Node *node);
 29
 30        virtual ~OCIOLogConvert();
 31
 32        static const DD::Image::Op::Description description;
 33
 34        /*! Return the command name that will be stored in Nuke scripts. */
 35        virtual const char *Class() const;
 36
 37        /*!
 38         * Return a name for this class that will be shown to the user. The
 39         * default implementation returns Class(). You can return a different
 40         * (ie more user-friendly) name instead here, and there is no need for
 41         * this to be unique.
 42         * 
 43         * Nuke currently will remove any trailing digits and underscores from
 44         * this and add a new number to make a unique name for the new node.
 45         * 
 46         * \return "OCIOLogConvert"
 47         */
 48        virtual const char *displayName() const;
 49
 50        /*!
 51         * Return help information for this node. This information is in the
 52         * pop-up window that the user gets when they hit the [?] button in
 53         * the lower-left corner of the control panel.
 54         */
 55        virtual const char *node_help() const;
 56
 57        /*!
 58         * Define the knobs that will be presented in the control panel.
 59         */
 60        virtual void knobs(DD::Image::Knob_Callback f);
 61
 62        /*!
 63         * Specify the channels required from input n to produce the channels
 64         * in mask by modifying mask in-place. (At least one channel in the
 65         * input is assumed.)
 66         *
 67         * Since OCIOLogConvert conversions can have channel cross-talk, any rgb
 68         * output channel requires all its rgb bretheren. (Non-rgb
 69         * are passed through.)
 70         */
 71        virtual void in_channels(int n, DD::Image::ChannelSet& mask) const;
 72
 73        /*!
 74         * Calculate the output pixel data.
 75         * \param rowY vertical line number
 76         * \param rowX inclusive left bound
 77         * \param rowXBound exclusive right bound
 78         * \param outputChannels a subset of out_channels(), the required channels to be produced
 79         */
 80        virtual void pixel_engine(
 81            const DD::Image::Row& in,
 82            int rowY, int rowX, int rowXBound,
 83            DD::Image::ChannelMask outputChannels,
 84            DD::Image::Row& out);
 85
 86
 87    protected:
 88
 89        /*!
 90         * Check that colorspaces are available, and that the transform
 91         * is not a noop. (As OCIO whether a given transform is a noop, since it
 92         * can do more analysis than just name matching.)
 93         */
 94        virtual void _validate(bool for_real);
 95
 96};
 97
 98
 99static DD::Image::Op* build(Node *node);
100
101#endif // INCLUDED_OCIO_NUKE_LOGCONVERT_H_