diff --git a/AUTHORS b/AUTHORS
index d127a635..09e69364 100644
--- a/AUTHORS
+++ b/AUTHORS
@@ -48,4 +48,17 @@ ctlrender
-------------
Bill Elswick
-
\ No newline at end of file
+
+Nuke_CTL
+
+ Developers:
+ -----------
+
+ Jonathan Grahamm
+
+ Contributors:
+ -------------
+
+ Ken Boreham
+
+ Joseph Goldstone
diff --git a/CHANGELOG b/CHANGELOG
index e94eafcc..6f49335a 100644
--- a/CHANGELOG
+++ b/CHANGELOG
@@ -1,3 +1,6 @@
+Version 1.5.3:
+ * added Nuke_CTL
+
Version 1.5:
* added OpenEXR_CTL, ctlrender
* changed build system to Cmake
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 01f622c0..74ed6d27 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -3,7 +3,7 @@ project( CTL )
set( CTL_MAJOR_VERSION 1 )
set( CTL_MINOR_VERSION 5 )
-set( CTL_PATCH_VERSION 0 )
+set( CTL_PATCH_VERSION 3 )
set( CTL_VERSION ${CTL_MAJOR_VERSION}.${CTL_MINOR_VERSION}.${CTL_PATCH_VERSION} )
## Make install directories overrideable
@@ -18,21 +18,27 @@ else()
endif()
set(INSTALL_CMAKE_DIR ${DEF_INSTALL_CMAKE_DIR} CACHE PATH "Install directory for project CMake files" )
-# use, i.e. don't skip the full RPATH for the build tree
-SET(CMAKE_SKIP_BUILD_RPATH FALSE)
-# when building, don't use the install RPATH already
-# (but later on when installing)
-SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
-#SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-# add the automatically determined parts of the RPATH
-# which point to directories outside the build tree to the install RPATH
-SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
-# the RPATH to be used when installing, but only if it's not a system directory
-LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
-IF("${isSystemDir}" STREQUAL "-1")
- SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
-ENDIF("${isSystemDir}" STREQUAL "-1")
-
+IF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
+ SET(CMAKE_MACOSX_RPATH TRUE)
+ # Don't set this at build time; set it at install time with each target's INSTALL_RPATH property
+ # (again, only on Darwin)
+ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ELSE()
+ # use, i.e. don't skip the full RPATH for the build tree
+ SET(CMAKE_SKIP_BUILD_RPATH FALSE)
+ # when building, don't use the install RPATH already
+ # (but later on when installing)
+ SET(CMAKE_BUILD_WITH_INSTALL_RPATH FALSE)
+ #SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ # add the automatically determined parts of the RPATH
+ # which point to directories outside the build tree to the install RPATH
+ SET(CMAKE_INSTALL_RPATH_USE_LINK_PATH TRUE)
+ # the RPATH to be used when installing, but only if it's not a system directory
+ LIST(FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES "${CMAKE_INSTALL_PREFIX}/lib" isSystemDir)
+ IF("${isSystemDir}" STREQUAL "-1")
+ SET(CMAKE_INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+ ENDIF("${isSystemDir}" STREQUAL "-1")
+ENDIF(${CMAKE_SYSTEM_NAME} MATCHES "Darwin")
## convert install paths to absolute
foreach( p LIB BIN INCLUDE CMAKE DOC)
@@ -63,6 +69,7 @@ add_subdirectory(doc)
add_subdirectory(lib)
add_subdirectory(ctlrender)
add_subdirectory(OpenEXR_CTL)
+add_subdirectory(Nuke_CTL)
add_subdirectory(unittest EXCLUDE_FROM_ALL)
# Add all targets to the build-tree export set
diff --git a/Nuke_CTL/CMakeLists.txt b/Nuke_CTL/CMakeLists.txt
new file mode 100644
index 00000000..d72a6603
--- /dev/null
+++ b/Nuke_CTL/CMakeLists.txt
@@ -0,0 +1,57 @@
+
+# NB: We use a fake component to indicate that we want to avoid
+# the IlmBase / OpenEXR libraries in the Nuke folder itself
+find_package(Nuke QUIET COMPONENTS AvoidNukeIlmBase)
+if(NUKE_FOUND)
+ message( STATUS "NUKE API Version: ${NUKE_API_VERSION}" )
+ set( DEFAULT_PLUGIN_DIR "" )
+ if( "$ENV{NUKE_PATH}" STREQUAL "" )
+ set( DEFAULT_PLUGIN_DIR $ENV{HOME}/.nuke )
+ else()
+ set( DEFAULT_PLUGIN_DIR $ENV{NUKE_PATH} )
+ endif()
+
+ # The line below doesn't make sense for Nuke 8.0 or greater. The version-specific plugin dir is now
+ # /Library/Application Support/Nuke/8.0/plugins/ [for Mac OS X]
+ # /usr/local/Nuke/8.0/plugins/ [for linux]
+ # C:\Program Files\Common Files\Nuke\8.0\plugins or C:\Program Files (x86)\Common Files\Nuke\8.0\plugins [for Windows]
+ # set( DEFAULT_PLUGIN_DIR ${DEFAULT_PLUGIN_DIR}/plugins/${NUKE_API_VERSION} )
+
+ set( INSTALL_NUKE_PLUGIN_DIR ${DEFAULT_PLUGIN_DIR} CACHE PATH "Location to install Nuke plugins" )
+
+ if( NOT DEFINED INSTALL_NUKE_PLUGIN_DIR )
+ message(WARNING " No install path defined for nuke plugins
+ please define NUKE_PATH or INSTALL_NUKE_PLUGIN_DIR
+ skipping Nuke_CTL")
+ return()
+ else()
+ message(STATUS "Nuke plugins will be installed in ${INSTALL_NUKE_PLUGIN_DIR}")
+ message("Don't forget to add this path to your init.py file")
+ endif()
+
+ include_directories("${CMAKE_CURRENT_SOURCE_DIR}"
+ "${NUKE_INCLUDE_DIRS}"
+ "${PROJECT_SOURCE_DIR}/lib/IlmCtl"
+ "${PROJECT_SOURCE_DIR}/lib/IlmCtlMath"
+ "${PROJECT_SOURCE_DIR}/lib/IlmCtlSimd"
+ "${PROJECT_SOURCE_DIR}/lib/IlmImfCtl" )
+
+ add_library(NukeCtl SHARED
+ NukeCtl.cpp
+ NukeCtlUtils.cpp
+ NukeCtlChanArgMap.cpp
+ NukeCtlTransform.cpp
+ )
+
+ set_target_properties(NukeCtl PROPERTIES PREFIX "")
+ set_target_properties(NukeCtl PROPERTIES INSTALL_RPATH "${CMAKE_INSTALL_PREFIX}/lib")
+
+ target_link_libraries( NukeCtl IlmCtl IlmCtlMath IlmCtlSimd IlmThread Half Iex )
+ target_link_libraries( NukeCtl ${IlmBase_LIBRARIES} ${IlmBase_LDFLAGS_OTHER} )
+ link_directories( ${NUKE_LIBRARY_DIR} )
+ target_link_libraries( NukeCtl ${NUKE_LIBRARIES} )
+
+ install( TARGETS NukeCtl DESTINATION ${INSTALL_NUKE_PLUGIN_DIR} )
+else()
+ message( WARNING "NUKE not found, check NUKE_INSTALL_PATH setting or NDKDIR env. var, NukeCTL plugin disabled" )
+endif()
diff --git a/Nuke_CTL/NukeCtl.cpp b/Nuke_CTL/NukeCtl.cpp
new file mode 100644
index 00000000..594d4b00
--- /dev/null
+++ b/Nuke_CTL/NukeCtl.cpp
@@ -0,0 +1,235 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2014 Academy of Motion Picture Arts and Sciences
+// ("A.M.P.A.S."). Portions contributed by others as indicated.
+// All rights reserved.
+//
+// A worldwide, royalty-free, non-exclusive right to copy, modify, create
+// derivatives, and use, in source and binary forms, is hereby granted,
+// subject to acceptance of this license. Performance of any of the
+// aforementioned acts indicates acceptance to be bound by the following
+// terms and conditions:
+//
+// * Copies of source code, in whole or in part, must retain the
+// above copyright notice, this list of conditions and the
+// Disclaimer of Warranty.
+//
+// * Use in binary form must retain the above copyright notice,
+// this list of conditions and the Disclaimer of Warranty in the
+// documentation and/or other materials provided with the distribution.
+//
+// * Nothing in this license shall be deemed to grant any rights to
+// trademarks, copyrights, patents, trade secrets or any other
+// intellectual property of A.M.P.A.S. or any contributors, except
+// as expressly stated herein.
+//
+// * Neither the name "A.M.P.A.S." nor the name of any other
+// contributors to this software may be used to endorse or promote
+// products derivative of or based on this software without express
+// prior written permission of A.M.P.A.S. or the contributors, as
+// appropriate.
+//
+// This license shall be construed pursuant to the laws of the State of
+// California, and any disputes related thereto shall be subject to the
+// jurisdiction of the courts therein.
+//
+// Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY A.M.P.A.S. AND
+// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
+// EVENT SHALL A.M.P.A.S., OR ANY CONTRIBUTORS OR DISTRIBUTORS, BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, RESITUTIONARY,
+// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+// WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE ACADEMY
+// SPECIFICALLY DISCLAIMS ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER
+// RELATED TO PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS IN THE ACADEMY
+// COLOR ENCODING SYSTEM, OR APPLICATIONS THEREOF, HELD BY PARTIES OTHER
+// THAN A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED.
+///////////////////////////////////////////////////////////////////////////
+
+const char* const HELP =
+"
Applies Ctl transforms onto an image.
";
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-register"
+#endif
+
+#include "DDImage/PixelIop.h"
+#include "DDImage/Row.h"
+#include "DDImage/Knobs.h"
+#include "DDImage/NukeWrapper.h"
+
+#include "NukeCtlUtils.h"
+#include "NukeCtlTransform.h"
+
+#include "Iex.h"
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+using namespace DD::Image;
+using namespace Iex;
+using namespace std;
+using namespace NukeCtl;
+
+static const char* const CLASS = "NukeCtl";
+
+class NukeCtlIop : public PixelIop {
+
+private:
+ DD::Image::Knob* modulePathEnabledKnob;
+ DD::Image::Knob* modulePathKnob;
+ DD::Image::Knob* readKnob;
+ bool modulePathEnabled;
+ const char *modulePath;
+ const char *ctlPath;
+ NukeCtl::Transform* transform;
+ int reloadCount;
+public:
+
+ NukeCtlIop(Node* node) : PixelIop(node),
+ modulePathEnabled(false), modulePath(""), ctlPath(""),
+ transform(NULL), reloadCount(0) {
+ }
+
+ static const Iop::Description d;
+ void in_channels(int input_number, ChannelSet& channels) const {
+ channels = Mask_RGBA;
+ }
+
+ void append(Hash& h) {
+ h.append(__DATE__);
+ h.append(__TIME__);
+ }
+
+ void expand_ctl_path(std::string& file) {
+ if (script_expand(knob("ctl_path")->get_text(&outputContext())) && script_result())
+ file = script_result();
+ else
+ file = "";
+ script_unlock();
+ }
+
+ void pixel_engine(const Row &in, int y, int x, int r, ChannelMask, Row &);
+ void knobs(Knob_Callback);
+ void load_transform(const char* const modulePath, const char* const ctlPath);
+ int knob_changed(Knob*);
+ const char* Class() const { return CLASS; }
+ const char* node_help() const { return HELP; }
+ void _validate(bool);
+};
+
+void NukeCtlIop::_validate(bool for_real) {
+ set_out_channels(Mask_RGBA);
+ PixelIop::_validate(for_real);
+}
+
+// Called on each scanline
+void NukeCtlIop::pixel_engine(const Row& in, int y, int x, int r, ChannelMask channels, Row& out) {
+ if (transform != NULL)
+ {
+ try {
+ transform->execute(in, x, r, out);
+ }
+ catch (const BaseExc& e) {
+ error("Could not execute CTL argument transform: %s", e.what());
+ }
+ catch (const exception& e) {
+ error("Could not execute CTL argument transform: %s", e.what());
+ }
+ catch (...) // Something wicked this way comes
+ {
+ error("Could not execute CTL argument transform");
+ }
+ }
+ else
+ {
+ out.copy(in, channels, x, r);
+ }
+}
+
+void NukeCtlIop::load_transform(const char* const modulePath, const char* const ctlPath)
+{
+ try
+ {
+ if (transform != NULL)
+ {
+ delete transform;
+ transform = NULL;
+ }
+ transform = new NukeCtl::Transform(modulePath, ctlPath);
+ }
+ catch (const Iex::BaseExc& e)
+ {
+ error((string("Error instantiating CTL transform: ") + e.what()).c_str());
+ }
+ catch (const exception& e)
+ {
+ error((string("Error instantiating CTL transform: ") + e.what()).c_str());
+ }
+ catch (...)
+ {
+ error("Error instantiating CTL transform");
+ }
+}
+
+void NukeCtlIop::knobs(Knob_Callback f) {
+ Newline(f, "Module Path");
+ modulePathEnabledKnob = Bool_knob(f, &modulePathEnabled, "enable_module_path", "");
+ modulePathKnob = File_knob(f, &modulePath, "module_path", "");
+ ClearFlags(f, Knob::STARTLINE);
+ readKnob = File_knob(f, &ctlPath, "ctl_path", "CTL file Path");
+ SetFlags(f, Knob::EARLY_STORE);
+ SetFlags(f, Knob::KNOB_CHANGED_ALWAYS);
+ Script_knob(f, "knob reload_count [expr [value reload_count] + 1]", "reload");
+ Int_knob(f, &reloadCount, "reload_count", INVISIBLE);
+ SetFlags(f, Knob::DO_NOT_WRITE);
+ Divider(f);
+}
+
+// Knob state changed
+int NukeCtlIop::knob_changed(Knob *k) {
+
+ if (k == &Knob::showPanel) {
+ knob("module_path")->enable(modulePathEnabled);
+ return 1;
+ }
+
+ // if the box is checked, enable or disable the set module knob
+ if (k->is("enable_module_path")) {
+ knob("module_path")->enable(modulePathEnabled);
+ return 1;
+ }
+
+ // if the module path is changed, make sure it is valid
+ if (k->is("module_path")) {
+ std::string file;
+ expand_ctl_path(file);
+ if (!file.empty())
+ load_transform(modulePath, file.c_str());
+ return 1;
+ }
+
+ if (k->is("ctl_path") || k->is("reload")) {
+ std::string file;
+ expand_ctl_path(file);
+ if (!file.empty())
+ load_transform(modulePath, file.c_str());
+ return 1;
+ }
+ return Iop::knob_changed(k);
+}
+
+static Iop* build(Node* node) {
+ return (new NukeWrapper(new NukeCtlIop(node)));
+}
+
+const Iop::Description NukeCtlIop::d(CLASS, "Color/NukeCtl", build);
+
diff --git a/Nuke_CTL/NukeCtlChanArgMap.cpp b/Nuke_CTL/NukeCtlChanArgMap.cpp
new file mode 100644
index 00000000..fc478f5f
--- /dev/null
+++ b/Nuke_CTL/NukeCtlChanArgMap.cpp
@@ -0,0 +1,156 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2014 Academy of Motion Picture Arts and Sciences
+// ("A.M.P.A.S."). Portions contributed by others as indicated.
+// All rights reserved.
+//
+// A worldwide, royalty-free, non-exclusive right to copy, modify, create
+// derivatives, and use, in source and binary forms, is hereby granted,
+// subject to acceptance of this license. Performance of any of the
+// aforementioned acts indicates acceptance to be bound by the following
+// terms and conditions:
+//
+// * Copies of source code, in whole or in part, must retain the
+// above copyright notice, this list of conditions and the
+// Disclaimer of Warranty.
+//
+// * Use in binary form must retain the above copyright notice,
+// this list of conditions and the Disclaimer of Warranty in the
+// documentation and/or other materials provided with the distribution.
+//
+// * Nothing in this license shall be deemed to grant any rights to
+// trademarks, copyrights, patents, trade secrets or any other
+// intellectual property of A.M.P.A.S. or any contributors, except
+// as expressly stated herein.
+//
+// * Neither the name "A.M.P.A.S." nor the name of any other
+// contributors to this software may be used to endorse or promote
+// products derivative of or based on this software without express
+// prior written permission of A.M.P.A.S. or the contributors, as
+// appropriate.
+//
+// This license shall be construed pursuant to the laws of the State of
+// California, and any disputes related thereto shall be subject to the
+// jurisdiction of the courts therein.
+//
+// Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY A.M.P.A.S. AND
+// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
+// EVENT SHALL A.M.P.A.S., OR ANY CONTRIBUTORS OR DISTRIBUTORS, BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, RESITUTIONARY,
+// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+// WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE ACADEMY
+// SPECIFICALLY DISCLAIMS ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER
+// RELATED TO PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS IN THE ACADEMY
+// COLOR ENCODING SYSTEM, OR APPLICATIONS THEREOF, HELD BY PARTIES OTHER
+// THAN A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED.
+///////////////////////////////////////////////////////////////////////////
+
+
+#ifdef __clang__
+#pragma clang diagnostic push
+#pragma clang diagnostic ignored "-Wdeprecated-register"
+#endif
+
+#include "NukeCtlChanArgMap.h"
+#include "Iex.h"
+
+#ifdef __clang__
+#pragma clang diagnostic pop
+#endif
+
+using namespace Ctl;
+using namespace DD::Image;
+using namespace std;
+using namespace Iex;
+
+namespace NukeCtl
+{
+ ChanArgMap::ChanArgMap(FunctionCallPtr fn)
+ {
+ argNameToChanName_["rIn"] = "r";
+ argNameToChanName_["gIn"] = "g";
+ argNameToChanName_["bIn"] = "b";
+ argNameToChanName_["aIn"] = "a";
+ argNameToChanName_["rOut"] = "r";
+ argNameToChanName_["gOut"] = "g";
+ argNameToChanName_["bOut"] = "b";
+ argNameToChanName_["aOut"] = "a";
+ chanToInArg_.clear();
+ outArgToChan_.clear();
+ for (size_t i = 0, n = fn->numInputArgs(); i < n; ++i)
+ {
+ FunctionArgPtr arg = fn->inputArg(i);
+ if (! arg)
+ {
+ THROW(LogicExc, "CTL function claims " << n << " arguments but cannot get info for arg " << i);
+ }
+ if (! arg->isVarying())
+ {
+ THROW(LogicExc, "CTL function parameter " << arg->name() << " is not a varying parameter");
+ }
+ map::const_iterator j = argNameToChanName_.find(arg->name());
+ if (j == argNameToChanName_.end())
+ {
+ THROW(LogicExc, "CTL function parameter " << arg->name() << " has no mapping to a Nuke channel");
+ }
+ Channel c = findChannel(j->second.c_str());
+ // TODO: Find out what findChannel returns if you ask for something it doesn't have, and throw an appropriate error.
+ chanToInArg_[c] = arg;
+ }
+ for (size_t i = 0, n = fn->numOutputArgs(); i < n; ++i)
+ {
+ FunctionArgPtr arg = fn->outputArg(i);
+ if (! arg)
+ {
+ THROW(LogicExc, "CTL function claims " << n << " output arguments but cannot get info for output arg " << i);
+ }
+ if (! arg->isVarying())
+ {
+ THROW(LogicExc, "CTL function output argument " << arg->name() << " is not a varying parameter");
+ }
+ map::const_iterator j = argNameToChanName_.find(arg->name());
+ if (j == argNameToChanName_.end())
+ {
+ THROW(LogicExc, "Could not find expected Nuke channel name for CTL "
+ "function output arg name '" << arg->name() << "'");
+ }
+ outArgToChan_[arg] = findChannel(j->second.c_str());
+ }
+ }
+
+ void
+ ChanArgMap::copyInputRowToArgData(const DD::Image::Row &in, int x0, int x1)
+ {
+ for (map::const_iterator i = chanToInArg_.begin(); i != chanToInArg_.end(); ++i)
+ {
+ Channel channel = i->first;
+ FunctionArgPtr arg = i->second;
+ size_t src_stride = sizeof(float);
+ size_t dst_offset = 0;
+ size_t count = x1 - x0;
+ arg->set(in[channel] + x0, src_stride, dst_offset, count);
+ }
+ }
+
+ void
+ ChanArgMap::copyArgDataToOutputRow(int x0, int x1, DD::Image::Row &out)
+ {
+ for (map::const_iterator i = outArgToChan_.begin(); i != outArgToChan_.end(); ++i)
+ {
+ FunctionArgPtr arg = i->first;
+ Channel channel = i->second;
+ size_t dst_stride = sizeof(float);
+ size_t src_offset = 0;
+ size_t count = x1 - x0;
+ arg->get(out.writable(channel) + x0, dst_stride, src_offset, count);
+ }
+ }
+
+}
diff --git a/Nuke_CTL/NukeCtlChanArgMap.h b/Nuke_CTL/NukeCtlChanArgMap.h
new file mode 100644
index 00000000..2e6f3cd6
--- /dev/null
+++ b/Nuke_CTL/NukeCtlChanArgMap.h
@@ -0,0 +1,108 @@
+///////////////////////////////////////////////////////////////////////////
+// Copyright (c) 2014 Academy of Motion Picture Arts and Sciences
+// ("A.M.P.A.S."). Portions contributed by others as indicated.
+// All rights reserved.
+//
+// A worldwide, royalty-free, non-exclusive right to copy, modify, create
+// derivatives, and use, in source and binary forms, is hereby granted,
+// subject to acceptance of this license. Performance of any of the
+// aforementioned acts indicates acceptance to be bound by the following
+// terms and conditions:
+//
+// * Copies of source code, in whole or in part, must retain the
+// above copyright notice, this list of conditions and the
+// Disclaimer of Warranty.
+//
+// * Use in binary form must retain the above copyright notice,
+// this list of conditions and the Disclaimer of Warranty in the
+// documentation and/or other materials provided with the distribution.
+//
+// * Nothing in this license shall be deemed to grant any rights to
+// trademarks, copyrights, patents, trade secrets or any other
+// intellectual property of A.M.P.A.S. or any contributors, except
+// as expressly stated herein.
+//
+// * Neither the name "A.M.P.A.S." nor the name of any other
+// contributors to this software may be used to endorse or promote
+// products derivative of or based on this software without express
+// prior written permission of A.M.P.A.S. or the contributors, as
+// appropriate.
+//
+// This license shall be construed pursuant to the laws of the State of
+// California, and any disputes related thereto shall be subject to the
+// jurisdiction of the courts therein.
+//
+// Disclaimer of Warranty: THIS SOFTWARE IS PROVIDED BY A.M.P.A.S. AND
+// CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING,
+// BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS
+// FOR A PARTICULAR PURPOSE, AND NON-INFRINGEMENT ARE DISCLAIMED. IN NO
+// EVENT SHALL A.M.P.A.S., OR ANY CONTRIBUTORS OR DISTRIBUTORS, BE LIABLE
+// FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, RESITUTIONARY,
+// OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+// SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+// INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+// CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+// ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+// THE POSSIBILITY OF SUCH DAMAGE.
+//
+// WITHOUT LIMITING THE GENERALITY OF THE FOREGOING, THE ACADEMY
+// SPECIFICALLY DISCLAIMS ANY REPRESENTATIONS OR WARRANTIES WHATSOEVER
+// RELATED TO PATENT OR OTHER INTELLECTUAL PROPERTY RIGHTS IN THE ACADEMY
+// COLOR ENCODING SYSTEM, OR APPLICATIONS THEREOF, HELD BY PARTIES OTHER
+// THAN A.M.P.A.S., WHETHER DISCLOSED OR UNDISCLOSED.
+///////////////////////////////////////////////////////////////////////////
+
+#ifndef __NukeCtl__NukeCtlChanArgMap__
+#define __NukeCtl__NukeCtlChanArgMap__
+
+#include "DDImage/Channel.h"
+#include "DDImage/Row.h"
+#include "CtlFunctionCall.h"
+#include "CtlRcPtr.h"
+#include "CtlStdType.h"
+
+#include
+#include