13 #include <linux/videodev2.h> 16 #define QUOTE(name) #name 17 #define STR(macro) QUOTE(macro) 24 #define RGB24 V4L2_PIX_FMT_RGB24 25 #define BGR24 V4L2_PIX_FMT_BGR24 26 #define YUYV V4L2_PIX_FMT_YUYV 27 #define RGB32 V4L2_PIX_FMT_RGB32 28 #define RGBA32 V4L2_PIX_FMT_RGB32 29 #define RGB48 V4L2_PIX_FMT_RGB48 30 #define GREY V4L2_PIX_FMT_GREY 31 #define MJPEG V4L2_PIX_FMT_MJPEG 34 #define min(a,b) ( a<b ? a : b ) 35 #define max(a,b) ( a>b ? a : b ) 84 void waitTime(
unsigned int milliseconds);
96 Camera * camOpen(
char *dev_name,
unsigned int width,
unsigned int height,
int format);
97 unsigned int camGetWidth(
Camera * cam);
98 unsigned int camGetHeight(
Camera * cam);
101 void camClose(
Camera * cam);
102 int camPrintCaps(
Camera *cam);
110 Image *
imgNew(
unsigned int width,
unsigned int height,
unsigned short depth);
113 Image *imgFromFile(
const char *filename);
114 int imgSavePPM(
Image *img,
char *fname);
115 int imgSavePAM(
Image *img,
char *fname);
120 Image *imgCreateGaussian(
int dim,
float sig);
125 void imgMakeSymmetricX(
Image *img);
126 void imgMakeSymmetricY(
Image *img);
127 void imgMakeSymmetric(
Image *img);
130 int imgGetPixelDifference(
unsigned char *p1,
unsigned char *p2);
133 int x1,
int y1,
int x2,
int y2);
135 int x1,
int y1,
int x2,
int y2);
138 unsigned int imgGetWidth(
Image * img);
139 unsigned int imgGetHeight(
Image * img);
140 void imgSetPixel(
Image * img,
unsigned int x,
unsigned int y,
unsigned char *pdata);
141 void imgSetPixelRGB(
Image * img,
unsigned int x,
unsigned int y,
unsigned char r,
unsigned char g,
unsigned char b);
142 void imgSetPixelRGBA(
Image * img,
unsigned int x,
unsigned int y,
unsigned char r,
unsigned char g,
unsigned char b,
unsigned char a);
145 unsigned char * imgPixel(
Image * img,
unsigned int x,
unsigned int y);
147 void MarkImagePositionRGB(
Image * img,
int x,
int y,
unsigned char r,
unsigned char g,
unsigned char b);
148 void MarkImagePosition(
Image * img,
int x,
int y);
158 Viewer * viewOpen(
unsigned int width,
unsigned int height,
const char * title);
178 #endif // _EASIMAGE_H_ unsigned int width
The width of the image (Number of columns)
Definition: easimage.h:58
unsigned int height
The height of the camera frame (Number of rows)
Definition: easimage.h:48
int viewPollEvent(SDL_Event *event)
Polls for currently pending events.
Definition: viewer.c:48
void quit_easimage()
Quit easimage.
Definition: util.c:58
unsigned int n_buffers
Number of allocated buffers.
Definition: easimage.h:53
Represents an image capturing device.
Definition: easimage.h:46
int imgGetSymmetryError(Image *img, int x, int y, int radius)
Evaluates simmetry error at location.
Definition: image.c:257
long int GetTime()
GetTime.
Definition: util.c:72
unsigned int height
The height of the image (Number of rows)
Definition: easimage.h:70
unsigned int format
Format identifier.
Definition: easimage.h:61
Image * imgFromPPM(const char *filename)
Loads an image from a PPM image file.
Definition: image.c:119
Image * imgNew(unsigned int width, unsigned int height, unsigned short depth)
Creates a new image.
Definition: image.c:35
unsigned int width
The width of the image (Number of columns)
Definition: easimage.h:69
void viewClose(Viewer *view)
Terminates the viewer.
Definition: viewer.c:39
Stores an image.
Definition: easimage.h:57
SDL_Surface * screen
Pointer to screen surface.
Definition: easimage.h:71
int easimageAppEnd
Global termination flag.
Definition: util.c:19
Image * imgConvolution(Image *img1, Image *img2, Image *res)
Image convolution.
Definition: image.c:619
unsigned char * mem_ptr
location of image buffers
Definition: easimage.h:62
void waitTime(unsigned int milliseconds)
Delay for a given number of milliseconds.
Definition: util.c:38
float imgGetMean(Image *img)
Evaluates the pixel component mean value.
Definition: image.c:377
Image * imgFromBitmap(const char *filename)
Loads an image from a BMP image file.
Definition: image.c:81
char * name
The name of the image.
Definition: easimage.h:64
Image * imgCrop(Image *img, int x1, int y1, int x2, int y2)
Crops an image.
Definition: image.c:226
char * name
The name of the device.
Definition: easimage.h:50
int imgFindPatternArea(Image *img, Image *pattern, int x1, int y1, int x2, int y2, int *x, int *y)
Searches image area for a pattern.
Definition: image.c:396
unsigned int format
Format identifier.
Definition: easimage.h:49
int handle
The stream handle.
Definition: easimage.h:51
void imgScale(Image *img, unsigned int sfactor)
Scales an image.
Definition: image.c:180
Represents an image presenting device.
Definition: easimage.h:68
int imgSaveRAW(Image *img, char *fname)
Save RAW file.
Definition: image.c:713
Image * imgCopy(Image *img)
Creates a copy of an Image.
Definition: image.c:200
unsigned int width
The width of the camera frame (Number of columns)
Definition: easimage.h:47
unsigned int height
The height of the image (Number of rows)
Definition: easimage.h:59
void viewDisplayImage(Viewer *view, Image *img)
Displays an Image.
Definition: viewer.c:60
unsigned char * imgGetPixel(Image *img, unsigned int x, unsigned int y)
Gets pixel data.
Definition: image.c:594
void init_easimage()
Init easimage.
Definition: util.c:22
void imgDestroy(Image *img)
Destroys the image.
Definition: image.c:689
unsigned char * data
location of pixel data
Definition: easimage.h:63
int imgFindPattern(Image *img, Image *pattern, int *x, int *y)
Searches image for a pattern.
Definition: image.c:452
unsigned short int depth
The depth of the image (number of bit per pixel)
Definition: easimage.h:60
Image * imgPatternDifference(Image *img, Image *pat, Image *res, int x1, int y1, int x2, int y2)
Searches image for a pattern.
Definition: image.c:297
struct Buffer * buffers
location of image buffers
Definition: easimage.h:52
float imgGetMeanArea(Image *img, int x1, int y1, int x2, int y2)
Evaluates the pixel component mean value.
Definition: image.c:362
int imgGetSumArea(Image *img, int x1, int y1, int x2, int y2)
Evaluates the addition of pixel components.
Definition: image.c:336