arnaucube
arnaucube/openEventsPlatformAppPublic Self-hosted repository
openEventsPlatformApp/plugins/cordova-plugin-camera/www/CameraConstants.js
plugins/cordova-plugin-camera/www/CameraConstants.jsRaw
  1/*
  2 *
  3 * Licensed to the Apache Software Foundation (ASF) under one
  4 * or more contributor license agreements.  See the NOTICE file
  5 * distributed with this work for additional information
  6 * regarding copyright ownership.  The ASF licenses this file
  7 * to you under the Apache License, Version 2.0 (the
  8 * "License"); you may not use this file except in compliance
  9 * with the License.  You may obtain a copy of the License at
 10 *
 11 *   http://www.apache.org/licenses/LICENSE-2.0
 12 *
 13 * Unless required by applicable law or agreed to in writing,
 14 * software distributed under the License is distributed on an
 15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
 16 * KIND, either express or implied.  See the License for the
 17 * specific language governing permissions and limitations
 18 * under the License.
 19 *
 20*/
 21
 22/**
 23 * @module Camera
 24 */
 25module.exports = {
 26  /**
 27   * @description
 28   * Defines the output format of `Camera.getPicture` call.
 29   * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
 30   * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
 31   * disable any image modifications (resize, quality change, cropping, etc.) due
 32   * to implementation specific.
 33   *
 34   * @enum {number}
 35   */
 36  DestinationType:{
 37    /** 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 */
 38    DATA_URL: 0,
 39    /** Return file uri (content://media/external/images/media/2 for Android) */
 40    FILE_URI: 1,
 41    /** Return native uri (eg. asset-library://... for iOS) */
 42    NATIVE_URI: 2
 43  },
 44  /**
 45   * @enum {number}
 46   */
 47  EncodingType:{
 48    /** Return JPEG encoded image */
 49    JPEG: 0,
 50    /** Return PNG encoded image */
 51    PNG: 1
 52  },
 53  /**
 54   * @enum {number}
 55   */
 56  MediaType:{
 57    /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
 58    PICTURE: 0,
 59    /** Allow selection of video only, ONLY RETURNS URL */
 60    VIDEO: 1,
 61    /** Allow selection from all media types */
 62    ALLMEDIA : 2
 63  },
 64  /**
 65   * @description
 66   * Defines the output format of `Camera.getPicture` call.
 67   * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
 68   * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
 69   * change, cropping, etc.) due to implementation specific.
 70   *
 71   * @enum {number}
 72   */
 73  PictureSourceType:{
 74    /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
 75    PHOTOLIBRARY : 0,
 76    /** Take picture from camera */
 77    CAMERA : 1,
 78    /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
 79    SAVEDPHOTOALBUM : 2
 80  },
 81  /**
 82   * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
 83   * @enum {number}
 84   */
 85  PopoverArrowDirection:{
 86      ARROW_UP : 1,
 87      ARROW_DOWN : 2,
 88      ARROW_LEFT : 4,
 89      ARROW_RIGHT : 8,
 90      ARROW_ANY : 15
 91  },
 92  /**
 93   * @enum {number}
 94   */
 95  Direction:{
 96      /** Use the back-facing camera */
 97      BACK: 0,
 98      /** Use the front-facing camera */
 99      FRONT: 1
100  }
101};