Welcome to the EyeBot  Version 7 - RPi1
A Controller For Various Hardware IO
Functions
camera.c File Reference

Camera routines for the Raspberry Pi 2, modded for the EyeBot. More...

#include "camera.h"
#include "stdio.h"
#include "imageProc.h"

Functions

int CAMInit (int mode)
 Initialise the camera. More...
 
int CAMSetMode (int mode)
 Set the camera mode (e.g. format and resolution). More...
 
int CAMGetMode (void)
 Retrieves the current camera mode. More...
 
int CAMGet (BYTE *buf)
 Retrieve a camera frame into the provided buffer. More...
 
int CAMRelease (void)
 Stops and releases all camera structures. More...
 
int CAMGetGray (BYTE *buf)
 Grabs a gray image off the camera. More...
 

Detailed Description

Camera routines for the Raspberry Pi 2, modded for the EyeBot.

Author
Jeremy Tan & Marcus Pham

Function Documentation

int CAMGet ( BYTE *  buf)

Retrieve a camera frame into the provided buffer.

Parameters
[in]bufThe buffer to copy the camera frame into. The supplied buffer must be large enough to acommodate the size of the image, as defined by the camera mode.
Returns
Nonzero on success, zero on failure. On failure, the contents of buf is undefined.

Retrieves the current camera frame and copies it into the supplied buffer. CAMInit must have been called previously.

int CAMGetGray ( BYTE *  buf)

Grabs a gray image off the camera.

Parameters
thebyte stream to store the image data, data in Gray format
Returns
0 iff initialised correctly, otherwise 1
int CAMGetMode ( void  )

Retrieves the current camera mode.

Returns
The camera mode, or CAM_NONE on error.

CAMInit must have been called previously.

int CAMInit ( int  mode)

Initialise the camera.

Parameters
[in]modeThe mode to set the camera in
Returns
Nonzero on success, zero on failure.

Establishes the camera functions. This function must be called before any of the other camera functions.

int CAMRelease ( void  )

Stops and releases all camera structures.

Returns
Nonzero on success, zero on failure.

Releases all allocated memory and stops video capture.

int CAMSetMode ( int  mode)

Set the camera mode (e.g. format and resolution).

Parameters
[in]modeThe camera mode to be set to
Returns
Nonzero on success, zero on failure.

Sets the camera mode. CAMInit must have been called previously.