Go to the documentation of this file.00001 #ifndef FCAM_BASE_H
00002 #define FCAM_BASE_H
00003
00004 #include <stdlib.h>
00005
00012 namespace FCam {
00013
00015 typedef enum {
00017 RGB24 = 0,
00018
00021 RGB16,
00022
00030 UYVY,
00031
00033 YUV24,
00034
00041 RAW,
00042
00045 UNKNOWN} ImageFormat;
00046
00050 enum BayerPattern {RGGB = 0,
00051 BGGR,
00052 GRBG,
00053 GBRG,
00054 NotBayer
00055 };
00056
00058 int bytesPerPixel(ImageFormat);
00059
00062 struct Size {
00064 Size() : width(0), height(0) {}
00065
00067 Size(int w, int h) : width(w), height(h) {}
00068
00070 bool operator==(const Size &other) const {return width == other.width && height == other.height;}
00071
00073 bool operator!=(const Size &other) const {return width != other.width || height != other.height;}
00074
00075 int width;
00076 int height;
00077 };
00078
00080 struct Rect {
00082 Rect() : x(0), y(0), width(0), height(0) {}
00083
00086 Rect(int x_, int y_, int w_, int h_) : x(x_), y(y_), width(w_), height(h_) {}
00087
00089 bool operator==(const Rect &other) const {
00090 return (width == other.width &&
00091 height == other.height &&
00092 x == other.x &&
00093 y == other.y);
00094 }
00095
00097 bool operator!=(const Rect &other) const {
00098 return (width != other.width ||
00099 height != other.height ||
00100 x != other.x ||
00101 y != other.y);
00102 }
00103
00104 int x;
00105 int y;
00106 int width;
00107 int height;
00108 };
00109
00112 #define fcamPanic(fmt, ...) panic(__FILE__, __LINE__, fmt, __VA_ARGS__)
00113 void panic(const char* fileName, int line, const char *fmt, ...);
00114
00115 }
00116
00117 #endif