Jump to content
Quantico

How to get image size of COP2 node?

Recommended Posts

Posted (edited)

I need to know the size of the COP2 node for some input node. I can get a sequence info (TIL_Sequence) by calling getSequenceInfo member function of COP2_Node class. But it has only resolution info (getRes function), which is a visible size of the image, not an actual size.

Edited by Quantico

Share this post


Link to post
Share on other sites

You want to call COP2_Node::getImageBounds(). The bounds can be different per plane, unlike the res, so the plane must be specified.

Share this post


Link to post
Share on other sites

OK. Thanks for your reply.

So to get the image actual size you need to write the following code:
 

int x, y, x1, y1, x2, y2;

float tm = some_node->getSequenceTime(); // ???

TIL_Sequence * seq = some_node->getSequenceInfo();

TIL_Plane plane(*seq->getPlane(some_node->getColorPlaneName()));

plane.setFormat(PXL_FLOAT32);

seq->getRes(x, y);

some_node->getImageBounds(&plane, 0, tm, x, y, 0, x1, y1, x2, y2);

Right?

Share this post


Link to post
Share on other sites
float tm = context.getTime();

Right. Or, if you have a COP2_Context in cookMyTile(), you can pass that instead of { plane, 0, tm, x,y, 0 } using the second getImageBounds() signature - If you just want the image size of the plane you're processing (or the size of the input plane). If you need to access a different plane, you need the longhand version.

Share this post


Link to post
Share on other sites

OK. Thanks.

I thought there is a more convenient way to just get image dimensions :)

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×