HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
IMG_RasterSpan.h
Go to the documentation of this file.
1 #ifndef __IMG_RasterSpan__
2 #define __IMG_RasterSpan__
3 
4 #include "IMG_API.h"
5 //
6 // This class a takes raster and creates a "span" data structure that holds
7 // all spans where alpha is 0.
8 //
9 // The access methods will take an arbitrary pixel and then return the
10 // closest pixel which has an alpha value of 0.
11 //
12 // The class could be expanded to create spans based upon different criteria.
13 //
14 
15 #include <stdio.h>
16 
17 class IMG_Raster;
18 class IMG_Bucket;
19 
21 {
22 public:
23  IMG_RasterSpan(IMG_Raster *, unsigned long min = 0,
24  unsigned long max = 0);
25  ~IMG_RasterSpan();
26 
27  int getClosest(
28  int scan_line,
29  int pixel,
30  int &x);
31  int getClosest(
32  int x,
33  int y,
34  float max,
35  int &tx,
36  int &ty,
37  float &dist,
38  float min = -1);
39 
40  void print(FILE *);
41 
42 private:
43  void buildSpan(IMG_Raster *);
44  void cleanBuckets();
45  void addBuckets(int num_buckets);
46 
47  IMG_Bucket *myBuckets;
48  int myBucketCount;
49 
50  float *myDist;
51  int myDistDim;
52  unsigned long myMin;
53  unsigned long myMax;
54 };
55 
56 #endif // __IMG_Span__
GA_API const UT_StringHolder dist
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & min(const T &a, const T &b)
Definition: Composite.h:128
GLint y
Definition: glcorearb.h:102
const hboost::disable_if_c< VecTraits< T >::IsVec, T >::type & max(const T &a, const T &b)
Definition: Composite.h:132
#define IMG_API
Definition: IMG_API.h:10
GLint GLenum GLint x
Definition: glcorearb.h:408