About request() call just quote from NDK documentation:

"Call this to indicate the area that will be requested from this Iop. This 
calls validate(), and then calls _request() which will usually recursively call 
request() on each input.

All calls to request() are unioned together and intersected with the info() 
produced by validate(). All subsequent calls to get pixels (by get(), Tile and 
Interest constructors, or by calling at()) are clamped to this area. Missing 
channels return zero, positions outside the box return the pixel from the 
nearest edge of the box.

Although usually you want the request box to cover everything you will ask for, 
an operator may limit the size to avoid causing huge amounts of data to be 
cached. For instance some transforms request extremely large areas but reduce 
them to smaller than a single pixel, limiting the sampled area to only the 
non-scaled part of the input image and replicating the edge pixels will not 
degrade the transformed image significantly and will use far less memory.

This is used to set up the automatic caching. The region is used to determine 
how much data to store in the cache. The count argument is used to indicate 
that engine() will be called more than once for a given y value. A count of N 
and calling request() N times have identical behavior. A count of zero 
indicates that a previous request() call is being expanded in area (zero acts 
like 1 if this is the first call). Caches are placed by analyizing the 
slowness() and resulting counts of all the Iops (the current algorithim is 
simple and just turns on the cache on all operators with a count greater than 
one).

Calling Op::forget_request() will make the next request() reset the accumulated 
area. You may also want to call cache_new_pass() to indicate that all caches 
can be reused even if the data in them is still good."




And about engine() - remember that Nuke is scanline based application so by 
default Iop's are working on single horizontal line of image. As you have 
noticed 'l' and 'r' describes "lenght" of the line and it usualy (but not 
always) is the width. And 'y' is the number of the current line- Nuke calls 
engine() for each line.

Just remember, that developer guide is just addition to regular documentation 
where you have short explanation of (almost) each function and classes. You can 
also look into the header files which sometimes explain many undocumented 
things.
Unfortunately I don't know any tutorial about NDK but examples are really great 
source of knowledge. Not like in many other SDK's with abstract, nonfunctional 
or trivial examples, NDK includes source codes for real plugins!


Best
Adrian
_______________________________________________
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