Not sure if it's good to call the engine of transform directly,
I usually use the '.get' call of Row class to pull the data from upstream
as long as the tree of ops has been built correctly.
mw
On Saturday, October 5, 2013, Nhat Phong Tran wrote:
> I'm trying to preprocess an image using the Transform class and then apply
> some pixel modifications after that. Pretty much like having a transform
> node attached before your custom node within the code. I instanced a
> transform class and called its engine in my custom class' engine. For some
> reason it doesn't change the output at all. Does anyone have an idea? Here
> are the validate() and engine() functions for a class derived from PixelIop:
> Transform Xform; Matrix4 cornerpin_matrix;
> void _validate(bool for_real)
> {
> bool change_any = true;
> bool change_zero = false;
>
> set_out_channels(change_any ? Mask_All : Mask_None);
> updateCornerPinMatrix();
>
> PixelIop::_validate(for_real);
> if (change_zero)
> info_.black_outside(false);
>
> Xform.set_input(0,input0());
> Xform.multiply(cornerpin_matrix);
> Xform._validate(for_real);
>
> Xform.request(input_format().x(),input_format().y(),input_format().r(),input_format().t(),Mask_All,0);
> }
>
> void pixel_engine(const Row& in, int y, int x, int r,
> ChannelMask channels, Row& out){
> Row row(x,r);
> row.copy(in,channels,x,r);
> Xform.engine(y,x,r,channels,row);
> foreach (n, channels) {
> unsigned z = colourIndex(n);
> if (z > 3) {
> out.copy(row, n, x, r);
> continue;
> }
> }
> }
>
_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev