CMUcam4 Arduino Interface Library  For Firmware Versions 1.00 - 1.03
Application Programmable Interface Online Documentation
 All Classes Files Functions Variables Macros Pages
Public Member Functions
CMUcam4 Class Reference

The CMUcam4 class implements a generic C++ interface library for the CMUcam4. More...

#include <CMUcam4.h>

List of all members.

Public Member Functions

 CMUcam4 ()
 Initialize the CMUcam4 object to use the default Serial port.
 CMUcam4 (int port)
 Initialize the CMUcam4 object to use the port Serial port.
int getPixel (CMUcam4_image_data_t *pointer, int row, int column)
 Gets a pixel (0 or 1) from a binary bitmap data structure.
int setPixel (CMUcam4_image_data_t *pointer, int row, int column, int value)
 Sets a pixel (0 or 1) in a binary bitmap data structure.
int andPixels (CMUcam4_image_data_t *destination, CMUcam4_image_data_t *source0, CMUcam4_image_data_t *source1)
 Logically AND's two binary bitmaps together - useful for image manipulation.
int orPixels (CMUcam4_image_data_t *destination, CMUcam4_image_data_t *source0, CMUcam4_image_data_t *source1)
 Logically OR's two binary bitmaps together - useful for image manipulation.
int xorPixels (CMUcam4_image_data_t *destination, CMUcam4_image_data_t *source0, CMUcam4_image_data_t *source1)
 Logically XOR's two binary bitmaps together - useful for image manipulation.
int notPixels (CMUcam4_image_data_t *destination)
 Logically NOT's a binary bitmap - useful for image manipulation.
int isReadOnly (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is read-only (0 or 1).
int isHidden (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is hidden (0 or 1).
int isSystem (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is system (0 or 1).
int isVolumeID (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is the volume ID (0 or 1).
int isDirectory (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is a directory (0 or 1).
int isArchive (CMUcam4_directory_entry_t *pointer)
 Returns if a directory entry is ready to archive (0 or 1).
int begin ()
 Activates the interface library.
int end ()
 Deactivates the interface library.
int getVersion ()
 Gets the CMUcam4's firmware version number.
int resetSystem ()
 Resets the CMUcam4 device.
int sleepDeeply ()
 Causes the CMUcam4 to sleep deeply.
int sleepLightly ()
 Causes the CMUcam4 to sleep lightly.
int cameraBrightness (int brightness)
 Change the camera brightness setting - useful for low brightness situations.
int cameraContrast (int contrast)
 Change the camera contrast setting - useful for low contrast situations.
int cameraRegisterRead (int reg)
 Read a camera register value.
int cameraRegisterWrite (int reg, int value, int mask)
 Write a camera register value.
int autoGainControl (int active)
 Turns the camera automatic gain control off or on.
int autoWhiteBalance (int active)
 Turns the camera automatic white balance off or on.
int horizontalMirror (int active)
 Horizontally mirror the camera module image.
int verticalFlip (int active)
 Vertically flip the camera module image.
int blackAndWhiteMode (int active)
 Cause the camera to output a black and white image.
int negativeMode (int active)
 Cause the camera to output a negative image.
int getButtonState ()
 Returns the user button state on the CMUcam4.
long getButtonDuration ()
 Returns the user button duration in the current state on the CMUcam4 in milliseconds.
int getButtonPressed ()
 Returns if the user button was pressed.
int getButtonReleased ()
 Returns if the user button was released.
int panInput ()
 Gets the digital state of the pan pin on the CMUcam4.
int panOutput (int direction, int output)
 Sets the digital state of the pan pin on the CMUcam4.
int tiltInput ()
 Gets the digital state of the tilt pin on the CMUcam4.
int tiltOutput (int direction, int output)
 Sets the digital state of the tilt pin on the CMUcam4.
int getInputs ()
 Gets the digital states of the pan and tilt pins on the CMUcam4.
int setOutputs (int directions, int outputs)
 Sets the digital states of the pan and tilt pins on the CMUcam4.
int LEDOff ()
 Disables the auxiliary LED on the CMUcam4.
int LEDOn (long frequency)
 Enables the auxiliary LED on the CMUcam4.
int getServoPosition (int servo)
 Gets the pan or tilt servo pulse length in microseconds.
int setServoPosition (int servo, int active, int pulseLength)
 Sets the pan or tilt servo pulse length in microseconds.
int automaticPan (int active, int reverse)
 Setup automatic pan control.
int automaticTilt (int active, int reverse)
 Setup automatic tilt control.
int autoPanParameters (int proportionalGain, int derivativeGain)
 Setup automatic pan control gain values.
int autoTiltParameters (int proportionalGain, int derivativeGain)
 Setup automatic tilt control gain values.
int monitorOff ()
 Turn the television monitor signal off.
int monitorOn ()
 Turn the television monitor signal on.
int monitorFreeze (int active)
 Freeze the television monitor signal.
int monitorSignal (int active)
 Change the television monitor signal.
int getTrackingParameters (CMUcam4_tracking_parameters_t *pointer)
 Populates a CMUcam4_tracking_parameters_t data structure with the current color tracking threshold parameters in use by the CMUcam4.
int getTrackingWindow (CMUcam4_tracking_window_t *pointer)
 Populates a CMUcam4_tracking_window_t data structure with the current color tracking window parameters in use by the CMUcam4.
int setTrackingParameters ()
 Reset the color tracking threshold parameters to track all possible colors.
int setTrackingParameters (int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax)
 Set the color tracking threshold parameters to track a range of colors.
int setTrackingWindow ()
 Reset the color tracking window parameters to track all possible pixels.
int setTrackingWindow (int topLeftX, int topLeftY, int bottomRightX, int bottomRightY)
 Set the color tracking window parameters to track a range of pixels.
int idleCamera ()
 Causes the CMUcam4 to enter idle mode and do nothing.
int trackColor ()
 Causes the CMUcam4 to enter stream mode and begin sending type T data packets.
int trackColor (int redMin, int redMax, int greenMin, int greenMax, int blueMin, int blueMax)
 Causes the CMUcam4 to enter stream mode and begin sending type T data packets.
int trackWindow (int redRange, int greenRange, int blueRange)
 Causes the CMUcam4 to enter stream mode and begin sending type T data packets.
int getHistogram (int channel, int bins)
 Causes the CMUcam4 to enter stream mode and begin sending type H data packets.
int getMean ()
 Causes the CMUcam4 to enter stream mode and begin sending type S data packets.
int getTypeFDataPacket (CMUcam4_image_data_t *pointer)
 Waits for a type F data packet to appear in the data stream from the CMUcam4 and stores that type F data packet in a CMUcam4_image_data_t data strucutre.
int getTypeHDataPacket (CMUcam4_histogram_data_1_t *pointer)
 Waits for a type H-1 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_1_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_2_t *pointer)
 Waits for a type H-2 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_2_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_4_t *pointer)
 Waits for a type H-4 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_4_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_8_t *pointer)
 Waits for a type H-8 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_8_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_16_t *pointer)
 Waits for a type H-16 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_16_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_32_t *pointer)
 Waits for a type H-32 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_32_t data structure.
int getTypeHDataPacket (CMUcam4_histogram_data_64_t *pointer)
 Waits for a type H-64 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_64_t data structure.
int getTypeSDataPacket (CMUcam4_statistics_data_t *pointer)
 Waits for a type S data packet to appear in the data stream from the CMUcam4 and stores that type S data packet in a CMUcam4_statistics_data_t data structure.
int getTypeTDataPacket (CMUcam4_tracking_data_t *pointer)
 Waits for a type T data packet to appear in the data stream from the CMUcam4 and stores that type T data packet in a CMUcam4_tracking_data_t data strucutre.
int pollMode (int active)
 Turn poll mode off or on.
int lineMode (int active)
 Turn line mode off or on.
int switchingMode (int active)
 Turn switching mode off or on.
int testMode (int active)
 Turn test mode off or on.
int colorTracking (int active)
 Turn color tracking off or on.
int histogramTracking (int active)
 Turn histogram tracking off or on.
int invertedFilter (int active)
 Turn the inverted filter off or on.
int noiseFilter (int threshold)
 Turn the noise filter off or on.
int changeAttributes (const char *fileOrDirectoryPathName, const char *attributes)
 Change a file's or directory's attributes on the disk.
int changeDirectory (const char *directoryPathAndName)
 Change the working directory.
int diskInformation (CMUcam4_disk_information_t *pointer)
 Get information about the disk's geometry.
int diskSpace (CMUcam4_disk_space_t *pointer)
 Get information about the disk's free and used sector space.
int formatDisk ()
 Deletes all files and directories on the disk.
long listDirectory (CMUcam4_directory_entry_t *pointer, size_t size, unsigned long offset)
 Reads all or part of the entries in the working directory to a buffer.
int makeDirectory (const char *directoryPathAndName)
 Makes a new directory on the disk.
int moveEntry (const char *oldEntryPathAndName, const char *newEntryPathAndName)
 Moves a file or directory on the disk.
int printLine (const char *filePathAndName, const char *textToAppend)
 Prints a line of text to a file.
long filePrint (const char *filePathAndName, uint8_t *buffer, size_t size, unsigned long offset)
 Reads all or part of a file to a buffer.
int removeEntry (const char *fileOrDirectoryPathAndName)
 Deletes a file or empty directory on the disk.
int unmountDisk ()
 Unmounts the micro secure digital card.
int dumpBitmap ()
 Saves an 80x60 binary bitmap to the disk in BMP file format.
int dumpFrame (int horizontalResolution, int verticalResolution)
 Saves an 640:320:160:80x480:240:120:60 image to the disk in BMP file format.
int sendBitmap (CMUcam4_image_data_t *pointer)
 Receive an 80x60 binary bitmap from the CMUcam4.
int sendFrame (int horizontalResolution, int verticalResolution, uint16_t *buffer, size_t horizonalSize, size_t horizontalOffset, size_t verticalSize, size_t verticalOffset)
 Receive an 640:320:160:80x480:240:120:60 image from the CMUcam4.

Detailed Description

The CMUcam4 class implements a generic C++ interface library for the CMUcam4.

This interface library provides a wrapper function for all native CMUcam4 functions. Addtionally, this interface library has built in utility functions for manipulating data structures and low level camera settings.

Definition at line 1081 of file CMUcam4.h.


Constructor & Destructor Documentation

CMUcam4 ( int  port)

Initialize the CMUcam4 object to use the port Serial port.

Parameters:
[in]portThe port.
See also:
CMUCOM4_SERIAL
CMUCOM4_SERIAL1
CMUCOM4_SERIAL2
CMUCOM4_SERIAL3

Definition at line 34 of file CMUcam4.cpp.


Member Function Documentation

int getPixel ( CMUcam4_image_data_t pointer,
int  row,
int  column 
)

Gets a pixel (0 or 1) from a binary bitmap data structure.

Parameters:
[in]pointerA pointer to the binary bitmap data structure.
[in]rowThe pixel row. Must be between 0 and 59.
[in]columnThe pixel column. Must be between 0 and 79.
Returns:
The pixel value on success and a negative error value on failure.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()
CMUCAM4_GET_PIXEL()

Definition at line 46 of file CMUcam4.cpp.

int setPixel ( CMUcam4_image_data_t pointer,
int  row,
int  column,
int  value 
)

Sets a pixel (0 or 1) in a binary bitmap data structure.

Parameters:
[out]pointerA pointer to the binary bitmap data structure.
[in]rowThe pixel row. Must be between 0 and 59.
[in]columnThe pixel column. Must be between 0 and 79.
[in]valueThe pixel value (0 or 1).
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()
CMUCAM4_SET_PIXEL()

Definition at line 60 of file CMUcam4.cpp.

int andPixels ( CMUcam4_image_data_t destination,
CMUcam4_image_data_t source0,
CMUcam4_image_data_t source1 
)

Logically AND's two binary bitmaps together - useful for image manipulation.

Parameters:
[out]destinationA pointer to a binary bitmap data structure.
[in]source0A pointer to a binary bitmap data structure.
[in]source1A pointer to a binary bitmap data structure.
Returns:
Zero on success and a negative value if any parameter is invalid.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()

Definition at line 81 of file CMUcam4.cpp.

int orPixels ( CMUcam4_image_data_t destination,
CMUcam4_image_data_t source0,
CMUcam4_image_data_t source1 
)

Logically OR's two binary bitmaps together - useful for image manipulation.

Parameters:
[out]destinationA pointer to a binary bitmap data structure.
[in]source0A pointer to a binary bitmap data structure.
[in]source1A pointer to a binary bitmap data structure.
Returns:
Zero on success and a negative value if any parameter is invalid.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()

Definition at line 101 of file CMUcam4.cpp.

int xorPixels ( CMUcam4_image_data_t destination,
CMUcam4_image_data_t source0,
CMUcam4_image_data_t source1 
)

Logically XOR's two binary bitmaps together - useful for image manipulation.

Parameters:
[out]destinationA pointer to a binary bitmap data structure.
[in]source0A pointer to a binary bitmap data structure.
[in]source1A pointer to a binary bitmap data structure.
Returns:
Zero on success and a negative value if any parameter is invalid.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()

Definition at line 121 of file CMUcam4.cpp.

int notPixels ( CMUcam4_image_data_t destination)

Logically NOT's a binary bitmap - useful for image manipulation.

Parameters:
[in,out]destinationA pointer to a binary bitmap data structure.
Returns:
Zero on success and a negative value if any parameter is invalid.
See also:
CMUcam4_image_data_t
CMUcam4::getTypeFDataPacket()
CMUcam4::sendBitmap()

Definition at line 141 of file CMUcam4.cpp.

int isReadOnly ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is read-only (0 or 1).

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if read-only, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 159 of file CMUcam4.cpp.

int isHidden ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is hidden (0 or 1).

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if hidden, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 172 of file CMUcam4.cpp.

int isSystem ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is system (0 or 1).

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if system, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 185 of file CMUcam4.cpp.

int isVolumeID ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is the volume ID (0 or 1).

This function is included for completeness only. The CMUcam4's listDirectory function does not list the volume ID located in the root directory.

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if ID, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 198 of file CMUcam4.cpp.

int isDirectory ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is a directory (0 or 1).

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if a directory, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 211 of file CMUcam4.cpp.

int isArchive ( CMUcam4_directory_entry_t pointer)

Returns if a directory entry is ready to archive (0 or 1).

Parameters:
[in]pointerA pointer to a directory entry data structure.
Returns:
1 if ready to archive, 0 if not, and a negative value if pointer is NULL.
See also:
CMUcam4_directory_entry_t
CMUcam4::listDirectory()

Definition at line 224 of file CMUcam4.cpp.

int begin ( )

Activates the interface library.

Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::end()

Definition at line 241 of file CMUcam4.cpp.

int end ( )

Deactivates the interface library.

Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::begin()

Definition at line 364 of file CMUcam4.cpp.

int getVersion ( )

Gets the CMUcam4's firmware version number.

Returns:
The version number on success and a negative error value on failure.
See also:
CMUCAM4_FIRMWARE_V100
CMUCAM4_FIRMWARE_V101
CMUCAM4_FIRMWARE_V102
CMUCAM4_FIRMWARE_V103

Definition at line 381 of file CMUcam4.cpp.

int resetSystem ( )

Resets the CMUcam4 device.

Returns:
0 on success and a negative error value on failure.

Definition at line 386 of file CMUcam4.cpp.

int sleepDeeply ( )

Causes the CMUcam4 to sleep deeply.

This disables servo outputs.

Returns:
0 on success and a negative error value on failure.

Definition at line 391 of file CMUcam4.cpp.

int sleepLightly ( )

Causes the CMUcam4 to sleep lightly.

This does not disable servo outputs.

Returns:
0 on success and a negative error value on failure.

Definition at line 396 of file CMUcam4.cpp.

int cameraBrightness ( int  brightness)

Change the camera brightness setting - useful for low brightness situations.

Parameters:
[in]brightnessBetween -127 and 127. The default is 0.
Returns:
0 on success and a negative error value on failure.

Definition at line 405 of file CMUcam4.cpp.

int cameraContrast ( int  contrast)

Change the camera contrast setting - useful for low contrast situations.

Parameters:
[in]contrastBetween -31 and 31. The default is 0.
Returns:
0 on success and a negative error value on failure.

Definition at line 413 of file CMUcam4.cpp.

int cameraRegisterRead ( int  reg)

Read a camera register value.

Parameters:
[in]regThe register address. Between 0 and 255.
Returns:
The register value on success and a negative error value on failure.

Definition at line 421 of file CMUcam4.cpp.

int cameraRegisterWrite ( int  reg,
int  value,
int  mask 
)

Write a camera register value.

Parameters:
[in]regThe register address. Between 0 and 255.
[in]valueThe value to write. Between 0 and 255.
[in]maskThe mask of bit positions to write to. Between 0 and 255.
Returns:
0 on success and a negative error value on failure.

Definition at line 429 of file CMUcam4.cpp.

int autoGainControl ( int  active)

Turns the camera automatic gain control off or on.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 441 of file CMUcam4.cpp.

int autoWhiteBalance ( int  active)

Turns the camera automatic white balance off or on.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 449 of file CMUcam4.cpp.

int horizontalMirror ( int  active)

Horizontally mirror the camera module image.

Parameters:
[in]active0 for normal mode and 1 for horizontally mirrored mode.
Returns:
0 on success and a negative error value on failure.

Definition at line 461 of file CMUcam4.cpp.

int verticalFlip ( int  active)

Vertically flip the camera module image.

Parameters:
[in]active0 for normal mode and 1 for vertically flipped mode.
Returns:
0 on success and a negative error value on failure.

Definition at line 469 of file CMUcam4.cpp.

int blackAndWhiteMode ( int  active)

Cause the camera to output a black and white image.

Parameters:
[in]active0 for normal mode and 1 for black and white mode.
Returns:
0 on success and a negative error value on failure.

Definition at line 481 of file CMUcam4.cpp.

int negativeMode ( int  active)

Cause the camera to output a negative image.

Parameters:
[in]active0 for normal mode and 1 for negative mode.
Returns:
0 on success and a negative error value on failure.

Definition at line 489 of file CMUcam4.cpp.

int getButtonState ( )

Returns the user button state on the CMUcam4.

0 for released. 1 for pressed.

Returns:
0 or 1 on success and a negative error value on failure.

Definition at line 501 of file CMUcam4.cpp.

long getButtonDuration ( )

Returns the user button duration in the current state on the CMUcam4 in milliseconds.

Between 0 and 65,535 milliseconds.

Returns:
The button duration in state in milliseconds on success and a negative error value on failure.

Definition at line 506 of file CMUcam4.cpp.

int getButtonPressed ( )

Returns if the user button was pressed.

0 for no and 1 for yes.

Returns:
0 or 1 on success and a negative error value on failure.

Definition at line 527 of file CMUcam4.cpp.

int getButtonReleased ( )

Returns if the user button was released.

0 for no and 1 for yes.

Returns:
0 or 1 on success and a negative error value on failure.

Definition at line 532 of file CMUcam4.cpp.

int panInput ( )

Gets the digital state of the pan pin on the CMUcam4.

Returns:
0 or 1 on success and a negative error value on failure.

Definition at line 537 of file CMUcam4.cpp.

int panOutput ( int  direction,
int  output 
)

Sets the digital state of the pan pin on the CMUcam4.

Parameters:
[in]directionThe boolean direction state. 0 for input. 1 for output.
[in]outputThe boolean output state. 0 for low. 1 for high.
Returns:
0 on success and a negative error value on failure.

Definition at line 542 of file CMUcam4.cpp.

int tiltInput ( )

Gets the digital state of the tilt pin on the CMUcam4.

Returns:
0 or 1 on success and a negative error value on failure.

Definition at line 550 of file CMUcam4.cpp.

int tiltOutput ( int  direction,
int  output 
)

Sets the digital state of the tilt pin on the CMUcam4.

Parameters:
[in]directionThe boolean direction state. 0 for input. 1 for output.
[in]outputThe boolean output state. 0 for low. 1 for high.
Returns:
0 on success and a negative error value on failure.

Definition at line 555 of file CMUcam4.cpp.

int getInputs ( )

Gets the digital states of the pan and tilt pins on the CMUcam4.

The pan pin is bit 0. The tilt pin is bit 1.

Returns:
0, 1, 2, or 3 on success and a negative error value on failure.

Definition at line 563 of file CMUcam4.cpp.

int setOutputs ( int  directions,
int  outputs 
)

Sets the digital states of the pan and tilt pins on the CMUcam4.

The pan pin is bit 0. The tilt pin is bit 1.

Parameters:
[in]directionsThe boolean direction states. 0 for input. 1 for output.
[in]outputsThe boolean output states. 0 for low. 1 for high.
Returns:
0 on success and a negative error value on failure.

Definition at line 568 of file CMUcam4.cpp.

int LEDOff ( )

Disables the auxiliary LED on the CMUcam4.

Returns:
0 on success and a negative error value on failure.

Definition at line 576 of file CMUcam4.cpp.

int LEDOn ( long  frequency)

Enables the auxiliary LED on the CMUcam4.

Parameters:
[in]frequencyThe frequency to blink the auxiliary to at. Between 0 Hz and 10,000,000 Hz. -1 to turn off.
Returns:
0 on success and a negative error value on failure.

Definition at line 581 of file CMUcam4.cpp.

int getServoPosition ( int  servo)

Gets the pan or tilt servo pulse length in microseconds.

Between 750 to 2,250 us - 0 when the servo is disabled.

Parameters:
[in]servoThe servo number. 0 for pan and 1 for tilt.
Returns:
The pulse length on success and a negative error value on failure.

Definition at line 593 of file CMUcam4.cpp.

int setServoPosition ( int  servo,
int  active,
int  pulseLength 
)

Sets the pan or tilt servo pulse length in microseconds.

Between 750 to 2,250 us.

Parameters:
[in]servoThe servo number. 0 for pan and 1 for tilt.
[in]activeThe servo state. 0 for disabled and 1 for enabled.
[in]pulseLengthThe servo pulse length in microseconds.
Returns:
0 on success and a negative error value on failure.

Definition at line 601 of file CMUcam4.cpp.

int automaticPan ( int  active,
int  reverse 
)

Setup automatic pan control.

Parameters:
[in]activeThe function state. 0 for disabled and 1 for enabled.
[in]reverse0 for not reversed and 1 for reversed.
Returns:
0 on success and a negative error value on failure.

Definition at line 609 of file CMUcam4.cpp.

int automaticTilt ( int  active,
int  reverse 
)

Setup automatic tilt control.

Parameters:
[in]activeThe function state. 0 for disabled and 1 for enabled.
[in]reverse0 for not reversed and 1 for reversed.
Returns:
0 on success and a negative error value on failure.

Definition at line 617 of file CMUcam4.cpp.

int autoPanParameters ( int  proportionalGain,
int  derivativeGain 
)

Setup automatic pan control gain values.

Parameters:
[in]proportionalGainPD loop P gain. Between 0 (disable) and 1000.
[in]derivativeGainPD loop D gain. Between 0 (disable) and 1000.
Returns:
0 on success and a negative error value on failure.

Definition at line 625 of file CMUcam4.cpp.

int autoTiltParameters ( int  proportionalGain,
int  derivativeGain 
)

Setup automatic tilt control gain values.

Parameters:
[in]proportionalGainPD loop P gain. Between 0 (disable) and 1000.
[in]derivativeGainPD loop D gain. Between 0 (disable) and 1000.
Returns:
0 on success and a negative error value on failure.

Definition at line 633 of file CMUcam4.cpp.

int monitorOff ( )

Turn the television monitor signal off.

Returns:
0 on success and a negative error value on failure.

Definition at line 645 of file CMUcam4.cpp.

int monitorOn ( )

Turn the television monitor signal on.

Returns:
0 on success and a negative error value on failure.

Definition at line 650 of file CMUcam4.cpp.

int monitorFreeze ( int  active)

Freeze the television monitor signal.

Parameters:
[in]active0 to unfreeze and 1 to freeze.
Returns:
0 on success and a negative error value on failure.

Definition at line 655 of file CMUcam4.cpp.

int monitorSignal ( int  active)

Change the television monitor signal.

Parameters:
[in]active0 for NTSC and 1 for PAL.
Returns:
0 on success and a negative error value on failure.

Definition at line 663 of file CMUcam4.cpp.

int getTrackingParameters ( CMUcam4_tracking_parameters_t pointer)

Populates a CMUcam4_tracking_parameters_t data structure with the current color tracking threshold parameters in use by the CMUcam4.

Parameters:
[out]pointerA pointer to a CMUcam4_tracking_parameters_t data structure.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4_tracking_parameters_t

Definition at line 675 of file CMUcam4.cpp.

int getTrackingWindow ( CMUcam4_tracking_window_t pointer)

Populates a CMUcam4_tracking_window_t data structure with the current color tracking window parameters in use by the CMUcam4.

Parameters:
[out]pointerA pointer to a CMUcam4_tracking_window_t data structure.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4_tracking_window_t

Definition at line 707 of file CMUcam4.cpp.

int setTrackingParameters ( )

Reset the color tracking threshold parameters to track all possible colors.

Returns:
0 on success and a negative error value on failure.

Definition at line 737 of file CMUcam4.cpp.

int setTrackingParameters ( int  redMin,
int  redMax,
int  greenMin,
int  greenMax,
int  blueMin,
int  blueMax 
)

Set the color tracking threshold parameters to track a range of colors.

A pixel's red, green, and blue components must fall between the redMin, redMax, greenMin, greenMax, blueMin, and blueMax thresholds for the pixel to be tracked.

Parameters:
[in]redMinThe minimum red threshold - between 0 to 255.
[in]redMaxThe maximum red threshold - between 0 to 255.
[in]greenMinThe minimum green threshold - between 0 to 255.
[in]greenMaxThe maximum green threshold - between 0 to 255.
[in]blueMinThe minimum blue threshold - between 0 to 255.
[in]blueMaxThe maximum blue threshold - between 0 to 255.
Returns:
0 on success and a negative error value on failure.

Definition at line 742 of file CMUcam4.cpp.

int setTrackingWindow ( )

Reset the color tracking window parameters to track all possible pixels.

Returns:
0 on success and a negative error value on failure.

Definition at line 754 of file CMUcam4.cpp.

int setTrackingWindow ( int  topLeftX,
int  topLeftY,
int  bottomRightX,
int  bottomRightY 
)

Set the color tracking window parameters to track a range of pixels.

A pixel's horizontal position and vertical position must fall between the topLeftX, topLeftY, bottomRightX, and bottomRightY positions for the pixel to be tracked.

Parameters:
[in]topLeftXTop left X position (X1) - between 0 and 159.
[in]topLeftYTop left Y position (Y1) - between 0 and 119.
[in]bottomRightXBottom right X position (X2) - between X1 and 159.
[in]bottomRightYBottom right Y position (Y2) - between Y2 and 119.
Returns:
0 on success and a negative error value on failure.

Definition at line 759 of file CMUcam4.cpp.

int idleCamera ( )

Causes the CMUcam4 to enter idle mode and do nothing.

The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called.

Returns:
0 on success and a negative error value on failure.

Definition at line 770 of file CMUcam4.cpp.

int trackColor ( )

Causes the CMUcam4 to enter stream mode and begin sending type T data packets.

Only the getType_DataPackets functions may be called after calling this function to get packets. The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called. This function doesn't change the color tracking settings when called.

Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeTDataPacket()

Definition at line 804 of file CMUcam4.cpp.

int trackColor ( int  redMin,
int  redMax,
int  greenMin,
int  greenMax,
int  blueMin,
int  blueMax 
)

Causes the CMUcam4 to enter stream mode and begin sending type T data packets.

Only the getType_DataPackets functions may be called after calling this function to get packets. The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called. This function does change the color tracking settings when called.

Parameters:
[in]redMinThe minimum red threshold - between 0 to 255.
[in]redMaxThe maximum red threshold - between 0 to 255.
[in]greenMinThe minimum green threshold - between 0 to 255.
[in]greenMaxThe maximum green threshold - between 0 to 255.
[in]blueMinThe minimum blue threshold - between 0 to 255.
[in]blueMaxThe maximum blue threshold - between 0 to 255.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeTDataPacket()

Definition at line 809 of file CMUcam4.cpp.

int trackWindow ( int  redRange,
int  greenRange,
int  blueRange 
)

Causes the CMUcam4 to enter stream mode and begin sending type T data packets.

Only the getType_DataPackets functions may be called after calling this function to get packets. The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called. This function automatically changes the color tracking settings when called.

Parameters:
[in]redRangeThe red average from the center of the color tracking window plus and minus the redRange is used to set the redMax and redMin values for the color tracking threshold parameters.
[in]greenRangeThe green average from the center of the color tracking window plus and minus the greenRange is used to set the greenMax and greenMin values for the color tracking threshold parameters.
[in]blueRangeThe blue average from the center of the color tracking window plus and minus the blueRange is used to set the blueMax and blueMin values for the color tracking threshold parameters.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeTDataPacket()

Definition at line 821 of file CMUcam4.cpp.

int getHistogram ( int  channel,
int  bins 
)

Causes the CMUcam4 to enter stream mode and begin sending type H data packets.

Only the getType_DataPackets functions may be called after calling this function to get packets. The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called. The red and blue channels can have up to 32 bins. The green channel can have up to 64 bins.

Parameters:
[in]channelThe color channel of the histogram to send: 0 = Red Channel, 1 = Green Channel, 2 = Blue Channel.
[in]binsThe number of bins of the histogram channel to send: 0=1 bin, 1=2 bins, 2=4 bins, 3=8 bins, 4=16 bins, 5=32 bins, 6=64 bins.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_1_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_2_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_4_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_8_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_16_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_32_t * pointer)
CMUcam4::getTypeHDataPacket(CMUcam4_histogram_data_64_t * pointer)

Definition at line 830 of file CMUcam4.cpp.

int getMean ( )

Causes the CMUcam4 to enter stream mode and begin sending type S data packets.

Only the getType_DataPackets functions may be called after calling this function to get packets. The CMUcam4 will automatically exit streaming mode if any function other than the getType_DataPackets functions is called.

Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeSDataPacket()

Definition at line 839 of file CMUcam4.cpp.

int getTypeFDataPacket ( CMUcam4_image_data_t pointer)

Waits for a type F data packet to appear in the data stream from the CMUcam4 and stores that type F data packet in a CMUcam4_image_data_t data strucutre.

A stream of type F data packets must be started first for this function not to fail and timeout waiting for a type F data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_image_data_t data structure to store the received type F data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::lineMode()

Definition at line 844 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_1_t pointer)

Waits for a type H-1 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_1_t data structure.

A stream of type H-1 data packets must be started first for this function not to fail and timeout waiting for a type H-1 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_1_t data structure to store the received type H-1 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 874 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_2_t pointer)

Waits for a type H-2 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_2_t data structure.

A stream of type H-2 data packets must be started first for this function not to fail and timeout waiting for a type H-2 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_2_t data structure to store the received type H-2 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 906 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_4_t pointer)

Waits for a type H-4 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_4_t data structure.

A stream of type H-4 data packets must be started first for this function not to fail and timeout waiting for a type H-4 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_4_t data structure to store the received type H-4 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 938 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_8_t pointer)

Waits for a type H-8 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_8_t data structure.

A stream of type H-8 data packets must be started first for this function not to fail and timeout waiting for a type H-8 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_8_t data structure to store the received type H-8 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 970 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_16_t pointer)

Waits for a type H-16 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_16_t data structure.

A stream of type H-16 data packets must be started first for this function not to fail and timeout waiting for a type H-16 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_16_t data structure to store the received type H-16 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 1002 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_32_t pointer)

Waits for a type H-32 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_32_t data structure.

A stream of type H-32 data packets must be started first for this function not to fail and timeout waiting for a type H-32 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_32_t data structure to store the received type H-32 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 1034 of file CMUcam4.cpp.

int getTypeHDataPacket ( CMUcam4_histogram_data_64_t pointer)

Waits for a type H-64 data packet to appear in the data stream from the CMUcam4 and stores that type H data packet in a CMUcam4_histogram_data_64_t data structure.

A stream of type H-64 data packets must be started first for this function not to fail and timeout waiting for a type H-64 data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_histogram_data_64_t data structure to store the received type H-64 data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getHistogram()
CMUcam4::lineMode()

Definition at line 1066 of file CMUcam4.cpp.

int getTypeSDataPacket ( CMUcam4_statistics_data_t pointer)

Waits for a type S data packet to appear in the data stream from the CMUcam4 and stores that type S data packet in a CMUcam4_statistics_data_t data structure.

A stream of type S data packets must be started first for this function not to fail and timeout waiting for a type S data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_statistics_data_t data structure to store the received type S data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getMean()
CMUcam4::lineMode()
CMUcam4::switchingMode()

Definition at line 1098 of file CMUcam4.cpp.

int getTypeTDataPacket ( CMUcam4_tracking_data_t pointer)

Waits for a type T data packet to appear in the data stream from the CMUcam4 and stores that type T data packet in a CMUcam4_tracking_data_t data strucutre.

A stream of type T data packets must be started first for this function not to fail and timeout waiting for a type T data packet.

Parameters:
[out]pointerA pointer to a CMUcam4_tracking_data_t data structure to store the received type T data packet to.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::trackColor()
CMUcam4::trackWindow()
CMUcam4::lineMode()
CMUcam4::switchingMode()

Definition at line 1129 of file CMUcam4.cpp.

int pollMode ( int  active)

Turn poll mode off or on.

Poll mode causes the CMUcam4 to send one and only one type F, H, S, or T packet after calling CMUcam4::trackColor(), CMUcam4::trackWindow(), CMUcam4::getHistogram(), or CMUcam4::getMean() instead of a stream of packets that the CMUcam4 would normally send.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1156 of file CMUcam4.cpp.

int lineMode ( int  active)

Turn line mode off or on.

Line mode causes the CMUcam4 to send type F data packets after sending type H, S, or T data packets.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.
See also:
CMUcam4::getTypeFDataPacket()
CMUcam4_image_data_t

Definition at line 1164 of file CMUcam4.cpp.

int switchingMode ( int  active)

Turn switching mode off or on.

Switching mode causes the CMUcam4 to send type S data packets after sending type T data packets and vice versa.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1172 of file CMUcam4.cpp.

int testMode ( int  active)

Turn test mode off or on.

Test mode causes the CMUcam4 to process an image of color bars instead of processing the normal image.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1180 of file CMUcam4.cpp.

int colorTracking ( int  active)

Turn color tracking off or on.

If off, then the CMUcam4 operates in RGB mode. In RGB mode R maps to the red channel, G maps to the green channel, and B maps to the blue channel.

If on, then the CMUcam4 operates in YUV mode. In YUV mode Y maps to the green channel, U maps to the blue channel, and V maps to the red channel.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1188 of file CMUcam4.cpp.

int histogramTracking ( int  active)

Turn histogram tracking off or on.

If off, then the CMUcam4 calculates the histogram and image statisitcs on all tracked and untracked pixels inside of the color tracking window.

If on, then the CMUcam4 calculates the histogram and image statisitcs on all tracked pixels inside of the color tracking window.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1196 of file CMUcam4.cpp.

int invertedFilter ( int  active)

Turn the inverted filter off or on.

If off, then the CMUcam4 tracks all pixels that fall inside of the color tracking bounds.

If on, then the CMUcam4 tracks all pixels that fall outside of the color tracking bounds.

Parameters:
[in]active0 for off and 1 for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1204 of file CMUcam4.cpp.

int noiseFilter ( int  threshold)

Turn the noise filter off or on.

For example:
0 to filter out no pixels
1 to filter out the leading 1 pixels in any group of pixels in a row
2 to filter out the leading 2 pixels in any group of pixels in a row
...
255 to filter out the leading 255 pixels in any group of pixels in a row
Parameters:
[in]threshold0 for off and 1 or more for on.
Returns:
0 on success and a negative error value on failure.

Definition at line 1212 of file CMUcam4.cpp.

int changeAttributes ( const char *  fileOrDirectoryPathName,
const char *  attributes 
)

Change a file's or directory's attributes on the disk.

Parameters:
[in]fileOrDirectoryPathNameThe file or directory to change.
[in]attributesThe new attribute string. E.g. "RHSA" or "_".
Returns:
0 on success and a negative error value on failure.

Definition at line 1224 of file CMUcam4.cpp.

int changeDirectory ( const char *  directoryPathAndName)

Change the working directory.

Parameters:
[in]directoryPathAndNameThe directory to change to.
Returns:
0 on success and a negative error value on failure.

Definition at line 1239 of file CMUcam4.cpp.

int diskInformation ( CMUcam4_disk_information_t pointer)

Get information about the disk's geometry.

Parameters:
[out]pointerA pointer to a CMUcam4_disk_information_t structure to be filled with information about the disk's geometry.
Returns:
0 on success and a negative error value on failure.

Definition at line 1253 of file CMUcam4.cpp.

int diskSpace ( CMUcam4_disk_space_t pointer)

Get information about the disk's free and used sector space.

Parameters:
[out]pointerA pointer to a CMUcam4_disk_space_t structure to be filled with information about the disk's free and used sector space.
Returns:
0 on success and a negative error value on failure.

Definition at line 1293 of file CMUcam4.cpp.

int formatDisk ( )

Deletes all files and directories on the disk.

Returns:
0 on success and a negative error value on failure.

Definition at line 1323 of file CMUcam4.cpp.

long listDirectory ( CMUcam4_directory_entry_t pointer,
size_t  size,
unsigned long  offset 
)

Reads all or part of the entries in the working directory to a buffer.

Parameters:
[out]pointerThe array to store directory entry information to.
[in]sizeThe size of the CMUcam4_directory_entry_t array.
[in]offsetThe number of entries to skip before storing.
Returns:
The absolute number of directory entries in the working directory on success and a negative error value on failure.

Definition at line 1328 of file CMUcam4.cpp.

int makeDirectory ( const char *  directoryPathAndName)

Makes a new directory on the disk.

Parameters:
[in]directoryPathAndNameThe new directory to make.
Returns:
0 on success and a negative error value on failure.

Definition at line 1388 of file CMUcam4.cpp.

int moveEntry ( const char *  oldEntryPathAndName,
const char *  newEntryPathAndName 
)

Moves a file or directory on the disk.

Parameters:
[in]oldEntryPathAndNameThe source entry to move.
[in]newEntryPathAndNameThe destination of the entry to move.
Returns:
0 on success and a negative error value on failure.

Definition at line 1402 of file CMUcam4.cpp.

int printLine ( const char *  filePathAndName,
const char *  textToAppend 
)

Prints a line of text to a file.

Parameters:
[in]filePathAndNameThe file to append to.
[in]textToAppendThe string to append to the file.
Returns:
0 on success and a negative error value on failure.

Definition at line 1417 of file CMUcam4.cpp.

long filePrint ( const char *  filePathAndName,
uint8_t *  buffer,
size_t  size,
unsigned long  offset 
)

Reads all or part of a file to a buffer.

Parameters:
[in]filePathAndNameThe file to read.
[out]bufferThe buffer to store all or part of the file to.
[in]sizeThe size of the buffer in bytes.
[in]offsetThe offset in the file to start to read from in bytes.
Returns:
The absolute file size in bytes on success and a negative error value on failure.

Definition at line 1431 of file CMUcam4.cpp.

int removeEntry ( const char *  fileOrDirectoryPathAndName)

Deletes a file or empty directory on the disk.

Parameters:
[in]fileOrDirectoryPathAndNameThe file or directory to delete.
Returns:
0 on success and a negative error value on failure.

Definition at line 1470 of file CMUcam4.cpp.

int unmountDisk ( )

Unmounts the micro secure digital card.

Other file system functions automatically mount the disk by default. This function must be called to explictly unmount the disk before removal.

Returns:
0 on success and a negative error value on failure.

Definition at line 1484 of file CMUcam4.cpp.

int dumpBitmap ( )

Saves an 80x60 binary bitmap to the disk in BMP file format.

The saved binary bitmap is the 160x120 segmented color tracking image down-sampled to 80x60.

Returns:
0 on success and a negative error value on failure.

Definition at line 1493 of file CMUcam4.cpp.

int dumpFrame ( int  horizontalResolution,
int  verticalResolution 
)

Saves an 640:320:160:80x480:240:120:60 image to the disk in BMP file format.

Use this function to get feedback about what the CMUcam4 sees.

Parameters:
[in]horizontalResolutionThe horizontal resolution to save the image with: 0=640 pixels, 1=320 pixels, 2=160 pixels, 3=80 pixels.
[in]verticalResolutionThe vertical resolution to save the image with: 0=480 pixels, 1=240 pixels, 2=160 pixels, 3=60 pixels.
Returns:
0 on success and a negative error value on failure.

Definition at line 1498 of file CMUcam4.cpp.

int sendBitmap ( CMUcam4_image_data_t pointer)

Receive an 80x60 binary bitmap from the CMUcam4.

The sent binary bitmap is the 160x120 segmented color tracking image down-sampled to 80x60.

Parameters:
[out]pointerThe address of where to put the received binary bitmap.
Returns:
0 on success and a negative error value on failure.

Definition at line 1507 of file CMUcam4.cpp.

int sendFrame ( int  horizontalResolution,
int  verticalResolution,
uint16_t *  buffer,
size_t  horizonalSize,
size_t  horizontalOffset,
size_t  verticalSize,
size_t  verticalOffset 
)

Receive an 640:320:160:80x480:240:120:60 image from the CMUcam4.

Use this function to get feedback about what the CMUcam4 sees.

Parameters:
[in]horizontalResolutionThe horizontal resolution to send the image in: 0=640 pixels, 1=320 pixels, 2=160 pixels, 3=80 pixels.
[in]verticalResolutionThe vertical resolution to send the image in: 0=480 pixels, 1=240 pixels, 2=160 pixels, 3=60 pixels.
[out]bufferThe address of where to put the received RGB565 bitmap.
[in]horizonalSizeThe horizontal size of the array in 16-bit words.
[in]horizontalOffsetA horizontal pixel offset within the image to start to store image data from. The horizontalOffset plus the array horizonalSize must be less than or equal the selected horizontal resolution.
[in]verticalSizeThe vertical size of the array.
[in]verticalOffsetA vertical pixel offset within the image to start to store image data from. The verticalOffset plus the array verticalSize must be less than or equal the selected vertical resolution.
Returns:
0 on success and a negative error value on failure.

Definition at line 1537 of file CMUcam4.cpp.


The documentation for this class was generated from the following files: