API Guide Home
(Online version only)

CameraLib.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  * Copyright (c) 2004 palmOne, Inc. or its subsidiaries.
00003  * All rights reserved.
00004  *****************************************************************************/
00005 /**
00006  * @ingroup Camera
00007  *
00008  */
00009 
00010 /**
00011  * @file    CameraLib.h
00012  *
00013  * @brief   Public 68K include file for camera support for Treo 600 devices.
00014  *
00015  * Notes:
00016  * The calling application should always load this library with
00017  * SysLibLoad() before use, even if it is already open by another
00018  * application(ie, SysLibFind() returns a valid refnum). When
00019  * the application is done with the library, it should be
00020  * unloaded with SysLibRemove(). We do this because there is
00021  * no good way to synchronize loading and unloading of libraries
00022  * among multiple applications. It also greatly simplifies internal
00023  * synchronization.
00024  */
00025 
00026 #ifndef __CAMERALIB68K_H__
00027 #define __CAMERALIB68K_H__
00028 
00029 #include <PalmTypes.h>
00030 #include <LibTraps.h>
00031 #include <Common/HsCommon.h>
00032 
00033 
00034 /********************************************************************
00035  * Prototypes
00036  ********************************************************************/
00037 #ifdef __cplusplus
00038 extern "C" {
00039 #endif
00040 
00041 /// Standard library open routine.
00042 /// Library should always be loaded with SysLibLoad()(not SysLibFind())
00043 /// before calling CameraLibOpen(). See note at top of file.
00044 ///
00045 /// @param refnum:  IN: Library reference number.
00046 /// @retval Err Error code.
00047 Err CameraLibOpen(UInt16 refnum)
00048             SYS_TRAP(kCameraLibTrapOpen);
00049 
00050 /// Closes the Camera library.
00051 /// Library should always be unloaded with SysLibRemove() after
00052 /// CameraLibClose() is called. See note at top of file.
00053 ///
00054 /// @param refnum:  IN: Library reference number.
00055 /// @retval Err Error code.
00056 Err CameraLibClose(UInt16 refnum)
00057             SYS_TRAP(kCameraLibTrapClose);
00058 
00059 /// Standard library sleep function.
00060 ///
00061 /// @param refnum:  IN: Library reference number.
00062 /// @retval Err Error code.
00063 Err CameraLibSleep (UInt16 refnum)
00064             SYS_TRAP(kCameraLibTrapSleep);
00065 
00066 /// Standard library wake function.
00067 ///
00068 /// @param refnum:  IN: Library reference number.
00069 /// @retval Err Error code.
00070 Err CameraLibWake (UInt16 refnum)
00071             SYS_TRAP(kCameraLibTrapWake);
00072 
00073 
00074 /// Returns a full image (640X480) in the specified color space.
00075 /// This function is not really necessary, since CameraLibPreview could be used instead. This function might be deprecated in the future.
00076 ///
00077 /// @param refnum:  IN: Library reference number.
00078 /// @param buffer:  IN: Buffer to hold the image.
00079 /// @param format:  IN: Format of the image you want returned.
00080 /// @retval Err Error code.
00081 Err CameraLibCapture (UInt16 refnum, void * buffer, UInt16 format)
00082             SYS_TRAP(kCameraLibTrapCameraLibCapture);
00083 
00084 /// Returns an image using the window width and height (pixels) you specify.
00085 /// If the width and height are less the dimensions of a full camera
00086 /// image (640x480) a simple pixel sub-sampling algorithm is used to decimate
00087 /// the image.
00088 ///
00089 /// @param refnum:  IN: Library reference number.
00090 /// @param buffer:  IN: Buffer to hold the image.
00091 /// @param format:  IN: Format of the image you want returned.
00092 /// @param width:   IN: The width in pixels of the image you want captured.
00093 /// @param height:  IN: The height in pixels of the image you want captured.
00094 /// @retval Err Error code.
00095 Err CameraLibPreview (UInt16 refnum, void * buffer, UInt16 format, UInt32 width, UInt32 height)
00096             SYS_TRAP(kCameraLibTrapCameraLibPreview);
00097 
00098 /// Puts the camera library in preview mode and establishes a preview window.
00099 /// While in this mode, QQVGA images are continuously copied to the LCD
00100 /// screen of the device. Call CameraLibPreviewStop to exit preview mode.
00101 ///
00102 /// @param refnum:  IN: Library reference number.
00103 /// @param windowH: IN: Window handle of the PalmOS window that the image
00104 ///                     is to be displayed in.
00105 /// @param x:       IN: Window-relative coordinate of the left edge of the image.
00106 /// @param y:       IN: Window-relative coordinate of the top edge of the image.
00107 /// @retval Err Error code.
00108 Err CameraLibPreviewStart (UInt16 refnum, WinHandle windowH, UInt32 x, UInt32 y)
00109             SYS_TRAP(kCameraLibTrapCameraLibPreviewStart);
00110 
00111 /// Stops preview mode.
00112 /// @see CameraLibPreviewStart.
00113 ///
00114 /// @param refnum:  IN: Library reference number.
00115 /// @retval Err Error code.
00116 Err CameraLibPreviewStop (UInt16 refnum)
00117             SYS_TRAP(kCameraLibTrapCameraLibPreviewStop);
00118 
00119 /// Gets the current setting of the camera register.
00120 ///
00121 /// @param refnum:  IN: Library reference number.
00122 /// @param reg:     IN: Register number.
00123 /// @param valueP:  OUT: Pointer to where register data will be stored.
00124 /// @retval Err Error code.
00125 Err CameraLibRegisterGet (UInt16 refnum, UInt32 reg, UInt32 * valueP)
00126             SYS_TRAP(kCameraLibTrapCameraLibRegisterGet);
00127 
00128 /// Sets the value of the camera register.
00129 ///
00130 /// @param refnum:  IN: Library reference number.
00131 /// @param reg:     IN: Register number.
00132 /// @param value:   IN: The data value you want to set the register to.
00133 /// @retval Err Error code.
00134 Err CameraLibRegisterSet (UInt16 refnum, UInt32 reg, UInt32 value)
00135             SYS_TRAP(kCameraLibTrapCameraLibRegisterSet);
00136 
00137 
00138 #ifdef __cplusplus
00139 }
00140 #endif
00141 
00142 #endif  //__CAMERALIB68K_H__

Top Palm Developer Network
© 2004-2008, Palm, Inc. All rights reserved.
Generated on Fri Jun 13 10:06:52 2008 for Palm API Guide