CameraConstants.js 3.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103
  1. cordova.define("cordova-plugin-camera.Camera", function(require, exports, module) { /*
  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. * @module Camera
  23. */
  24. module.exports = {
  25. /**
  26. * @description
  27. * Defines the output format of `Camera.getPicture` call.
  28. * _Note:_ On iOS passing `DestinationType.NATIVE_URI` along with
  29. * `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM` will
  30. * disable any image modifications (resize, quality change, cropping, etc.) due
  31. * to implementation specific.
  32. *
  33. * @enum {number}
  34. */
  35. DestinationType: {
  36. /** 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 */
  37. DATA_URL: 0,
  38. /** Return file uri (content://media/external/images/media/2 for Android) */
  39. FILE_URI: 1,
  40. /** Return native uri (eg. asset-library://... for iOS) */
  41. NATIVE_URI: 2
  42. },
  43. /**
  44. * @enum {number}
  45. */
  46. EncodingType: {
  47. /** Return JPEG encoded image */
  48. JPEG: 0,
  49. /** Return PNG encoded image */
  50. PNG: 1
  51. },
  52. /**
  53. * @enum {number}
  54. */
  55. MediaType: {
  56. /** Allow selection of still pictures only. DEFAULT. Will return format specified via DestinationType */
  57. PICTURE: 0,
  58. /** Allow selection of video only, ONLY RETURNS URL */
  59. VIDEO: 1,
  60. /** Allow selection from all media types */
  61. ALLMEDIA: 2
  62. },
  63. /**
  64. * @description
  65. * Defines the output format of `Camera.getPicture` call.
  66. * _Note:_ On iOS passing `PictureSourceType.PHOTOLIBRARY` or `PictureSourceType.SAVEDPHOTOALBUM`
  67. * along with `DestinationType.NATIVE_URI` will disable any image modifications (resize, quality
  68. * change, cropping, etc.) due to implementation specific.
  69. *
  70. * @enum {number}
  71. */
  72. PictureSourceType: {
  73. /** Choose image from the device's photo library (same as SAVEDPHOTOALBUM for Android) */
  74. PHOTOLIBRARY: 0,
  75. /** Take picture from camera */
  76. CAMERA: 1,
  77. /** Choose image only from the device's Camera Roll album (same as PHOTOLIBRARY for Android) */
  78. SAVEDPHOTOALBUM: 2
  79. },
  80. /**
  81. * Matches iOS UIPopoverArrowDirection constants to specify arrow location on popover.
  82. * @enum {number}
  83. */
  84. PopoverArrowDirection: {
  85. ARROW_UP: 1,
  86. ARROW_DOWN: 2,
  87. ARROW_LEFT: 4,
  88. ARROW_RIGHT: 8,
  89. ARROW_ANY: 15
  90. },
  91. /**
  92. * @enum {number}
  93. */
  94. Direction: {
  95. /** Use the back-facing camera */
  96. BACK: 0,
  97. /** Use the front-facing camera */
  98. FRONT: 1
  99. }
  100. };
  101. });