HDK
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
RU_Morphology.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: RU_Morphology.h
7  *
8  * COMMENTS:
9  * Does a morphological erode/dilate of an image.
10  */
11 #ifndef RU_MORPHOLOGY_H
12 #define RU_MORPHOLOGY_H
13 
14 #include <SYS/SYS_Types.h>
15 
16 #include "RU_API.h"
17 
19 {
20 public:
21  // The dilate, erode, and dilateErode methods all have identical
22  // signatures. The source, dest, and temp_dest are all the same
23  // size, namely w x h. The result will be written to dest, while
24  // temp_dest is basically just a temporary work buffer. It is
25  // only needed if both of the sizes are greater than 1. Due to the
26  // nature of the algorithm employed, the first size/2, and up to
27  // the last 3*size/2 pixels are not written to. The region of
28  // interest should therefore be embedded in a larger region to
29  // ensure that all data of interest is written to.
30  //
31  // xsize and ysize must be odd, and in the case of dilate and erode,
32  // positive. When calling dilateErode, it is the sign of the two
33  // sizes which determines whether a dilate or erode occurs. Positive
34  // values are dilates, negative are erodes.
35  static void dilate(const unsigned char *source, unsigned char *dest,
36  unsigned char *temp_dest,
37  int w, int h, int xsize, int ysize);
38  static void dilate(const unsigned short *source, unsigned short *dest,
39  unsigned short *temp_dest,
40  int w, int h, int xsize, int ysize);
41  static void dilate(const unsigned int *source, unsigned int *dest,
42  unsigned int *temp_dest,
43  int w, int h, int xsize, int ysize);
44  static void dilate(const fpreal16 *source, fpreal16 *dest,
45  fpreal16 *temp_dest,
46  int w, int h, int xsize, int ysize);
47  static void dilate(const float *source, float *dest,
48  float *temp_dest,
49  int w, int h, int xsize, int ysize);
50 
51  static void erode (const unsigned char *source, unsigned char *dest,
52  unsigned char *temp_dest,
53  int w, int h, int xsize, int ysize);
54  static void erode (const unsigned short *source, unsigned short *dest,
55  unsigned short *temp_dest,
56  int w, int h, int xsize, int ysize);
57  static void erode (const unsigned int *source, unsigned int *dest,
58  unsigned int *temp_dest,
59  int w, int h, int xsize, int ysize);
60  static void erode (const fpreal16 *source, fpreal16 *dest,
61  fpreal16 *temp_dest,
62  int w, int h, int xsize, int ysize);
63  static void erode (const float *source, float *dest,
64  float *temp_dest,
65  int w, int h, int xsize, int ysize);
66 
67  static void dilateErode(const unsigned char *source, unsigned char *dest,
68  unsigned char *temp_dest,
69  int w, int h, int xsize, int ysize);
70  static void dilateErode(const unsigned short *source, unsigned short *dest,
71  unsigned short *temp_dest,
72  int w, int h, int xsize, int ysize);
73  static void dilateErode(const unsigned int *source, unsigned int *dest,
74  unsigned int *temp_dest,
75  int w, int h, int xsize, int ysize);
76  static void dilateErode(const fpreal16 *source, fpreal16 *dest,
77  fpreal16 *temp_dest,
78  int w, int h, int xsize, int ysize);
79  static void dilateErode(const float *source, float *dest,
80  float *temp_dest,
81  int w, int h, int xsize, int ysize);
82 
83 };
84 
85 #endif
#define RU_API
Definition: RU_API.h:10
ImageBuf OIIO_API dilate(const ImageBuf &src, int width=3, int height=-1, ROI roi={}, int nthreads=0)
GLsizei GLsizei GLchar * source
Definition: glcorearb.h:803
ImageBuf OIIO_API erode(const ImageBuf &src, int width=3, int height=-1, ROI roi={}, int nthreads=0)
GLfloat GLfloat GLfloat GLfloat h
Definition: glcorearb.h:2002
GLubyte GLubyte GLubyte GLubyte w
Definition: glcorearb.h:857