API Guide Home
(Online version only)

palmOnePhotoCommon.h

Go to the documentation of this file.
00001 /*******************************************************************************
00002  * Copyright (c) 2004-2005 palmOne, Inc. or its subsidiaries.
00003  * All rights reserved.
00004  ******************************************************************************/
00005 /**
00006  * @ingroup Imaging
00007  */
00008 
00009 /**
00010  * @file    palmOnePhotoCommon.h
00011  * @version 3.0
00012  *
00013  * @brief   Palm Photos API: This file contains all the defines, enumerations, structures needed by PalmPhoto.h
00014  *
00015  */
00016 
00017 #ifndef PALMONE_PHOTO_COMMON_H_
00018 #define PALMONE_PHOTO_COMMON_H_
00019 
00020 /* Palm OS common definitions */
00021 #include <SystemMgr.h>
00022 
00023 /* If we're actually compiling the library code, then we need to
00024  * eliminate the trap glue that would otherwise be generated from
00025  * this header file in order to prevent compiler errors in CW Pro 2.
00026  */
00027 #ifdef BUILDING_PMP
00028     #define PMP_LIB_TRAP(trapNum)
00029 #else
00030     #define PMP_LIB_TRAP(trapNum) SYS_TRAP(trapNum)
00031 #endif
00032 
00033 /*********************************************************************
00034  * Type and creator of Sample Library database
00035  *********************************************************************/
00036 
00037 #define     PalmPhotoLibCreatorID           'PMPL'          /**< Palm Photo Library creator id */
00038 #define     PalmPhotoLibTypeID              sysFileTLibrary /**< Standard library type */
00039 
00040 /*********************************************************************
00041  * Internal library name which can be passed to SysLibFind()
00042  *********************************************************************/
00043 
00044 #define     PalmPhotoLibName                "PalmPhotoLib" /**< Palm Photo Library database name */
00045 
00046 /*********************************************************************
00047  * Library versioning
00048  *********************************************************************/
00049 
00050 /**
00051  * @name Library Versions
00052  */
00053 /*@{*/
00054 #define kPalmPhotoLibVersion1       sysMakeROMVersion(1, 0, 0, sysROMStageRelease, 0)
00055 #define kPalmPhotoLibVersion2       sysMakeROMVersion(2, 0, 0, sysROMStageRelease, 0)
00056 #define kPalmPhotoLibVersion3       sysMakeROMVersion(3, 0, 0, sysROMStageRelease, 1)
00057 #define kPalmPhotoLibVersion        kPalmPhotoLibVersion3
00058 /*@}*/
00059 
00060 /******************************************************************
00061  * Error codes
00062  ******************************************************************/
00063 
00064 /**
00065  * @name Error Codes
00066  */
00067 /*@{*/
00068 /** Invalid parameter.                                          */
00069 #define palmPhotoLibErrParam                (oemErrorClass + 0x100)
00070 /** Library not open.                                           */
00071 #define palmPhotoLibErrNotOpen              (palmPhotoLibErrParam | 1)
00072 /** Library is still open.                                      */
00073 #define palmPhotoLibErrStillOpen            (palmPhotoLibErrParam | 2)
00074 /** Photos database does not exist on device.                   */
00075 #define palmPhotoLibErrNotPhotos            (palmPhotoLibErrParam | 3)
00076 /** Could not open Photos database.                             */
00077 #define palmPhotoLibErrNotOpenPhotos        (palmPhotoLibErrParam | 4)
00078 /** The album already exists.                                   */
00079 #define palmPhotoLibErrAlbumExist           (palmPhotoLibErrParam | 5)
00080 /** The selected album does not exist.                          */
00081 #define palmPhotoLibErrAlbumNotExist        (palmPhotoLibErrParam | 6)
00082 /** The album is full.                                          */
00083 #define palmPhotoLibErrAlbumFull            (palmPhotoLibErrParam | 7)
00084 /** The album name is too long.                                 */
00085 #define palmPhotoLibErrAlbumNameTooLong     (palmPhotoLibErrParam | 8)
00086 /** The album cannot be renamed or deleted.                     */
00087 #define palmPhotoLibErrAlbumReadOnly        (palmPhotoLibErrParam | 9)
00088 /** Insufficient free space in dynamic heap.                    */
00089 #define palmPhotoLibErrLowHeap              (palmPhotoLibErrParam | 10)
00090 /** Insufficient free space in storage heap.                    */
00091 #define palmPhotoLibErrLowMemory            (palmPhotoLibErrParam | 11)
00092 /** An image with that name already exists.                     */
00093 #define palmPhotoLibErrImageExist           (palmPhotoLibErrParam | 12)
00094 /** Specified image does not exist.                             */
00095 #define palmPhotoLibErrImageNotFound        (palmPhotoLibErrParam | 13)
00096 /** Image format not supported for the attempted operation.     */
00097 #define palmPhotoLibErrFormatNotSupported   (palmPhotoLibErrParam | 14)
00098 /** Image is not in the Photos database.                        */
00099 #define palmPhotoLibErrImageNotInPhotos     (palmPhotoLibErrParam | 15)
00100 /** Invalid path/image name.                                    */
00101 #define palmPhotoLibErrImageInvalidPath     (palmPhotoLibErrParam | 16)
00102 /** User canceled operation.                                    */
00103 #define palmPhotoLibErrUserCancel           (palmPhotoLibErrParam | 17)
00104 /** Unsupported handheld screen color depth.                    */
00105 #define palmPhotoLibErrScreenDepth          (palmPhotoLibErrParam | 18)
00106 /** Buffer is too small.                                        */
00107 #define palmPhotoLibErrSmallBuffer          (palmPhotoLibErrParam | 19)
00108 /** Unknown or unclassifiable error.                            */
00109 #define palmPhotoLibErrUnknown              (palmPhotoLibErrParam | 20)
00110 /** Image has no thumbnail.                                     */
00111 #define palmPhotoLibErrNoThumbnail          (palmPhotoLibErrParam | 21)
00112 /** Abort a read or write operation.            New in v2.0.    */
00113 #define palmPhotoLibErrAbortReadWrite       (palmPhotoLibErrParam | 22)
00114 /** Rotation angle not supported.               New in v2.0.    */
00115 #define palmPhotoLibErrUnsupportedRotation  (palmPhotoLibErrParam | 23)
00116 /** Invalid volume for operation.               New in v2.0.    */
00117 #define palmPhotoLibErrInvalidVolume        (palmPhotoLibErrParam | 24)
00118 /** Device has no camera.                       New in v2.0.    */
00119 #define palmPhotoLibErrNoCamera             (palmPhotoLibErrParam | 25)
00120 /** Library version is too old.                                 */
00121 #define palmPhotoLibErrOldVersion           (palmPhotoLibErrParam | 26)
00122 /** Invalid operation for media protected by DRM                */
00123 #define palmPhotoLibErrProtectedMedia       (palmPhotoLibErrParam | 27)
00124 /** The Power too lower                 */
00125 #define palmPhotoLibErrLowPower             (palmPhotoLibErrParam | 28)
00126 /*@}*/
00127 
00128 /******************************************************************
00129  * Constants and Types
00130  ******************************************************************/
00131 
00132 /** Media formats */
00133 
00134 /** JPEG file format.                                           */
00135 #define palmPhotoJPEGFileFormat             (0x0001)
00136 /** Raw RGB 888 file format.                                    */
00137 #define palmPhotoRGB888FileFormat           (0x0002)
00138 /** Raw RGB 565 file format.                                    */
00139 #define palmPhotoRGB565FileFormat           (0x0003)
00140 /** GIF 8-bit indexed color format              New in v2.0.    */
00141 #define palmPhotoGIFFileFormat              (0x0004)
00142 /** BMP bitmap format                           New in v2.0.    */
00143 #define palmPhotoBMPFileFormat              (0x0005)
00144 /** TIFF bitmap format                          New in v2.0.    */
00145 #define palmPhotoTIFFFileFormat             (0x0006)
00146 /** PNG bitmap format                           New in v2.0.    */
00147 #define palmPhotoPNGFileFormat              (0x0007)
00148 /** WBMP bitmap format                          New in v2.0.    */
00149 #define palmPhotoWBMPFileFormat             (0x0008)
00150 /** M-JPEG video format                         New in v2.0.    */
00151 #define palmPhotoMJPEGFileFormat            (0x1001)
00152 /** MPEG1 video format                          New in v2.0.    */
00153 #define palmPhotoMPEG1FileFormat            (0x1002)
00154 /** MPEG4 video format                          New in v2.0.    */
00155 #define palmPhotoMPEG4FileFormat            (0x1003)
00156 
00157 /** AVI file with ADPCM audio + MPEG4 video     New in v2.0.    */
00158 #define palmPhotoFormat_AVI_ADPCM_MPEG4     (0x1113)
00159 /** AVI file with MP3 audio + MPEG4 video       New in v2.0.    */
00160 #define palmPhotoFormat_AVI_MP3_MPEG4       (0x1123)
00161 /** ASF file with ADPCM audio + MPEG4 video     New in v2.0.    */
00162 #define palmPhotoFormat_ASF_ADPCM_MPEG4     (0x1213)
00163 /** ASF file with MP3 audio + MPEG4 video       New in v2.0.    */
00164 #define palmPhotoFormat_ASF_MP3_MPEG4       (0x1223)
00165 /** 3GP file with AMR audio + MPEG4 video       New in v3.0.    */
00166 #define palmPhotoFormat_3GP_AMR_MPEG4       (0x1333)
00167 /** 3GP file with AMR audio + H.263 video       New in v3.0.    */
00168 #define palmPhotoFormat_3GP_AMR_H263        (0x1334)
00169 /** 3G2 file with QCELP audio + MPEG4 video     New in v3.0.    */
00170 #define palmPhotoFormat_3G2_QCELP_MPEG4     (0x1443)
00171 /** 3G2 file with QCELP audio + H.263 video     New in v3.0.    */
00172 #define palmPhotoFormat_3G2_QCELP_H263      (0x1444)
00173 
00174 /** Default still capture format.               New in v3.0.    */
00175 #define palmPhotoPreferredImageFormat       (0xFFFD)
00176 /** Default video capture format.               New in v3.0.    */
00177 #define palmPhotoPreferredVideoFormat       (0xFFFE)
00178 
00179 /** Unsupported file format.                                    */
00180 #define palmPhotoUnsupportedFormat          (0xFFFF)
00181 
00182 /** @name Old Constant Names */
00183 /** Old (2.0) constant names for compatibility                  */
00184 /*@{*/
00185 #define palmPhotoAVIM4AFileFormat           palmPhotoFormat_AVI_ADPCM_MPEG4
00186 #define palmPhotoAVIM43FileFormat           palmPhotoFormat_AVI_MP3_MPEG4
00187 #define palmPhotoASFM4AFileFormat           palmPhotoFormat_ASF_ADPCM_MPEG4
00188 #define palmPhotoASFM43FileFormat           palmPhotoFormat_ASF_MP3_MPEG4
00189 /*@}*/
00190 
00191 /** Palm Photo file format.                                     */
00192 typedef UInt16 PalmPhotoFileFormat;
00193 
00194 
00195 
00196 /** Capture resolution supported by device camera */
00197 
00198 /** SUBQCIF (128x96)                            New in v3.0.    */
00199 #define palmPhotoCaptureResSUBQCIF      (0x00000001)
00200 /** QQVGA (160x120)                             New in v3.0.    */
00201 #define palmPhotoCaptureResQQVGA        (0x00000002)
00202 /** QCIF (176x144)                              New in v3.0.    */
00203 #define palmPhotoCaptureResQCIF         (0x00000004)
00204 /** QVGA (320x240)                              New in v3.0.    */
00205 #define palmPhotoCaptureResQVGA         (0x00000008)
00206 /** CIF (352x288)                               New in v3.0.    */
00207 #define palmPhotoCaptureResCIF          (0x00000010)
00208 /** VGA (640x480)                               New in v3.0.    */
00209 #define palmPhotoCaptureResVGA          (0x00000020)
00210 /** SVGA (800x600)                              New in v3.0.    */
00211 #define palmPhotoCaptureResSVGA         (0x00000040)
00212 /** XVGA (1024x768)                             New in v3.0.    */
00213 #define palmPhotoCaptureResXVGA         (0x00000080)
00214 /** SXGA (1280x960)                             New in v3.0.    */
00215 #define palmPhotoCaptureResSXGA         (0x00000100)
00216 /** SXGA (1280x960)                             New in v3.0.    */
00217 #define palmPhotoCaptureResSXGA960      (0x00000100)
00218 /** SXGA (1280x1024)                            New in v3.0.    */
00219 #define palmPhotoCaptureResSXGA1024     (0x00000200)
00220 
00221 /** Unknown dimensions (caller must use CameraManager)          */
00222 #define palmPhotoCaptureResOther        (0x80000000)
00223 
00224 /** None (no camera or camera disabled)                         */
00225 #define palmPhotoCaptureResNone         (0x00000000)
00226 
00227 /** Used with palmPhotoCaptureRes defines */
00228 typedef UInt32 PalmPhotoCaptureResolution;
00229 
00230 /** File stream on the device.                                  */
00231 #define palmPhotoStreamLocation             (0x0000)
00232 /** VFS file.                                                   */
00233 #define palmPhotoVFSLocation                (0x0001)
00234 /** Memory file. Read-Only images.                              */
00235 #define palmPhotoMemoryLocation             (0x0002)
00236 
00237 /** Palm Photo file location type.                              */
00238 typedef UInt16  PalmPhotoLocationType;
00239 
00240 /** Unique ID                                                   */
00241 typedef UInt8 PalmPhotoUID[21];
00242 
00243 /** File location.infoP points to a PalmPhotoFileLocation.      */
00244 #define palmPhotoExtraInfoLocation          (0x0000)
00245 /** Date.infoP points to a DateType.                            */
00246 #define palmPhotoExtraInfoDate              (0x0001)
00247 /** Album.infoP points to a (Char *).                           */
00248 #define palmPhotoExtraInfoAlbum             (0x0002)
00249 /** Notes.infoP points to a (Char *).                           */
00250 #define palmPhotoExtraInfoNotes             (0x0003)
00251 /** Notes.infoP points to a PalmPhotoFileLocation. New in v3.0. */
00252 #define palmPhotoExtraInfoSound             (0x0004)
00253 /** Notes.infoP points to a PalmPhotoUID.          New in v3.0. */
00254 #define palmPhotoExtraInfoImageUID          (0x0005)
00255 /** Notes.infoP points to a PalmPhotoUID.          New in v3.0. */
00256 #define palmPhotoExtraInfoSoundUID          (0x0006)
00257 /** Notes.infoP points to a PalmPhotoUID.          New in v3.0. */
00258 #define palmPhotoExtraInfoCompositeUID      (0x0007)
00259 
00260 /** Palm Photo extra information type.                          */
00261 typedef UInt16 PalmPhotoExtraInfoType;
00262 
00263 
00264 /** Mutiple selection dialog.                                   */
00265 #define palmPhotoDlgSelection               (0x0000)
00266 /** Single selection dialog.                                    */
00267 #define palmPhotoDlgSingleSelection         (0x0001)
00268 /** Deletion dialog.                                            */
00269 #define palmPhotoDlgDeletion                (0x0002)
00270 
00271 /** Palm Photo dialog type.                                     */
00272 typedef UInt16 PalmPhotoDlgType;
00273 
00274 
00275 /** Select still image types                                    */
00276 #define palmPhotoMediaTypePhoto             (0x0001)
00277 /** Select video types                                          */
00278 #define palmPhotoMediaTypeVideo             (0x0002)
00279 /** All media types (in 3.0, limited to photos and video).      */
00280 #define palmPhotoMediaTypeAll               (0xFFFF)
00281 
00282 /** Palm Photo media type (used in PalmPhotoSelectDlgV3).       */
00283 typedef UInt16 PalmPhotoMediaType;
00284 
00285 
00286 /** Highest quality compressed image.                           */
00287 #define palmPhotoHighestQuality             (0xFFFF)
00288 /** High quality compressed image.                              */
00289 #define palmPhotoHighQuality                (0xFFFE)
00290 /** Normal quality compressed image.                            */
00291 #define palmPhotoMediumQuality              (0xFFFD)
00292 /** Low quality compressed image.                               */
00293 #define palmPhotoLowQuality                 (0xFFFC)
00294 /** Lowest quality compressed image.                            */
00295 #define palmPhotoLowestQuality              (0xFFFB)
00296 
00297 /** Palm Photo image quality type.                              */
00298 typedef UInt16 PalmPhotoQualityType;
00299 
00300 
00301 /** Maximum file path length.                                   */
00302 #define PALM_PHOTO_MAX_PATH                 (255)
00303 /** Used during selection to select maximum number of photos.   */
00304 #define PALM_PHOTO_SELECT_ALL               ((Int32)0xFFFFFFFF)
00305 /** Used to select all the albums at once.                      */
00306 #define PALM_PHOTO_ALBUM_ALL                ((UInt16)0xFFFF)
00307 /** Used to select all the albums on the handheld at once.      */
00308 #define PALM_PHOTO_ALBUM_ALL_HANDHELD       ((UInt16)0xFFFF)
00309 /** Used to select all the albums on the VFS card at once.      */
00310 #define PALM_PHOTO_ALBUM_ALL_VFS            ((UInt16)0xFFFE)
00311 /** Maximum album name length on device. (Increased for v3.0.)  */
00312 #define PALM_PHOTO_ALBUM_MAX_NAME           (255)
00313 
00314 
00315 /******************************************************************
00316  * Structures
00317  ******************************************************************/
00318 
00319 /**
00320  * @brief Photo file location.
00321  *
00322  * This structure is used to open, create and query location
00323  * information of an image.
00324  */
00325 typedef struct _PalmPhotoFileLocation
00326 {
00327     PalmPhotoLocationType   fileLocationType;   /**< File location type.        */
00328     UInt16                  reserved;           /**< reserved for future use    */
00329     union
00330     {
00331         struct {
00332             Char    name[dmDBNameLength];       /**< File name on the device.   */
00333             UInt32  type;                       /**< Type of the stream.        */
00334             UInt32  creator;                    /**< Creator of the stream.     */
00335         } StreamFile;                           /**< File format: stream        */
00336 
00337         struct {
00338             Char    name[PALM_PHOTO_MAX_PATH+1];/**< Full path name.                    */
00339             UInt16  volumeRef;                  /**< Volume where the file is located.  */
00340             UInt16  reserved;                   /**< reserved for future use    */
00341         } VFSFile;                              /**< File format: VFS           */
00342 
00343         struct {
00344             void    *bufferP;                   /**< Buffer holding the image.  */
00345             UInt32  bufferSize;                 /**< Size of the buffer.        */
00346         } MemoryFile;                           /**< File format: Memory        */
00347 
00348     } file;                                     /**< Image location.            */
00349 
00350 } PalmPhotoFileLocation;
00351 
00352 /**
00353  * @brief Photo information.
00354  *
00355  * This structure contains the basic image information.
00356  */
00357 typedef struct _PalmPhotoImageInfo
00358 {
00359     UInt32                  width;          /**< Width in pixels of the image.  */
00360     UInt32                  height;         /**< Height in pixels of the image. */
00361     UInt32                  bitsPerPixel;   /**< Color depth of the image.      */
00362     UInt32                  filesize;       /**< File size, in bytes.           */
00363     PalmPhotoFileFormat     fileFormat;     /**< File format, e.g., JPEG, GIF.  */
00364     PalmPhotoQualityType    imageQuality;   /**< Image quality.                 */
00365 } PalmPhotoImageInfo;
00366 
00367 
00368 /**
00369  * @brief Photo image extra info parameters.
00370  *
00371  * Gets extra information on an image.
00372  */
00373 typedef struct _PalmPhotoExtraInfo
00374 {
00375     PalmPhotoExtraInfoType  infoType;       /**< IN: Image info type.                       */
00376     UInt16                  reserved;       /**< reserved for future use                    */
00377     void                    *infoP;         /**< OUT: Points to the information selected.   */
00378     UInt32                  infoSize;       /**< OUT: Size of the buffer pointed by infoP.  */
00379 } PalmPhotoExtraInfoParam;
00380 
00381 /** Palm Photo handle. @see _PalmPhotoType */
00382 typedef struct _PalmPhotoType * PalmPhotoHandle;
00383 
00384 /**
00385  * @brief Photo selections.
00386  *
00387  * This strucutre is used during image selections, either by using
00388  * the PalmPhotoSelectDlg() function of the PalmPhotoSelect() function.
00389  */
00390 typedef struct _PalmPhotoSelections
00391 {
00392     UInt32                  imageCount;     /**< Number of images.          */
00393     PalmPhotoHandle         *imageH;        /**< Array of image handles.    */
00394 } PalmPhotoSelections;
00395 
00396 #endif // PALMONE_PHOTO_COMMON_H_

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