2013-05-22 03:11:20 +08:00
/ *
*
* Licensed to the Apache Software Foundation ( ASF ) under one
* or more contributor license agreements . See the NOTICE file
* distributed with this work for additional information
* regarding copyright ownership . The ASF licenses this file
* to you under the Apache License , Version 2.0 ( the
* "License" ) ; you may not use this file except in compliance
* with the License . You may obtain a copy of the License at
*
* http : //www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing ,
* software distributed under the License is distributed on an
* "AS IS" BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
* KIND , either express or implied . See the License for the
* specific language governing permissions and limitations
* under the License .
*
* /
2015-10-05 18:48:19 +08:00
/ * *
* @ module Camera
* /
2013-05-22 03:11:20 +08:00
module . exports = {
2015-10-05 18:48:19 +08:00
/ * *
2016-07-26 16:15:26 +08:00
* @ description
* Defines the output format of ` Camera.getPicture ` call .
* _Note : _ On iOS passing ` DestinationType.NATIVE_URI ` along with
* ` PictureSourceType.PHOTOLIBRARY ` or ` PictureSourceType.SAVEDPHOTOALBUM ` will
* disable any image modifications ( resize , quality change , cropping , etc . ) due
* to implementation specific .
*
2015-10-05 18:48:19 +08:00
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
DestinationType : {
2016-03-11 03:55:31 +08:00
/** Return base64 encoded string. DATA_URL can be very memory intensive and cause app crashes or out of memory errors. Use FILE_URI or NATIVE_URI if possible */
2015-10-05 18:48:19 +08:00
DATA _URL : 0 ,
/** Return file uri (content://media/external/images/media/2 for Android) */
FILE _URI : 1 ,
/** Return native uri (eg. asset-library://... for iOS) */
NATIVE _URI : 2
2013-05-22 03:11:20 +08:00
} ,
2015-10-05 18:48:19 +08:00
/ * *
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
EncodingType : {
2015-10-05 18:48:19 +08:00
/** Return JPEG encoded image */
JPEG : 0 ,
/** Return PNG encoded image */
PNG : 1
2013-05-22 03:11:20 +08:00
} ,
2015-10-05 18:48:19 +08:00
/ * *
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
MediaType : {
2015-10-05 18:48:19 +08:00
/** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
PICTURE : 0 ,
/** Allow selection of video only, ONLY RETURNS URL */
VIDEO : 1 ,
/** Allow selection from all media types */
ALLMEDIA : 2
2013-05-22 03:11:20 +08:00
} ,
2015-10-05 18:48:19 +08:00
/ * *
2016-07-26 16:15:26 +08:00
* @ description
* Defines the output format of ` Camera.getPicture ` call .
* _Note : _ On iOS passing ` PictureSourceType.PHOTOLIBRARY ` or ` PictureSourceType.SAVEDPHOTOALBUM `
* along with ` DestinationType.NATIVE_URI ` will disable any image modifications ( resize , quality
* change , cropping , etc . ) due to implementation specific .
*
2015-10-05 18:48:19 +08:00
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
PictureSourceType : {
2016-08-23 21:14:59 +08:00
/** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
2015-10-05 18:48:19 +08:00
PHOTOLIBRARY : 0 ,
/** Take picture from camera */
CAMERA : 1 ,
2016-08-23 21:14:59 +08:00
/** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
2015-10-05 18:48:19 +08:00
SAVEDPHOTOALBUM : 2
2013-05-22 03:11:20 +08:00
} ,
2015-10-05 18:48:19 +08:00
/ * *
* Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover .
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
PopoverArrowDirection : {
2015-10-05 18:48:19 +08:00
ARROW _UP : 1 ,
2013-05-22 03:11:20 +08:00
ARROW _DOWN : 2 ,
ARROW _LEFT : 4 ,
ARROW _RIGHT : 8 ,
ARROW _ANY : 15
} ,
2015-10-05 18:48:19 +08:00
/ * *
* @ enum { number }
* /
2013-05-22 03:11:20 +08:00
Direction : {
2015-10-05 18:48:19 +08:00
/** Use the back-facing camera */
2013-05-22 03:11:20 +08:00
BACK : 0 ,
2015-10-05 18:48:19 +08:00
/** Use the front-facing camera */
2013-05-22 03:11:20 +08:00
FRONT : 1
}
} ;