AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzPlatformCam.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CCZ_PLATFORM_CAM_H_)
00015 #define _CCZ_PLATFORM_CAM_H_
00016 
00017 #include "IzPlatformCam.h"
00018 #include "s3eCamera.h"
00019 
00020 class CzPlatformCam: public IzPlatformCam
00021 {
00022 protected:
00023 
00024     // Properties
00025 private:
00026     bool                    Started;
00027     eCzCameraCaptureSize    SizeHint;
00028     eCzCameraCaptureQuality Quality;
00029     bool                    ImageValid;
00030     bool                    ImageCreated;
00031     bool                    Updated;
00032     CzImage*                ImageBrush;
00033     int                     LastFrameOrientation;
00034     eCzCameraType           CameraType;
00035 public:
00036     bool                    isAvailable();
00037     bool                    isStarted() const { return Started; }
00038     void                    setUpdated(bool updated) { Updated = updated; }
00039     bool                    isUpdated() const { return Updated; }
00040     void                    setImageValid(bool valid) { ImageValid = valid; }
00041     bool                    isImageValid() const { return ImageValid; }
00042     void                    setImageCreated(bool valid) { ImageCreated = valid; }
00043     bool                    isImageCreated() const { return ImageCreated; }
00044     eCzCameraCaptureSize    getSizeHint() const { return SizeHint; }
00045     eCzCameraCaptureQuality getQuality() const { return Quality; }
00046 
00047     void                    setImageBrush(CzImage* brush);
00048     CzImage*                getImageBrush();
00049     eCzCameraStatus         getStatus();
00050     bool                    setFrontFacing();
00051     bool                    setRearFacing();
00052     int                     getLastFrameOrientation() const;
00053     void                    setLastFrameOrientation(int angle);
00054     eCzCameraType           getCameraType() const;
00055     // Properties end
00056 
00057 protected:
00058     s3eCameraQualityHint        toMarmalade(eCzCameraCaptureQuality hint);
00059     s3eCameraStreamingSizeHint  toMarmalade(eCzCameraCaptureSize hint);
00060     s3eCameraType               toMarmalade(eCzCameraType type);
00061     s3eCameraStatus             toMarmalade(eCzCameraStatus status);
00062     eCzCameraCaptureSize        fromMarmalade(s3eCameraStreamingSizeHint hint);
00063     eCzCameraCaptureQuality     fromMarmalade(s3eCameraQualityHint hint);
00064     eCzCameraType               fromMarmalade(s3eCameraType type);
00065     eCzCameraStatus             fromMarmalade(s3eCameraStatus status);
00066 public:
00067     CzPlatformCam() : ImageBrush(NULL), Started(false),ImageValid(false), ImageCreated(false), Updated(false), LastFrameOrientation(0)  {}
00068     int         Init();
00069     void        Release();
00070 
00071     bool        Start(eCzCameraCaptureSize size_hint, eCzCameraCaptureQuality quality = CCQ_Medium);
00072     void        Stop();
00073 };
00074 
00075 
00076 #endif  // _CCZ_PLATFORM_CAM_H_