3ds Max C++ API Reference
MapSampler Class Referenceabstract

#include <MapSampler.h>

+ Inheritance diagram for MapSampler:

Public Member Functions

virtual ~MapSampler ()
 
virtual AColor Sample (ShadeContext &sc, float u, float v)=0
 
virtual AColor SampleFilter (ShadeContext &sc, float u, float v, float du, float dv)=0
 
virtual void SetTileNumbers (int iu, int iv)
 
virtual float SampleMono (ShadeContext &sc, float u, float v)
 
virtual float SampleMonoFilter (ShadeContext &sc, float u, float v, float du, float dv)
 

Additional Inherited Members

- Static Public Member Functions inherited from MaxHeapOperators
static UtilExport voidoperator new (size_t size)
 Standard new operator used to allocate objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e)
 Standard new operator used to allocate objects if there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate objects that takes the type of memory, filename and line number where the new was called If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate objects that takes the filename and line number where the new was called If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new (size_t size, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate objects that takes extra flags to specify special operations If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, int block_type, const char *filename, int line)
 New operator used to allocate arrays of objects. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, const char *filename, int line)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport voidoperator new[] (size_t size, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, an exception will be thrown. More...
 
static UtilExport voidoperator new[] (size_t size, const std::nothrow_t &e, unsigned long flags)
 New operator used to allocate arrays of objects If there is insufficient memory, NULL will be returned. More...
 
static UtilExport void operator delete (void *ptr)
 Standard delete operator used to deallocate an object If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an object If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an object that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an object that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete (void *ptr, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an object that takes extra flags to specify special operations If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e)
 Standard delete operator used to deallocate an array of objects If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, int block_type, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the type of memory, filename and line number where the delete was called If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, const char *filename, int line)
 Delete operator used to deallocate an array of objects that takes the filename and line number where the delete was called If the pointer is invalid, nothing will happen. More...
 
static UtilExport void operator delete[] (void *ptr, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport void operator delete[] (void *ptr, const std::nothrow_t &e, unsigned long flags)
 Delete operator used to deallocate an array of objects that takes extra flags to specify special operations If the pointer is invalid, an exception will be thrown. More...
 
static UtilExport voidoperator new (size_t size, void *placement_ptr)
 Placement new operator. More...
 
static UtilExport void operator delete (void *ptr, void *placement_ptr)
 Placement delete operator. More...
 
static UtilExport voidaligned_malloc (size_t size, size_t alignment)
 Allocates memory on a specified alignment boundary. More...
 
static UtilExport voidaligned_realloc (void *ptr, size_t size, size_t alignment)
 Reallocates memory on a specified alignment boundary. More...
 
static UtilExport void aligned_free (void *ptr)
 Frees a block of memory that was allocated with aligned_malloc/aligned_realloc. More...
 

Detailed Description

See also
Class UVGen, Class ShadeContext.
Description:
A texture map implements this class and passes it into the UVGen methods EvalUVMap(), EvalUVMapMono(), and EvalDeriv() to evaluate itself with tiling & mirroring. Each of the methods of this class are used to sample the map at a single UV coordinate.

Constructor & Destructor Documentation

◆ ~MapSampler()

virtual ~MapSampler ( )
inlinevirtual
Remarks
Destructor.
32 {;}

Member Function Documentation

◆ Sample()

virtual AColor Sample ( ShadeContext sc,
float  u,
float  v 
)
pure virtual
Remarks
This method is required. It is called to sample the map at a single UV coordinate. This method should not try to antialias the map, it should just return the value. Take for example a bitmap texture implementing this method. If the u values passed was 0.5 and the v value passed was 0.5, the plug-in would just return the pixel value at the center of the bitmap as an AColor.
Parameters:
ShadeContext& sc

The ShadeContext.

float u

The U value in the range of 0.0 to 1.0

float v

The V value in the range of 0.0 to 1.0
Returns
The sampled value as an AColor.

◆ SampleFilter()

virtual AColor SampleFilter ( ShadeContext sc,
float  u,
float  v,
float  du,
float  dv 
)
pure virtual
Remarks
This method is required. It is called to return a value from the map that is the averaged value over the specified region of width du and height dv, centered at u, v. Certain map types may use the du and dv values directly to perform antialiasing of the map.
Parameters:
ShadeContext& sc

The ShadeContext.

float u

The U value in the range of 0.0 to 1.0

float v

The V value in the range of 0.0 to 1.0

float du

This parameter can be considered the width of a small rectangle center on u,v. The u and v value are guaranteed to be inside this rectangle.

float dv

This parameter can be considered the height of a small rectangle center on u,v. The u and v value are guaranteed to be inside this rectangle.
Returns
The sampled value as an AColor.

◆ SetTileNumbers()

virtual void SetTileNumbers ( int  iu,
int  iv 
)
inlinevirtual
70 {} // called before SampleFunctions to tell what tile your in

◆ SampleMono()

virtual float SampleMono ( ShadeContext sc,
float  u,
float  v 
)
inlinevirtual
Remarks
This method is optional as a default implementation is provided. It may be implemented however if a certain map type can be more efficient in evaluating a mono channel. For example a noise function that produces a single floating point value as a function of UV. This method is called to sample the map at a single UV coordinate. This method should not try to antialias the map, it should just return the value.
Parameters:
ShadeContext& sc

The ShadeContext.

float u

The U value in the range of 0.0 to 1.0

float v

The V value in the range of 0.0 to 1.0
Returns
The sampled value as an float.
Default Implementation:
{ return Intens(Sample(sc,u,v)); }
87 { return Intens(Sample(sc,u,v)); }
static float Intens(const AColor &c)
Definition: acolor.h:477
virtual AColor Sample(ShadeContext &sc, float u, float v)=0

◆ SampleMonoFilter()

virtual float SampleMonoFilter ( ShadeContext sc,
float  u,
float  v,
float  du,
float  dv 
)
inlinevirtual
Remarks
This method is optional. It is called to return a value from the map that is the averaged value over the specified region of width du and height dv, centered at u, v. Certain map types may use the du and dv values directly to perform antialiasing of the map.
Parameters:
ShadeContext& sc

The ShadeContext.

float u

The U value in the range of 0.0 to 1.0

float v

The V value in the range of 0.0 to 1.0

float du

This parameter can be considered the width of a small rectangle center on u,v. The u and v value are guaranteed to be inside this rectangle.

float dv

This parameter can be considered the height of a small rectangle center on u,v. The u and v value are guaranteed to be inside this rectangle.
Returns
The sampled value as an float.
Default Implementation:
{ return Intens(SampleFilter(sc,u,v,du,dv)); }
111  {
112  return Intens(SampleFilter(sc,u,v,du,dv));
113  }
virtual AColor SampleFilter(ShadeContext &sc, float u, float v, float du, float dv)=0