Important changes to repositories hosted on mbed.com
Mbed hosted mercurial repositories are deprecated and are due to be permanently deleted in July 2026.
To keep a copy of this software download the repository Zip archive or clone locally using Mercurial.
It is also possible to export all your personal repositories from the account settings page.
Diff: MARY_CAMERA.h
- Revision:
- 19:1d07d6d762a9
- Parent:
- 17:756fb618c0ed
- Child:
- 20:fa4a54e25fc4
--- a/MARY_CAMERA.h Tue Mar 11 05:42:29 2014 +0000 +++ b/MARY_CAMERA.h Tue Mar 11 07:51:10 2014 +0000 @@ -48,28 +48,29 @@ */ -#define CAMERA__PICTSIZE_VGA -//#define CAMERA__PICTSIZE_QCIF +#define DEFAULT_PICTURE_SIZE QCIF +//#define DEFAULT_PICTURE_SIZE VGA +//#define DEFAULT_PICTURE_SIZE QVGA +//#define DEFAULT_PICTURE_SIZE QQVGA class MARY_CAMERA { public: + typedef enum { + QCIF = 0, /**< QCIF */ + VGA, /**< VGA */ + QVGA, /**< QVGA */ + QQVGA, /**< QQVGA */ + } CameraPictureSize; /** General parameters for MARY_CAMERA */ enum { - -#ifdef CAMERA__PICTSIZE_QCIF - PIXEL_PER_LINE = 176, /**< pixels in a line */ - LINE_PER_FRAME = 144, /**< pixels in a line */ -#endif + BYTE_PER_PIXEL = 2, /**< bytes per pixel */ -#ifdef CAMERA__PICTSIZE_VGA - PIXEL_PER_LINE = 640, /**< pixels in a line */ - LINE_PER_FRAME = 480, /**< pixels in a line */ -#endif - - BYTE_PER_PIXEL = 2, /**< bytes per pixel */ - BYTE_PER_LINE = (PIXEL_PER_LINE * BYTE_PER_PIXEL) /**< data size of 1 line */ + QCIF_PIXEL_PER_LINE = 176, /**< pixels in a line */ + QCIF_LINE_PER_FRAME = 144, /**< pixels in a line */ + VGA_PIXEL_PER_LINE = 640, /**< pixels in a line */ + VGA_LINE_PER_FRAME = 480, /**< pixels in a line */ }; /** General parameters for MARMEX_OB_oled */ @@ -105,7 +106,24 @@ * * This function takes about 2 seconds because there is 99 times I2C access with 20ms interval. */ - int init( void ); + int init( CameraPictureSize picture_size ); + + /** Get holizontal size + * + * Returns image horizontal size (pixels) + * + * @return holizontal size + */ + + int horizontal_size( void ); + + /** Get vertical size + * + * Returns image vertical size (pixels) + * + * @return vertical size + */ + int vertical_size( void ); /** Check camera availability * @@ -157,6 +175,8 @@ DigitalOut _reset; I2C _i2c; int _error_state; + int _horizontal_size; + int _vertical_size; }; #endif // MBED_MARY_CAMERA \ No newline at end of file