Nuke binary plugins 16.0.1
 
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
Loading...
Searching...
No Matches
DD::Image::Sampler Class Reference

#include <Sampler.h>

Public Types

enum  EdgeHandling { eEdgeZero , eEdgeClamp , eEdgeFromIop }
 What to do when sampling off the edges of the input.
 

Public Member Functions

 Sampler (Iop *iop, int x, int y, int r, int t, const ChannelSet &channels, Filter *filter=nullptr, EdgeHandling edges=eEdgeFromIop, InterestRatchet *ir=nullptr, bool loadOndemand=true)
 
 Sampler (Iop *iop, const Box &box, const ChannelSet &channels, Filter *filter=nullptr, EdgeHandling edges=eEdgeFromIop, InterestRatchet *ir=nullptr, bool loadOnDemand=true)
 
Iopiop () const
 
const Formatformat () const
 
const ChannelSetchannels () const
 
Filterfilter () const
 
float at (int x, int y, Channel z) const
 Sample a single pixel, with edge clipping.
 
void at (int x, int y, const ChannelSet &get, Pixel &out) const
 
void at (int x, int y, Pixel &out) const
 Same except samples out.channels.
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Filter *filter, const ChannelSet &get, Pixel &out)
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Filter *filter, Pixel &out)
 Same except samples out.channels.
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, const ChannelSet &get, Pixel &out)
 Same except the filter used is the pre-assigned one.
 
void sample (const Vector2 &center, const Vector2 &dU, const Vector2 &dV, Pixel &out)
 Same except the filter used is the pre-assigned one and samples out.channels.
 
void sample (float cx, float cy, float W, float H, Filter *filter, const ChannelSet &get, Pixel &out)
 Sample a rectangular area. Note that cx,cy is the center of the rectangle, not the corner.
 
void sample (float cx, float cy, float W, float H, Filter *filter, Pixel &out)
 Same except samples out.channels.
 
void sample (float cx, float cy, float W, float H, const ChannelSet &get, Pixel &out)
 Same except the filter used is the pre-assigned one.
 
void sample (float cx, float cy, float W, float H, Pixel &out)
 Same except the filter used is the pre-assigned one and samples out.channels.
 
void sampleTextureUV (const fdk::Vec3f &UV, const fdk::Vec3f &dU, const fdk::Vec3f &dV, Filter *filter, const ChannelSet &get, Pixel &out)
 
void sample (SamplePosition &samplePosition, Pixel &out)
 This version is used for two-pass sampling and uses the filter that was previously specified when the sampler was constructed.
 

Detailed Description

A class for sampling pixels from an image. It works like a Tile, but with sample methods. This is generally more efficient than making many calls to Iop::sample although it may render more than you need from the input if you don't sample all of the requested box.

Member Function Documentation

◆ sample()

void DD::Image::Sampler::sample ( const Vector2 center,
const Vector2 dU,
const Vector2 dV,
Filter filter,
const ChannelSet get,
Pixel out 
)

Sample a parallelogram. It is centered on center and the length of the two axis are given by dU and dV. The channels requested by get are put into out.

The default implementation turns the parallelogram into a rectangle of the same area and calls the rectangle sample() function.

◆ sampleTextureUV()

void DD::Image::Sampler::sampleTextureUV ( const fdk::Vec3f &  UV,
const fdk::Vec3f &  dU,
const fdk::Vec3f &  dV,
Filter filter,
const ChannelSet get,
Pixel out 
)

Specialized version for texture sampling where UV is a texture coordinate between 0..1 to be fitted into the Format, and dU and dV are its partial derivatives. ChannelSet get is provided separately so that a subset of out can be filled without affecting its assigned ChannelSet, which is ignored.

Referenced by slr::SlrShadingContext::sample().



©2025 The Foundry Visionmongers, Ltd. All Rights Reserved.
www.foundry.com