00001 #ifndef __IMG_RasterSpan__
00002 #define __IMG_RasterSpan__
00003
00004 #include "IMG_API.h"
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015 #include <stdio.h>
00016
00017 class IMG_Raster;
00018 class IMG_Bucket;
00019
00020 class IMG_API IMG_RasterSpan
00021 {
00022 public:
00023 IMG_RasterSpan(IMG_Raster *, unsigned long min = 0,
00024 unsigned long max = 0);
00025 ~IMG_RasterSpan();
00026
00027 int getClosest(
00028 int scan_line,
00029 int pixel,
00030 int &x);
00031 int getClosest(
00032 int x,
00033 int y,
00034 float max,
00035 int &tx,
00036 int &ty,
00037 float &dist,
00038 float min = -1);
00039
00040 void print(FILE *);
00041
00042 private:
00043 void buildSpan(IMG_Raster *);
00044 void cleanBuckets();
00045 void addBuckets(int num_buckets);
00046
00047 IMG_Bucket *myBuckets;
00048 int myBucketCount;
00049
00050 float *myDist;
00051 int myDistDim;
00052 unsigned long myMin;
00053 unsigned long myMax;
00054 };
00055
00056 #endif // __IMG_Span__