Go to the documentation of this file.
16 #ifndef EPUCK_CAMERA_HPP
17 #define EPUCK_CAMERA_HPP
51 :logic_error(make_what(wrongVersion)){}
53 std::string make_what(
int wrongVersion);
60 :out_of_range(whatArg){}
67 :length_error(whatArg){}
69 :length_error(make_what(maxWidth, maxHeight)){}
71 std::string make_what(
int maxWidth,
int maxHeight);
105 unsigned sensor_y1,
unsigned sensor_width,
106 unsigned sensor_height,
unsigned zoom_fact_width,
107 unsigned zoom_fact_height,
ColorModes color_mode)
throw();
133 void GetCameraData(
unsigned &imageWidth,
unsigned &imageHeight,
141 void GetImage(
unsigned char*
const ptrImage);
145 static const unsigned PO3030K = 0x3030;
146 static const unsigned PO6030K = 0x6030;
150 unsigned sensor_width;
151 unsigned sensor_height;
152 unsigned zoom_fact_width;
153 unsigned zoom_fact_height;
160 unsigned imageByteSize;
162 unsigned imagePixelSize;
163 unsigned rowPixelLength;
164 unsigned columnPixelLength;
166 unsigned epuckCameraVersion;
168 unsigned char* tmpImage;
169 bool tmpImageAllocated;
173 void checkCameraParameters()
const;
176 template <
typename T>
177 void processTmpImage(T* ptrImage)
const;
Definition: epuckCamera.hpp:56
Class for to get images from e-puck camera.
Definition: epuckCamera.hpp:43
RGB color mode, with 16 bits per pixel.
Definition: epuckCamera.hpp:83
Definition: epuckCamera.hpp:63
EpuckCamera(const SerialPort *const serialPort, unsigned sensor_x1, unsigned sensor_y1, unsigned sensor_width, unsigned sensor_height, unsigned zoom_fact_width, unsigned zoom_fact_height, ColorModes color_mode)
The EpuckCamera class constructor.
Definition: epuckCamera.cpp:43
ColorModes
Possible color modes for e-puck camera.
Definition: epuckCamera.hpp:80
Base class for all concrete interfaces of e-puck.
Definition: epuckInterface.hpp:33
unsigned recvUnsigned() const
Receive an unsigned interger from e-puck.
Definition: serialPort.cpp:115
std::string GetCameraVersion() const
Get the version of camera in e-puck.
Definition: epuckCamera.cpp:174
void GetImage(unsigned char *const ptrImage)
Get a new image from e-puck.
Definition: epuckCamera.cpp:203
void sendInt(int message) const
Send an integer to e-puck.
Definition: serialPort.cpp:172
Send and receive messages from e-puck.
Definition: serialPort.hpp:40
const SerialPort *const serialPort
A SerialPort class instance shared among the device interfaces.
Definition: epuckInterface.hpp:59
Grey color mode, with 8 bits per pixel.
Definition: epuckCamera.hpp:82
void Initialize()
Send the configurations givens in EpuckCamera constructor to e-puck.
Definition: epuckCamera.cpp:135
int recvUnsignedCharArray(unsigned char *const array, unsigned length) const
Receive an array of unsigned char from e-puck.
Definition: serialPort.cpp:148
EpuckInterface(const SerialPort *const serialPort)
The EpuckInterface class constructor.
Definition: epuckInterface.cpp:20
Send configurations for camera initialization.
Definition: epuckInterface.hpp:67
Receive an image from camera.
Definition: epuckInterface.hpp:72
Definition: epuckCamera.hpp:47
char recvChar() const
Receive a char from e-puck.
Definition: serialPort.cpp:134
YUV color mode, with 16 bits per pixel.
Definition: epuckCamera.hpp:84
void GetCameraData(unsigned &imageWidth, unsigned &imageHeight, EpuckCamera::ColorModes &colorMode) const
Get the relevant configurations camera data.
Definition: epuckCamera.cpp:194