国产精品天干天干,亚洲毛片在线,日韩gay小鲜肉啪啪18禁,女同Gay自慰喷水

歡迎光臨散文網(wǎng) 會(huì)員登陸 & 注冊

nukeDLL插件開發(fā)

2019-11-12 11:41 作者:堅(jiān)韌的小牛  | 我要投稿

1.新建項(xiàng)目


?

2.配置管理器


3.配置項(xiàng)目屬性


4.代碼示例

//Tec_maskcorrect.cpp

static const char* const HELP = "Tec_maskcorrect: make red + blue + green = alpha or 1";

?

#include <DDImage/NukeWrapper.h>

#include <DDImage/PixelIop.h>

#include <DDImage/Row.h>

#include <DDImage/Knobs.h>

?

using namespace DD::Image;

?

static const char* const dnames[] = {

? "1", "alpha", 0

};

?

class Tec_maskcorrect : public PixelIop {

??? int combineType;

??? public:

??????? void in_channels(int input, ChannelSet& mask) const;

??????? Tec_maskcorrect(Node *node) : PixelIop(node) {

??????? }

?

??????? void pixel_engine(const Row& in, int y, int x, int r, ChannelMask, Row& out);

??????? virtual void knobs(Knob_Callback);

??????? static const Iop::Description d;

??????? const char* Class() const {return d.name;}

??????? const char* node_help() const {return HELP;}

??????? void _validate(bool);

};

?

void Tec_maskcorrect::_validate(bool for_real) {

??? combineType = 0;

??? copy_info();

??? set_out_channels(Mask_All);

}

?

void Tec_maskcorrect::in_channels(int input, ChannelSet& mask) const {

//mask is unchanged

}

?

void Tec_maskcorrect::knobs(Knob_Callback f)

{

??? Enumeration_knob(f, &combineType, dnames, "combineType");

}

?

void Tec_maskcorrect::pixel_engine(const Row& in, int y, int x, int r, ChannelMask channels, Row& out){

??? foreach (z, channels) {

??????? const float* inptr = in[z]+x;

??????? const float* END = inptr+(r-x);

??????? float* outptr = out.writable(z)+x;

??????? while (inptr < END)

??????????? *outptr++ = *inptr++;

??? }

?

??? const float* inredptr = in[Channel::Chan_Red] + x;

??? const float* inblueptr = in[Channel::Chan_Blue] + x;

??? const float* ingreenptr = in[Channel::Chan_Green] + x;

??? const float* inalphaptr = in[Channel::Chan_Alpha] + x;

??? float* outredptr = out.writable(Channel::Chan_Red)+x;

??? float* outblueptr = out.writable(Channel::Chan_Blue)+x;

??? float* outgreenptr = out.writable(Channel::Chan_Green)+x;

??? int index = 0;

??? while(index < r)

??? {

??????? float combine = 0;

??????? if(combineType == 0)

??????????? combine = 1;

??????? else if(combineType == 1)

??????????? combine = *inalphaptr;

??????? if((*inredptr + *inblueptr + *ingreenptr) != combine)

??????? {

??????????? float scale = combine/(*inredptr + *inblueptr + *ingreenptr);

??????????? *outredptr = scale*(*inredptr);

??????????? *outblueptr = scale*(*inblueptr);

??????????? *outgreenptr = scale*(*ingreenptr);

??????? }

??????? inredptr++;

??????? inblueptr++;

??????? ingreenptr++;

??????? inalphaptr++;

??????? outredptr++;

??????? outblueptr++;

??????? outgreenptr++;

??????? index++;

??? }

}

?

static Iop* build(Node *node) {return new NukeWrapper(new Tec_maskcorrect(node));}

const Iop::Description Tec_maskcorrect::d("Tec_maskcorrect", "Tec_maskcorrect", build);

?


nukeDLL插件開發(fā)的評論 (共 條)

分享到微博請遵守國家法律
濉溪县| 塘沽区| 吴桥县| 遵义县| 菏泽市| 白朗县| 衡东县| 长岭县| 泽普县| 阿拉善左旗| 永定县| 临安市| 麦盖提县| 合江县| 孟津县| 德钦县| 寿光市| 和林格尔县| 平湖市| 芦溪县| 石河子市| 禹城市| 敦煌市| 济南市| 东乌珠穆沁旗| 湄潭县| 清水河县| 房产| 昭觉县| 朝阳市| 六安市| 大关县| 台安县| 礼泉县| 洱源县| 根河市| 巫山县| 静宁县| 时尚| 仁布县| 探索|