HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
TextureSystem Class Referenceabstract

#include <texture.h>

Public Member Functions

 TextureSystem (void)
 
virtual ~TextureSystem ()
 
virtual bool attribute (string_view name, TypeDesc type, const void *val)=0
 
virtual bool attribute (string_view name, int val)=0
 
virtual bool attribute (string_view name, float val)=0
 
virtual bool attribute (string_view name, double val)=0
 
virtual bool attribute (string_view name, string_view val)=0
 
virtual bool getattribute (string_view name, TypeDesc type, void *val) const =0
 Get the named attribute, store it in value. More...
 
virtual bool getattribute (string_view name, int &val) const =0
 
virtual bool getattribute (string_view name, float &val) const =0
 
virtual bool getattribute (string_view name, double &val) const =0
 
virtual bool getattribute (string_view name, char **val) const =0
 
virtual bool getattribute (string_view name, std::string &val) const =0
 
virtual Perthread * get_perthread_info (Perthread *thread_info=NULL)=0
 
virtual Perthread * create_thread_info ()=0
 
virtual void destroy_thread_info (Perthread *threadinfo)=0
 Destroy a Perthread that was allocated by create_thread_info(). More...
 
virtual TextureHandle * get_texture_handle (ustring filename, Perthread *thread_info=NULL)=0
 
virtual bool good (TextureHandle *texture_handle)=0
 
virtual bool texture (ustring filename, TextureOpt &options, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool texture (TextureHandle *texture_handle, Perthread *thread_info, TextureOpt &options, float s, float t, float dsdx, float dtdx, float dsdy, float dtdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool texture (ustring filename, TextureOptBatch &options, Tex::RunMask mask, const float *s, const float *t, const float *dsdx, const float *dtdx, const float *dsdy, const float *dtdy, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 
virtual bool texture (TextureHandle *texture_handle, Perthread *thread_info, TextureOptBatch &options, Tex::RunMask mask, const float *s, const float *t, const float *dsdx, const float *dtdx, const float *dsdy, const float *dtdy, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 
virtual bool texture (ustring filename, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< float > s, VaryingRef< float > t, VaryingRef< float > dsdx, VaryingRef< float > dtdx, VaryingRef< float > dsdy, VaryingRef< float > dtdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool texture (TextureHandle *texture_handle, Perthread *thread_info, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< float > s, VaryingRef< float > t, VaryingRef< float > dsdx, VaryingRef< float > dtdx, VaryingRef< float > dsdy, VaryingRef< float > dtdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool texture3d (ustring filename, TextureOpt &options, const Imath::V3f &P, const Imath::V3f &dPdx, const Imath::V3f &dPdy, const Imath::V3f &dPdz, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL, float *dresultdr=NULL)=0
 
virtual bool texture3d (TextureHandle *texture_handle, Perthread *thread_info, TextureOpt &options, const Imath::V3f &P, const Imath::V3f &dPdx, const Imath::V3f &dPdy, const Imath::V3f &dPdz, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL, float *dresultdr=NULL)=0
 
virtual bool texture3d (ustring filename, TextureOptBatch &options, Tex::RunMask mask, const float *P, const float *dPdx, const float *dPdy, const float *dPdz, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr, float *dresultdr=nullptr)=0
 
virtual bool texture3d (TextureHandle *texture_handle, Perthread *thread_info, TextureOptBatch &options, Tex::RunMask mask, const float *P, const float *dPdx, const float *dPdy, const float *dPdz, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr, float *dresultdr=nullptr)=0
 
virtual bool texture3d (ustring filename, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > P, VaryingRef< Imath::V3f > dPdx, VaryingRef< Imath::V3f > dPdy, VaryingRef< Imath::V3f > dPdz, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL, float *dresultdr=NULL)=0
 
virtual bool texture3d (TextureHandle *texture_handle, Perthread *thread_info, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > P, VaryingRef< Imath::V3f > dPdx, VaryingRef< Imath::V3f > dPdy, VaryingRef< Imath::V3f > dPdz, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL, float *dresultdr=NULL)=0
 
virtual bool shadow (ustring filename, TextureOpt &options, const Imath::V3f &P, const Imath::V3f &dPdx, const Imath::V3f &dPdy, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool shadow (TextureHandle *texture_handle, Perthread *thread_info, TextureOpt &options, const Imath::V3f &P, const Imath::V3f &dPdx, const Imath::V3f &dPdy, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool shadow (ustring filename, TextureOptBatch &options, Tex::RunMask mask, const float *P, const float *dPdx, const float *dPdy, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 Batched shadow lookups. More...
 
virtual bool shadow (TextureHandle *texture_handle, Perthread *thread_info, TextureOptBatch &options, Tex::RunMask mask, const float *P, const float *dPdx, const float *dPdy, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 
virtual bool shadow (ustring filename, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > P, VaryingRef< Imath::V3f > dPdx, VaryingRef< Imath::V3f > dPdy, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool shadow (TextureHandle *texture_handle, Perthread *thread_info, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > P, VaryingRef< Imath::V3f > dPdx, VaryingRef< Imath::V3f > dPdy, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool environment (ustring filename, TextureOpt &options, const Imath::V3f &R, const Imath::V3f &dRdx, const Imath::V3f &dRdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool environment (TextureHandle *texture_handle, Perthread *thread_info, TextureOpt &options, const Imath::V3f &R, const Imath::V3f &dRdx, const Imath::V3f &dRdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool environment (ustring filename, TextureOptBatch &options, Tex::RunMask mask, const float *R, const float *dRdx, const float *dRdy, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 
virtual bool environment (TextureHandle *texture_handle, Perthread *thread_info, TextureOptBatch &options, Tex::RunMask mask, const float *R, const float *dRdx, const float *dRdy, int nchannels, float *result, float *dresultds=nullptr, float *dresultdt=nullptr)=0
 
virtual bool environment (ustring filename, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > R, VaryingRef< Imath::V3f > dRdx, VaryingRef< Imath::V3f > dRdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual bool environment (TextureHandle *texture_handle, Perthread *thread_info, TextureOptions &options, Runflag *runflags, int beginactive, int endactive, VaryingRef< Imath::V3f > R, VaryingRef< Imath::V3f > dRdx, VaryingRef< Imath::V3f > dRdy, int nchannels, float *result, float *dresultds=NULL, float *dresultdt=NULL)=0
 
virtual std::string resolve_filename (const std::string &filename) const =0
 
virtual bool get_texture_info (ustring filename, int subimage, ustring dataname, TypeDesc datatype, void *data)=0
 
virtual bool get_texture_info (TextureHandle *texture_handle, Perthread *thread_info, int subimage, ustring dataname, TypeDesc datatype, void *data)=0
 
virtual bool get_imagespec (ustring filename, int subimage, ImageSpec &spec)=0
 
virtual bool get_imagespec (TextureHandle *texture_handle, Perthread *thread_info, int subimage, ImageSpec &spec)=0
 
virtual const ImageSpecimagespec (ustring filename, int subimage=0)=0
 
virtual const ImageSpecimagespec (TextureHandle *texture_handle, Perthread *thread_info=NULL, int subimage=0)=0
 
virtual bool get_texels (ustring filename, TextureOpt &options, int miplevel, int xbegin, int xend, int ybegin, int yend, int zbegin, int zend, int chbegin, int chend, TypeDesc format, void *result)=0
 
virtual bool get_texels (TextureHandle *texture_handle, Perthread *thread_info, TextureOpt &options, int miplevel, int xbegin, int xend, int ybegin, int yend, int zbegin, int zend, int chbegin, int chend, TypeDesc format, void *result)=0
 
virtual std::string geterror () const =0
 
virtual std::string getstats (int level=1, bool icstats=true) const =0
 
virtual void invalidate (ustring filename)=0
 
virtual void invalidate_all (bool force=false)=0
 
virtual void reset_stats ()=0
 
virtual void close (ustring filename)=0
 
virtual void close_all ()=0
 
virtual ImageCacheimagecache () const =0
 

Static Public Member Functions

static TextureSystemcreate (bool shared=true, ImageCache *imagecache=nullptr)
 
static void destroy (TextureSystem *x, bool teardown_imagecache=false)
 

Detailed Description

Define an API to an abstract class that that manages texture files, caches of open file handles as well as tiles of texels so that truly huge amounts of texture may be accessed by an application with low memory footprint, and ways to perform antialiased texture, shadow map, and environment map lookups.

Definition at line 443 of file texture.h.

Constructor & Destructor Documentation

TextureSystem::TextureSystem ( void  )
inline

Definition at line 469 of file texture.h.

virtual TextureSystem::~TextureSystem ( )
inlinevirtual

Definition at line 470 of file texture.h.

Member Function Documentation

virtual bool TextureSystem::attribute ( string_view  name,
TypeDesc  type,
const void val 
)
pure virtual

Set an attribute controlling the texture system. Return true if the name and type were recognized and the attrib was set. Documented attributes: int max_open_files : maximum number of file handles held open float max_memory_MB : maximum tile cache size, in MB string searchpath : colon-separated search path for texture files string plugin_searchpath : colon-separated search path for plugins matrix44 worldtocommon : the world-to-common transformation matrix44 commontoworld : the common-to-world transformation int autotile : if >0, tile size to emulate for non-tiled images int autoscanline : autotile using full width tiles int automip : if nonzero, emulate mipmap on the fly int accept_untiled : if nonzero, accept untiled images int accept_unmipped : if nonzero, accept unmipped images int failure_retries : how many times to retry a read failure int deduplicate : if nonzero, detect duplicate textures (default=1) int gray_to_rgb : make 1-channel images fill RGB lookups int max_tile_channels : max channels to store all chans in a tile string latlong_up : default "up" direction for latlong ("y") int flip_t : flip v coord for texture lookups? int max_errors_per_file : Limits how many errors to issue for issue for each (default: 100)

virtual bool TextureSystem::attribute ( string_view  name,
int  val 
)
pure virtual
virtual bool TextureSystem::attribute ( string_view  name,
float  val 
)
pure virtual
virtual bool TextureSystem::attribute ( string_view  name,
double  val 
)
pure virtual
virtual bool TextureSystem::attribute ( string_view  name,
string_view  val 
)
pure virtual
virtual void TextureSystem::close ( ustring  filename)
pure virtual

Close any open file handles associated with a named file, or for all files, but do not invalidate any image spec information or pixels associated with the files. A client might do this in order to release OS file handle resources, or to make it safe for other processes to modify cached files.

virtual void TextureSystem::close_all ( )
pure virtual
static TextureSystem* TextureSystem::create ( bool  shared = true,
ImageCache imagecache = nullptr 
)
static

Create a TextureSystem and return a pointer. This should only be freed by passing it to TextureSystem::destroy()!

If shared==true, the TextureSystem is intended to be shared with other like-minded owners in the same process who also ask for a shared texture system. The shared TS also has a globally shared ImageCache.

If shared==false, a private texture system will be created. In that case, the imagecache pointer optionally supplies an existing ImageCache, which is owned by the caller (responsible for keeping it alive for the lifetime of the TextureSystem, and destroying it when no longer needed). If shared==false and imagecache==nullptr, then a custom ImageCache will be created, owned by the TextureSystem, and automatically freed when the TS destroys.

virtual Perthread* TextureSystem::create_thread_info ( )
pure virtual

Create a new Perthread. It is the caller's responsibility to eventually destroy it using destroy_thread_info().

static void TextureSystem::destroy ( TextureSystem x,
bool  teardown_imagecache = false 
)
static

Destroy a TextureSystem that was created using TextureSystem::create(). If teardown_imagecache parameter is true, it will cause the underlying ImageCache to be fully destroyed even if it's the "shared" ImageCache (use with caution)

virtual void TextureSystem::destroy_thread_info ( Perthread *  threadinfo)
pure virtual

Destroy a Perthread that was allocated by create_thread_info().

virtual bool TextureSystem::environment ( ustring  filename,
TextureOpt options,
const Imath::V3f R,
const Imath::V3f dRdx,
const Imath::V3f dRdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Retrieve an environment map lookup for direction R.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::environment ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOpt options,
const Imath::V3f R,
const Imath::V3f dRdx,
const Imath::V3f dRdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Slightly faster version of environment() lookup if the app already has a texture handle and per-thread info.

virtual bool TextureSystem::environment ( ustring  filename,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  R,
const float *  dRdx,
const float *  dRdy,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual

Batched environment looksups.

The inputs R, dRdx, dRdy are pointers to arrays that look like: float R[3][BatchWidth], or alternately like Imath::Vec3<FloatWide>. The mask is a bitfield giving the lanes to compute.

The float* results act like float[nchannels][BatchWidth], so that effectively result[0..BatchWidth-1] are the "red" result for each lane, result[BatchWidth..2*BatchWidth-1] are the "green" results, etc. The dresultds and dresultdt should either both be provided, or else both be nullptr (meaning no derivative results are required).

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::environment ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  R,
const float *  dRdx,
const float *  dRdy,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual
virtual bool TextureSystem::environment ( ustring  filename,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f R,
VaryingRef< Imath::V3f dRdx,
VaryingRef< Imath::V3f dRdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Retrieve an environment map lookup for direction R, for many points at once. DEPRECATED(1.8)

virtual bool TextureSystem::environment ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f R,
VaryingRef< Imath::V3f dRdx,
VaryingRef< Imath::V3f dRdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual
virtual bool TextureSystem::get_imagespec ( ustring  filename,
int  subimage,
ImageSpec spec 
)
pure virtual

Get the ImageSpec associated with the named texture (specifically, the first MIP-map level). If the file is found and is an image format that can be read, store a copy of its specification in spec and return true. Return false if the file was not found or could not be opened as an image file by any available ImageIO plugin.

virtual bool TextureSystem::get_imagespec ( TextureHandle *  texture_handle,
Perthread *  thread_info,
int  subimage,
ImageSpec spec 
)
pure virtual
virtual Perthread* TextureSystem::get_perthread_info ( Perthread *  thread_info = NULL)
pure virtual

Retrieve a Perthread, unique to the calling thread. This is a thread-specific pointer that will always return the Perthread for a thread, which will also be automatically destroyed when the thread terminates.

Applications that want to manage their own Perthread pointers (with create_thread_info and destroy_thread_info) should still call this, but passing in their managed pointer. If the passed-in threadinfo is not NULL, it won't create a new one or retrieve a TSP, but it will do other necessary housekeeping on the Perthread information.

virtual bool TextureSystem::get_texels ( ustring  filename,
TextureOpt options,
int  miplevel,
int  xbegin,
int  xend,
int  ybegin,
int  yend,
int  zbegin,
int  zend,
int  chbegin,
int  chend,
TypeDesc  format,
void result 
)
pure virtual

Retrieve the rectangle of raw unfiltered texels spanning [xbegin..xend) X [ybegin..yend) X [zbegin..zend), with "exclusive end" a la STL, specified as integer pixel coordinates in the designated MIP-map level, storing the texel values beginning at the address specified by result. The texel values will be converted to the type specified by format. It is up to the caller to ensure that result points to an area of memory big enough to accommodate the requested rectangle (taking into consideration its dimensions, number of channels, and data format). Requested pixels outside the valid pixel data region will be filled in with 0 values.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::get_texels ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOpt options,
int  miplevel,
int  xbegin,
int  xend,
int  ybegin,
int  yend,
int  zbegin,
int  zend,
int  chbegin,
int  chend,
TypeDesc  format,
void result 
)
pure virtual
virtual TextureHandle* TextureSystem::get_texture_handle ( ustring  filename,
Perthread *  thread_info = NULL 
)
pure virtual

Retrieve an opaque handle for fast texture lookups. The opaque pointer thread_info is thread-specific information returned by get_perthread_info(). Return NULL if something has gone horribly wrong.

virtual bool TextureSystem::get_texture_info ( ustring  filename,
int  subimage,
ustring  dataname,
TypeDesc  datatype,
void data 
)
pure virtual

Get information about the given texture. Return true if found and the data has been put in *data. Return false if the texture doesn't exist, doesn't have the requested data, if the data doesn't match the type requested. or some other failure.

virtual bool TextureSystem::get_texture_info ( TextureHandle *  texture_handle,
Perthread *  thread_info,
int  subimage,
ustring  dataname,
TypeDesc  datatype,
void data 
)
pure virtual
virtual bool TextureSystem::getattribute ( string_view  name,
TypeDesc  type,
void val 
) const
pure virtual

Get the named attribute, store it in value.

virtual bool TextureSystem::getattribute ( string_view  name,
int val 
) const
pure virtual
virtual bool TextureSystem::getattribute ( string_view  name,
float &  val 
) const
pure virtual
virtual bool TextureSystem::getattribute ( string_view  name,
double &  val 
) const
pure virtual
virtual bool TextureSystem::getattribute ( string_view  name,
char **  val 
) const
pure virtual
virtual bool TextureSystem::getattribute ( string_view  name,
std::string val 
) const
pure virtual
virtual std::string TextureSystem::geterror ( ) const
pure virtual

If any of the API routines returned false indicating an error, this routine will return the error string (and clear any error flags). If no error has occurred since the last time geterror() was called, it will return an empty string.

virtual std::string TextureSystem::getstats ( int  level = 1,
bool  icstats = true 
) const
pure virtual

Return the statistics output as a huge string.

virtual bool TextureSystem::good ( TextureHandle *  texture_handle)
pure virtual

Return true if the texture handle (previously returned by get_texture_handle()) is a valid texture that can be subsequently read or sampled.

virtual ImageCache* TextureSystem::imagecache ( ) const
pure virtual

Return an opaque, non-owning pointer to the underlying ImageCache (if there is one).

virtual const ImageSpec* TextureSystem::imagespec ( ustring  filename,
int  subimage = 0 
)
pure virtual

Return a pointer to an ImageSpec associated with the named texture (specifically, the first MIP-map level) if the file is found and is an image format that can be read, otherwise return NULL.

This method is much more efficient than get_imagespec(), since it just returns a pointer to the spec held internally by the underlying ImageCache (rather than copying the spec to the user's memory). However, the caller must beware that the pointer is only valid as long as nobody (even other threads) calls invalidate() on the file, or invalidate_all(), or destroys the TextureSystem.

virtual const ImageSpec* TextureSystem::imagespec ( TextureHandle *  texture_handle,
Perthread *  thread_info = NULL,
int  subimage = 0 
)
pure virtual
virtual void TextureSystem::invalidate ( ustring  filename)
pure virtual

Invalidate any cached information about the named file. A client might do this if, for example, they are aware that an image being held in the cache has been updated on disk.

virtual void TextureSystem::invalidate_all ( bool  force = false)
pure virtual

Invalidate all cached data for all textures. If force is true, everything will be invalidated, no matter how wasteful it is, but if force is false, in actuality files will only be invalidated if their modification times have been changed since they were first opened.

virtual void TextureSystem::reset_stats ( )
pure virtual

Reset most statistics to be as they were with a fresh TextureSystem. Caveat emptor: this does not flush the cache itelf, so the resulting statistics from the next set of texture requests will not match the number of tile reads, etc., that would have resulted from a new TextureSystem.

virtual std::string TextureSystem::resolve_filename ( const std::string filename) const
pure virtual

Given possibly-relative 'filename', resolve it using the search path rules and return the full resolved filename.

virtual bool TextureSystem::shadow ( ustring  filename,
TextureOpt options,
const Imath::V3f P,
const Imath::V3f dPdx,
const Imath::V3f dPdy,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Retrieve a shadow lookup for a single position P.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::shadow ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOpt options,
const Imath::V3f P,
const Imath::V3f dPdx,
const Imath::V3f dPdy,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Slightly faster version of shadow() lookup if the app already has a texture handle and per-thread info.

virtual bool TextureSystem::shadow ( ustring  filename,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  P,
const float *  dPdx,
const float *  dPdy,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual

Batched shadow lookups.

virtual bool TextureSystem::shadow ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  P,
const float *  dPdx,
const float *  dPdy,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual
virtual bool TextureSystem::shadow ( ustring  filename,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f P,
VaryingRef< Imath::V3f dPdx,
VaryingRef< Imath::V3f dPdy,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Retrieve a shadow lookup for position P at many points at once. DEPRECATED(1.8)

virtual bool TextureSystem::shadow ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f P,
VaryingRef< Imath::V3f dPdx,
VaryingRef< Imath::V3f dPdy,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual
virtual bool TextureSystem::texture ( ustring  filename,
TextureOpt options,
float  s,
float  t,
float  dsdx,
float  dtdx,
float  dsdy,
float  dtdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Filtered 2D texture lookup for a single point.

s,t are the texture coordinates; dsdx, dtdx, dsdy, and dtdy are the differentials of s and t change in some canonical directions x and y. The choice of x and y are not important to the implementation; it can be any imposed 2D coordinates, such as pixels in screen space, adjacent samples in parameter space on a surface, etc.

The result is placed in result[0..nchannels-1]. If dresuls and dresultdt are non-NULL, then they [0..nchannels-1] will get the texture gradients, i.e., the rate of change per unit s and t, respectively, of the texture.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::texture ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOpt options,
float  s,
float  t,
float  dsdx,
float  dtdx,
float  dsdy,
float  dtdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Version that takes nchannels and derivatives explicitly, if the app already has a texture handle and per-thread info.

virtual bool TextureSystem::texture ( ustring  filename,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  s,
const float *  t,
const float *  dsdx,
const float *  dtdx,
const float *  dsdy,
const float *  dtdy,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual

Retrieve filtered (possibly anisotropic) texture lookups for an entire batch of points. The mask is a bitfield giving the lanes to compute.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

The float* inputs are each pointing to an array of float[BatchWidth] giving one float value for each batch lane.

The float* results act like float[nchannels][BatchWidth], so that effectively result[0..BatchWidth-1] are the "red" result for each lane, result[BatchWidth..2*BatchWidth-1] are the "green" results, etc. The dresultds and dresultdt should either both be provided, or else both be nullptr (meaning no derivative results are required).

virtual bool TextureSystem::texture ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  s,
const float *  t,
const float *  dsdx,
const float *  dtdx,
const float *  dsdy,
const float *  dtdy,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr 
)
pure virtual
virtual bool TextureSystem::texture ( ustring  filename,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< float >  s,
VaryingRef< float >  t,
VaryingRef< float >  dsdx,
VaryingRef< float >  dtdx,
VaryingRef< float >  dsdy,
VaryingRef< float >  dtdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual

Old multi-point API call. DEPRECATED (1.8)

virtual bool TextureSystem::texture ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< float >  s,
VaryingRef< float >  t,
VaryingRef< float >  dsdx,
VaryingRef< float >  dtdx,
VaryingRef< float >  dsdy,
VaryingRef< float >  dtdy,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL 
)
pure virtual
virtual bool TextureSystem::texture3d ( ustring  filename,
TextureOpt options,
const Imath::V3f P,
const Imath::V3f dPdx,
const Imath::V3f dPdy,
const Imath::V3f dPdz,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL,
float *  dresultdr = NULL 
)
pure virtual

Retrieve a 3D texture lookup at a single point.

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::texture3d ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOpt options,
const Imath::V3f P,
const Imath::V3f dPdx,
const Imath::V3f dPdy,
const Imath::V3f dPdz,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL,
float *  dresultdr = NULL 
)
pure virtual

Slightly faster version of texture3d() lookup if the app already has a texture handle and per-thread info.

virtual bool TextureSystem::texture3d ( ustring  filename,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  P,
const float *  dPdx,
const float *  dPdy,
const float *  dPdz,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr,
float *  dresultdr = nullptr 
)
pure virtual

Batched 3D (volumetric) texture lookup.

The inputs P, dPdx, dPdy, dPdz are pointers to arrays that look like: float P[3][BatchWidth], or alternately like Imath::Vec3<FloatWide>. The mask is a bitfield giving the lanes to compute.

The float* results act like float[nchannels][BatchWidth], so that effectively result[0..BatchWidth-1] are the "red" result for each lane, result[BatchWidth..2*BatchWidth-1] are the "green" results, etc. The dresultds and dresultdt should either both be provided, or else both be nullptr (meaning no derivative results are required).

Return true if the file is found and could be opened by an available ImageIO plugin, otherwise return false.

virtual bool TextureSystem::texture3d ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptBatch options,
Tex::RunMask  mask,
const float *  P,
const float *  dPdx,
const float *  dPdy,
const float *  dPdz,
int  nchannels,
float *  result,
float *  dresultds = nullptr,
float *  dresultdt = nullptr,
float *  dresultdr = nullptr 
)
pure virtual
virtual bool TextureSystem::texture3d ( ustring  filename,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f P,
VaryingRef< Imath::V3f dPdx,
VaryingRef< Imath::V3f dPdy,
VaryingRef< Imath::V3f dPdz,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL,
float *  dresultdr = NULL 
)
pure virtual

Retrieve a 3D texture lookup at many points at once. DEPRECATED(1.8)

virtual bool TextureSystem::texture3d ( TextureHandle *  texture_handle,
Perthread *  thread_info,
TextureOptions options,
Runflag runflags,
int  beginactive,
int  endactive,
VaryingRef< Imath::V3f P,
VaryingRef< Imath::V3f dPdx,
VaryingRef< Imath::V3f dPdy,
VaryingRef< Imath::V3f dPdz,
int  nchannels,
float *  result,
float *  dresultds = NULL,
float *  dresultdt = NULL,
float *  dresultdr = NULL 
)
pure virtual

The documentation for this class was generated from the following file: