60 static void Dilate(
Image2<int> const& input,
int numNeighbors,
61 std::array<int, 2>
const* neighbors,
Image2<int>& output);
70 static void Erode4(
Image2<int> const& input,
bool zeroExterior,
80 static void Erode8(
Image2<int> const& input,
bool zeroExterior,
90 static void Erode(
Image2<int> const& input,
bool zeroExterior,
91 int numNeighbors, std::array<int, 2>
const* neighbors,
100 static void Open4(
Image2<int> const& input,
bool zeroExterior,
109 static void Open8(
Image2<int> const& input,
bool zeroExterior,
118 static void Open(
Image2<int> const& input,
bool zeroExterior,
119 int numNeighbors, std::array<int, 2>
const* neighbors,
128 static void Close4(
Image2<int> const& input,
bool zeroExterior,
137 static void Close8(
Image2<int> const& input,
bool zeroExterior,
146 static void Close(
Image2<int> const& input,
bool zeroExterior,
147 int numNeighbors, std::array<int, 2>
const* neighbors,
157 static bool ExtractBoundary(
int x,
int y,
Image2<int>& image,
158 std::vector<size_t>& boundary);
163 template <
typename PixelType>
165 PixelType foreColor, PixelType backColor);
170 static void GetL1Distance(
Image2<int>& image,
int& maxDistance,
171 int& xMax,
int& yMax);
178 static void GetL2Distance(
Image2<int> const& image,
float& maxDistance,
191 static void DrawThickPixel(
int x,
int y,
int thick,
192 std::function<
void(
int,
int)>
const& callback);
195 static void DrawLine(
int x0,
int y0,
int x1,
int y1,
196 std::function<
void(
int,
int)>
const& callback);
201 static void DrawCircle(
int xCenter,
int yCenter,
int radius,
bool solid,
202 std::function<
void(
int,
int)>
const& callback);
207 static void DrawRectangle(
int xMin,
int yMin,
int xMax,
int yMax,
208 bool solid, std::function<
void(
int,
int)>
const& callback);
213 static void DrawEllipse(
int xCenter,
int yCenter,
int xExtent,
int yExtent,
214 std::function<
void(
int,
int)>
const& callback);
220 template <
typename PixelType>
221 static void DrawFloodFill4(
int x,
int y,
int xSize,
int ySize,
222 PixelType foreColor, PixelType backColor,
223 std::function<
void(
int,
int, PixelType)>
const& setCallback,
224 std::function<PixelType(
int,
int)>
const& getCallback);
228 static void GetComponents(
int numNeighbors,
int const* delta,
232 static void L2Check(
int x,
int y,
int dx,
int dy,
Image2<int>& xNear,
236 static bool Interior2 (
Image2<int>& image,
int x,
int y);
237 static bool Interior3 (
Image2<int>& image,
int x,
int y);
238 static bool Interior4 (
Image2<int>& image,
int x,
int y);
241 static bool IsArticulation (
Image2<int>& image,
int x,
int y);
242 static bool ClearInteriorAdjacent (
Image2<int>& image,
int value);
243 static int const msArticulation[256];
247 template <
typename PixelType>
249 PixelType foreColor, PixelType backColor)
263 std::vector<int> xStack(numPixels), yStack(numPixels);
279 image(x, y) = foreColor;
282 if (xp1 < dim0 &&
image(xp1, y) == backColor)
292 if (0 <= xm1 &&
image(xm1, y) == backColor)
302 if (yp1 < dim1 &&
image(x, yp1) == backColor)
312 if (0 <= ym1 &&
image(x, ym1) == backColor)
326 template <
typename PixelType>
328 PixelType foreColor, PixelType backColor,
329 std::function<
void(
int,
int, PixelType)>
const& setCallback,
330 std::function<PixelType(
int,
int)>
const& getCallback)
341 int const numPixels = xSize * ySize;
342 std::vector<int> xStack(numPixels), yStack(numPixels);
358 setCallback(x, y, foreColor);
361 if (xp1 < xSize && getCallback(xp1, y) == backColor)
371 if (0 <= xm1 && getCallback(xm1, y) == backColor)
381 if (yp1 < ySize && getCallback(x, yp1) == backColor)
391 if (0 <= ym1 && getCallback(x, ym1) == backColor)
int GetDimension(int d) const
GLenum GLenum GLsizei void * image
GLsizei const GLfloat * value
size_t GetNumPixels() const
static void FloodFill4(Image2< PixelType > &image, int x, int y, PixelType foreColor, PixelType backColor)
GLuint GLfloat GLfloat GLfloat x1
GLenum GLenum GLenum input
GLenum GLenum GLuint components
GLuint GLfloat GLfloat y0
GLuint GLenum GLenum transform
GLdouble GLdouble GLdouble GLdouble top
static void DrawFloodFill4(int x, int y, int xSize, int ySize, PixelType foreColor, PixelType backColor, std::function< void(int, int, PixelType)> const &setCallback, std::function< PixelType(int, int)> const &getCallback)