#include <stdio.h>#include <stdlib.h>#include <unistd.h>#include <math.h>#include <string.h>#include "include/ellipse.h"Functions | |
| void | ellipseInit (ELLIPSE *ell) |
| void | ellipseEmpty (ELLIPSE *ell) |
| void | ellipseInfo (ELLIPSE *ell) |
| int | ellipseAllocate (ELLIPSE *ell, int imgDim) |
| int | ellipseSetFromParams (ELLIPSE *ell, int imgDim, float *semis, float *cent, float incli, float val) |
| int | ellipseReadEllipse (FILE *fp, ELLIPSE *ell) |
| int | ellipseSaveEllipse (ELLIPSE *ell, FILE *fp) |
| float | ellipseGetMajor (ELLIPSE *ell) |
| float | ellipseGetMinor (ELLIPSE *ell) |
| float | ellipseGetCenterX (ELLIPSE *ell) |
| float | ellipseGetCenterY (ELLIPSE *ell) |
| float | ellipseGetInclination (ELLIPSE *ell) |
| int | ellipseGetImgSize (ELLIPSE *ell) |
| int | ellipseGetValue (ELLIPSE *ell) |
| int ** | ellipseGetArray (ELLIPSE *ell) |
| int | ellipseIsInside (ELLIPSE *ell, int row, int col) |
|
||||||||||||
|
Allocates memory for ELLIPSE data. Normally used only in SET-functions. *ell is initialized && imgDim is positive memory is allocated for ELLIPSE structure.
|
|
|
Frees the memory allocated for ellipse. All data is cleared. . ellipse is emptied.
|
|
|
Returns the ellipse array of the given ellipse. Ellipse array contains n x n items, single item is one if it is inside the ellipse and zero otherwise. Coordinates on a two dimensional plane are numbered from upper left corner. ell is initialized. .
|
|
|
Returns the center x-coordinate of the ellipse. ell is initialized. .
|
|
|
Returns the center y-coordinate of the ellipse. ell is initialized. .
|
|
|
Returns the size of the image plane on which the ellipse is drawn. ell is initialized. .
|
|
|
Returns the inclination of the ellipse. ell is initialized. .
|
|
|
Returns the major semiaxe of the ellipse. ell is initialized. .
|
|
|
Returns the minor semiaxe of the ellipse. ell is initialized. .
|
|
|
Returns the value of the pixels inside the ellipse.
|
|
|
Prints the information of the ellipse to the screen.
|
|
|
Initializes ELLIPSE datatype for use. To be used before any use of ELLIPSE type variables. . ellipse is initialized.
|
|
||||||||||||||||
|
Tests whether the given pixel is inside the given ellipse or not. ell is initialized && 0<=row<=imgDim-1 && 0<=col<=imgDim-1 .
|
|
||||||||||||
|
Reads one ellipse from the given file to the given ELLIPSE structure. A coordinate file contains the parameters of the ellipses in one line in the following order: Coordinate 1: v the additive intensity value of the ellipse Coordinate 2: a the length of the horizontal semi-axis of the ellipse Coordinate 3: b the length of the vertical semi-axis of the ellipse Coordinate 4: x the x-coordinate of the center of the ellipse Coordinate 5: y the y-coordinate of the center of the ellipse Coordinate 6: p the angle (in degrees) between the horizontal semi-axis of the ellipse and the x-axis of the image Coordinate 7: d the image dimension *fp is a pointer to open file containing ellipse(s) in correct format. *ell is initialized an ellipse is read from the file fname.
|
|
||||||||||||
|
Adds the given ellipse to the file. *ell is initialized. ellipse is saved in the file called fname.
|
|
||||||||||||||||||||||||||||
|
Sets the ellipse according to given coordinates and image dimension. Notice that the origin is in the middle. *ell is initialized. imgDim is positive. semis[i] are positive. -imgDim/2<=cent[i]<=imgDim/2. ellipse is set.
|
1.4.1