HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
IMG_TextureFilter.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_TextureFilter.h ( IMG Library, C++)
7  *
8  * COMMENTS: This class holds filter information required for texture
9  * evaluation.
10  */
11 
12 #ifndef __IMG_TextureFilter__
13 #define __IMG_TextureFilter__
14 
15 #include "IMG_API.h"
16 #include <UT/UT_Vector4.h>
17 #include <UT/UT_String.h>
18 #include <UT/UT_FilterType.h>
19 #include <UT/UT_Filter.h>
20 
21 class UT_Filter;
22 class UT_FilterWindow;
23 
25 {
26  IMG_DEEP_DISCRETE = 0, // Step interpolation of z samples
27  IMG_DEEP_LINEAR = 1 // Linear interpolation of z samples
28 };
29 
30 /// Modes for how to translate colors in images for texture lookups
32 {
33  IMG_COLORSPACE_AUTO, // Determine automatically
34  IMG_COLORSPACE_LINEAR // Direct linear translation
35 };
36 
37 /// Modes for filtering
39 {
40 public:
42  {
43  IMG_UTFILTER, // Use UT_Filter for evaluation
44  IMG_BILINEAR, // Bilinear interpolation
45  IMG_BIQUADRATIC, // Biquadratic interpolation
46  IMG_BICUBIC, // Bicubic interpolation
47  };
48 
52 
53 
54  /// Get the channel name (i.e. the plane name)
55  const char *getChannelName() const { return myChannelName; }
56  /// Get the channel index (i.e. the plane index). The index is considered
57  /// uninitialized if its value is < 0.
58  int getChannelIndex() const { return myChannelIndex; }
59  /// Set the channel name. If this is different than the previous value,
60  /// the channel index will be reset to -1.
61  void setChannelName(const char *channel);
62  /// Once the channel index has be resolved, stash the value here.
63  void setChannelIndex(int i) { myChannelIndex = i; }
64 
65  void setFilter(UT_FilterType ftype,
66  float x, float y);
67  void setXFilter(UT_FilterType ftype);
68  void setYFilter(UT_FilterType ftype);
69  void setFilterWidths(float x, float y);
70  void setFilterBlurs(float x, float y);
71  void setMipInterpolate(int onoff);
72  void setWrap(UT_FilterWrap uwrap, UT_FilterWrap vwrap,
73  const UT_Vector4 &border);
75  { myDeepInterp = interp; }
77  { mySourceColorSpace = convert; }
78  void setZSkew(float zskew) { myZSkew = zskew; }
79  void setZWidth(float z) { myZWidth = z; }
80  void swapBorder(UT_Vector4 &b, int ncomponents=4);
81 
82  FilterMode filterMode() const { return myFilterMode; }
83  void setFilterMode(FilterMode m) { myFilterMode = m; }
84  const UT_Filter *getXFilter() const { return myXFilter; }
85  const UT_Filter *getYFilter() const { return myYFilter; }
86 
87  int getMipInterpolate() const { return myInterp; }
88  float getXWidth() const { return myXWidth; }
89  float getYWidth() const { return myYWidth; }
90  float getXBlur() const { return myXBlur; }
91  float getYBlur() const { return myYBlur; }
92 
93  UT_FilterWrap getXWrap() const { return myXWrap; }
94  UT_FilterWrap getYWrap() const { return myYWrap; }
95  const UT_Vector4 &getBorder() const { return myBorder; }
96 
97  float getXsupport() const { return myXFilter->getSupport(); }
98  float getYsupport() const { return myYFilter->getSupport(); }
99  float zskew() const { return myZSkew; }
100  float zwidth() const { return myZWidth; }
101 
102  void setBeerLambert(bool b) { myBeerLambert = b; }
103  bool beerLambert() const { return myBeerLambert; }
104 
105  void dump() const;
106 
107 public:
109  UT_Filter *myXFilter, *myYFilter;
110  float myXWidth, myYWidth;
113  int myInterp;
118  float myXBlur, myYBlur;
120  float myZSkew;
121  float myZWidth;
124 };
125 
126 #endif
void setZSkew(float zskew)
FilterMode filterMode() const
UT_FilterWrap myYWrap
int getChannelIndex() const
void setZWidth(float z)
GLdouble GLdouble GLdouble z
Definition: glcorearb.h:847
const UT_Filter * getXFilter() const
UT_FilterWrap
Definition: UT_FilterType.h:40
GLint y
Definition: glcorearb.h:102
void setChannelIndex(int i)
Once the channel index has be resolved, stash the value here.
UT_FilterType
Definition: UT_FilterType.h:16
png_uint_32 i
Definition: png.h:2877
IMG_DeepInterp
#define IMG_API
Definition: IMG_API.h:10
void setFilterMode(FilterMode m)
IMG_DeepInterp myDeepInterp
float zskew() const
void setBeerLambert(bool b)
bool beerLambert() const
const UT_Vector4 & getBorder() const
float getYWidth() const
GLboolean GLboolean GLboolean b
Definition: glcorearb.h:1221
float getXWidth() const
Modes for filtering.
GLint GLint GLsizei GLint border
Definition: glcorearb.h:107
float zwidth() const
float getYsupport() const
IMG_ColorSpace mySourceColorSpace
const UT_Filter * getYFilter() const
float getXBlur() const
GLint GLenum GLint x
Definition: glcorearb.h:408
UT_FilterWrap getYWrap() const
int getMipInterpolate() const
IMG_ColorSpace
Modes for how to translate colors in images for texture lookups.
void setDeepInterp(IMG_DeepInterp interp)
UT_FilterWrap getXWrap() const
const char * getChannelName() const
Get the channel name (i.e. the plane name)
void setSourceColorSpace(IMG_ColorSpace convert)
float getYBlur() const
float getXsupport() const