HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IMG_TTMipSampler.h
Go to the documentation of this file.
1 /*
2  * PROPRIETARY INFORMATION. This software is proprietary to
3  * Side Effects Software Inc., and is not to be reproduced,
4  * transmitted, or disclosed in any way without written permission.
5  *
6  * NAME: IMG_TTMipSampler.h ( IMG Library, C++)
7  *
8  * COMMENTS: A general mipmap sampler for tiled textures
9  */
10 
11 #ifndef __IMG_TTMipSampler__
12 #define __IMG_TTMipSampler__
13 
14 #include "IMG_API.h"
15 #include <UT/UT_Vector3.h>
16 #include "IMG_FileTTMap.h"
17 
18 class IMG_TextureFilter;
19 class IMG_TTChannel;
20 
22 {
23 public:
24  IMG_TTMipSampler(int xres, int yres, IMG_TTChannel *ch);
26 
27  int64 getMemoryUsage(bool inclusive) const
28  {
29  // NOTE: We don't own myChannel.
30  return inclusive ? sizeof(*this) : 0;
31  }
32 
33  /// This method returns raw pixel data. iu and iv are in screen space.
34  void getPixel(void *pixel, int iu, int iv);
35 
36  void sample(float *result, int nchan,
37  float u, float v,
38  const IMG_TextureFilter &filter);
39  void sample(float *result, float &visible, int nchan,
40  float u, float v, float du, float dv,
42  float mipblend);
43  void sampleBilinear(float *result, int nchan,
44  float u, float v, float &visible,
45  const IMG_TextureFilter &filter);
46  void sampleBicubic(float *result, int nchan,
47  float u, float v, float &visible,
48  const IMG_TextureFilter &filter);
49  void sampleBiquadratic(float *result, int nchan,
50  float u, float v, float &visible,
51  const IMG_TextureFilter &filter);
52 
53 private:
54  float myXres, myYres; // Float to minimize conversions
55  float myXres5, myYres5; // Half the xres/yres
56  int myIXres, myIYres; // Integer values for res
57  float myDx, myDy; // Size of a pixel in my map
58  IMG_TTChannel *myChannel;
59 };
60 
61 #endif
62 
const GLdouble * v
Definition: glcorearb.h:836
long long int64
Definition: SYS_Types.h:106
#define IMG_API
Definition: IMG_API.h:10
Modes for filtering.
int64 getMemoryUsage(bool inclusive) const
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1296