HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups 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 "IMG_FileTTMap.h"
16 #include <UT/UT_NonCopyable.h>
17 #include <UT/UT_Vector3.h>
18 
19 class IMG_TextureFilter;
20 class IMG_TTChannel;
21 
23 {
24 public:
25  IMG_TTMipSampler(int xres, int yres, IMG_TTChannel *ch);
27 
29 
30  int64 getMemoryUsage(bool inclusive) const
31  {
32  // NOTE: We don't own myChannel.
33  return inclusive ? sizeof(*this) : 0;
34  }
35 
36  /// This method returns raw pixel data. iu and iv are in screen space.
37  void getPixel(void *pixel, int iu, int iv);
38 
39  void sample(float *result, int nchan,
40  float u, float v,
41  const IMG_TextureFilter &filter);
42  void sample(float *result, float &visible, int nchan,
43  float u, float v, float du, float dv,
45  float mipblend);
46  void sampleBilinear(float *result, int nchan,
47  float u, float v, float &visible,
48  const IMG_TextureFilter &filter);
49  void sampleBicubic(float *result, int nchan,
50  float u, float v, float &visible,
51  const IMG_TextureFilter &filter);
52  void sampleBiquadratic(float *result, int nchan,
53  float u, float v, float &visible,
54  const IMG_TextureFilter &filter);
55 
56 private:
57  float myXres, myYres; // Float to minimize conversions
58  float myXres5, myYres5; // Half the xres/yres
59  int myIXres, myIYres; // Integer values for res
60  float myDx, myDy; // Size of a pixel in my map
61  IMG_TTChannel *myChannel;
62 };
63 
64 #endif
65 
const GLdouble * v
Definition: glcorearb.h:837
**But if you need a result
Definition: thread.h:613
#define IMG_API
Definition: IMG_API.h:10
#define UT_NON_COPYABLE(CLASS)
Define deleted copy constructor and assignment operator inside a class.
long long int64
Definition: SYS_Types.h:116
Modes for filtering.
GLint GLint GLint GLint GLint GLint GLint GLbitfield GLenum filter
Definition: glcorearb.h:1297