Thanks for your reply! I tried using '.get' and still it doesn't change the output image. For some reason I think the transform object is not pulling the updated transformation matrix. However, when I check for the matrix via .matrix() it returns the correct transformation. Weird.. but using '.get' is the usual way you attach "nodes" to your main engine call?

Thanks a lot!


Nhat




On 10/5/2013 2:27 AM, Mike Wong | ax.gmail wrote:
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

_______________________________________________
Nuke-dev mailing list
[email protected], http://forums.thefoundry.co.uk/
http://support.thefoundry.co.uk/cgi-bin/mailman/listinfo/nuke-dev

Reply via email to