[{"name":"Camera","comment":" A friendly interface for built-in video sources, such as cameras.\n\n`Camera` lets you open a camera, change its settings, take snapshots, and show a\nlive preview in an HTML element.\n\nThe current API covers the common case of opening and using a single camera. It\ndoes not yet expose the full range of browser media features.\n\nCommands and information pass between Elm and the browser through\n[ports](https://guide.elm-lang.org/interop/ports.html). Large data items are not\npassed to Elm, but are addressed through opaque handles instead.\n\n\n# Camera workflow\n\nUsing a camera follows a small request-and-result loop:\n\n1.  Call `open`, or use `openWithOptions` to choose a device and send initial\n    `Configuration.Constraints`. The regular `open` function starts with\n    `Configuration.defaultConstraints`, where every field is `Nothing`.\n2.  Handle `OpenCompleted`. A successful result contains an `OpenedCamera`\n    with its ID, capabilities, and active settings.\n3.  Keep your constraints in your application model. To change the camera,\n    update that value and send the complete new constraints with `configure`.\n4.  Handle `ConfigureCompleted`. A successful result contains the active\n    settings the browser actually applied.\n\nConstraints express what your application wants, while settings describe what\nthe browser is using. The browser may choose compatible values that differ from\nthe request, so use the returned settings as the current camera state. Both\ncompletion events return `Err CameraError` when their operation fails.\n\n\n# Installation\n\nInstall the Elm package:\n\n```sh\nelm install mbr/elm-camera\n```\n\nElm packages cannot declare ports. Make `Main.elm` a `port module`, or add an\napplication-owned port module containing these declarations:\n\n    import Camera exposing (CommandPort, EventPort)\n\n    port cameraCmd : CommandPort msg\n\n    port cameraMsg : EventPort msg\n\nThe JavaScript runtime expects the exact port names `cameraCmd` and\n`cameraMsg`.\n\nCopy\n[`js/elm-camera.js`](https://github.com/mbr/elm-camera/blob/1.0.0/js/elm-camera.js)\ninto the browser assets. Load the runtime and compiled Elm application,\ninitialize Elm, and then initialize the camera runtime:\n\n```html\n<script src=\"elm-camera.js\"></script>\n<script src=\"app.js\"></script>\n<script>\nvar app = Elm.Main.init({\n  node: document.getElementById(\"elm\")\n});\nvar cameraRuntime = ElmCamera.initApp(app);\n</script>\n```\n\n`initApp` returns a small runtime object. Most applications can leave it running\nfor the lifetime of the page. If your Elm application is removed or replaced,\ncall `shutdown()` to release its cameras, snapshots, and any URLs created for\nthose snapshots.\n\nIf the `cameraCmd` port is not present, `initApp` simply returns `null`.\nApplication-owned browser integrations can resolve a retained snapshot handle\nwith `cameraRuntime.snapshotBlob(handle)`. Use `Snapshot.encodeHandle` and\n`Snapshot.handleDecoder` at their port boundaries.\n\nCamera access requires a secure browser context, so use HTTPS in production.\nBrowsers normally treat `http://localhost`, `http://127.0.0.1`, and\n`http://[::1]` as trustworthy for local development. A phone visiting a plain\nHTTP address on the local network is not using localhost and generally needs\nHTTPS.\n\n\n# Basic usage\n\nCall `openRear` from a user action, subscribe to camera events, and track the\npending operation in your application's model until `OpenCompleted` arrives:\n\n    import Camera\n    import CameraPorts as Ports\n\n    type Model\n        = Opening\n        | Ready Camera.OpenedCamera\n        | Failed Camera.CameraError\n\n    type Msg\n        = CameraEvent Camera.Event\n\n    init : () -> ( Model, Cmd Msg )\n    init _ =\n        ( Opening, Camera.openRear Ports.cameraCmd )\n\n    update : Msg -> Model -> ( Model, Cmd Msg )\n    update msg model =\n        case msg of\n            CameraEvent (Camera.OpenCompleted result) ->\n                case result of\n                    Ok camera ->\n                        ( Ready camera, Cmd.none )\n\n                    Err error ->\n                        ( Failed error, Cmd.none )\n\n            CameraEvent _ ->\n                ( model, Cmd.none )\n\n    subscriptions : Model -> Sub Msg\n    subscriptions _ =\n        Sub.map CameraEvent (Camera.subscribe Ports.cameraMsg)\n\nA successful open returns the camera ID together with its capabilities and\nactive settings. Camera acquisition and permission failures arrive as\n`Err CameraError`.\n\n\n# Ports\n\n`CommandPort` and `EventPort` match the two application-owned ports shown above.\nPass those ports to camera commands and subscriptions.\n\n@docs CommandPort, EventPort\n\n\n# Commands and events\n\nOnly one camera can be opening at a time. Wait for a command's completion event\nbefore sending another command that changes the same camera.\n\nThe named functions below cover the usual commands. `send` is available when it\nis more convenient to work with `Command` values directly. `subscribe` receives\nboth replies to commands and events generated by an open camera.\n\n@docs Command, Event, send, subscribe\n\n\n# Opening and devices\n\n`open` uses the browser's default camera, which is usually the right choice for\ndesktop computers and USB webcams. `openFront` and `openRear` ask for a camera\nfacing in a particular direction, but still allow the browser to choose another\ncamera when needed.\n\nUse `openWithOptions` to choose a device or ask for particular initial settings.\n`devices` can help with device pickers, but opening a camera is the only way to\nknow whether it is available. If the browser lists a camera without an ID,\n`devices` returns `Err DeviceInformationUnavailable`. Opening a camera and then\ncalling `devices` again will usually reveal IDs and labels.\n\nCamera settings and facing modes are defined in\n[`Camera.Configuration`](Camera-Configuration).\n\n@docs Device, DeviceId, OpenOptions, defaultOpenOptions, OpenedCamera\n@docs devices, open, openFront, openRear, openWithOptions\n\n\n# Camera information and configuration\n\nCamera configuration has four parts:\n\n  - `supportedConstraints` tells you which setting names the browser knows.\n  - `capabilities` tells you what an open camera can do.\n  - `Configuration.Constraints` contains the values your application asks for.\n  - `settings` tells you what the browser is actually using.\n\nKeep your constraints in your application model when making several changes.\nA property the browser does not report is `Nothing`. Even when a property is\nsupported, a particular value or combination may still fail. After calling\n`configure`, use the `Configuration.Settings` from `ConfigureCompleted` as the\ncamera's current settings.\n\nFor example, request continuous autofocus only when the camera advertises it:\n\n    import Camera.Configuration as Configuration\n\n    enableContinuousFocus :\n        CommandPort msg\n        -> OpenedCamera\n        -> Configuration.Constraints\n        -> Cmd msg\n    enableContinuousFocus commandPort camera constraints =\n        if\n            camera.capabilities.focusMode\n                |> Maybe.withDefault []\n                |> List.member Configuration.Continuous\n        then\n            configure commandPort\n                camera.id\n                { constraints\n                    | focusMode = Just Configuration.Continuous\n                }\n\n        else\n            Cmd.none\n\nSee [`Camera.Configuration`](Camera-Configuration) for the control types and a\ndetailed explanation of capabilities, constraints, and settings.\n\n@docs supportedConstraints, capabilities, settings, configure\n\n\n# Preview\n\n`preview` creates an HTML element showing the camera's live video. You can add\nany HTML attributes your application needs, for example:\n\n    Camera.preview camera.id\n        [ Html.Attributes.class \"my-viewfinder\" ]\n\nRemoving the element does not close the camera, and adding it again reconnects\nthe preview. The same camera can appear in more than one preview, and regular\nHTML or SVG can be placed over it.\n\n@docs CameraId, preview\n\n\n# Snapshots\n\n`capturePng` takes a snapshot of the current frame. The PNG stays in the browser\nrather than passing through Elm, and `SnapshotCaptured` returns its metadata and\nan opaque handle.\n\nA successful snapshot is kept until you call `discardSnapshot` for its handle,\nor until the camera runtime shuts down. Removing the handle from your Elm model,\nremoving an image from the page, or closing the camera does not release it. Use\n`snapshotObjectUrl` to show or download the PNG, then call `discardSnapshot`\nwhen it is no longer needed.\n\n    import Camera.Snapshot as Snapshot\n\n    capture : CommandPort msg -> OpenedCamera -> Cmd msg\n    capture commandPort camera =\n        capturePng commandPort camera.id Snapshot.defaultOptions\n\nSee [`Camera.Snapshot`](Camera-Snapshot) for snapshot options, metadata, and URL\ncleanup.\n\n@docs capturePng, snapshotObjectUrl, discardSnapshot\n\n\n# Lifecycle\n\n`setEnabled` pauses or resumes camera output without releasing the camera.\n`close` releases the camera and makes its ID stale. Removing every preview does\nnot close the camera.\n\nA camera can also be muted, unmuted, or ended by the browser or device. These\nchanges arrive through `CameraMuted`, `CameraUnmuted`, and `CameraEnded`. Camera\nand snapshot IDs are never reused, so an old ID cannot accidentally refer to a\nnew resource.\n\n@docs setEnabled, close\n\n\n# Errors\n\nCommand failures arrive in completion events as `Err` values. If a message from\nthe runtime cannot be read, `subscribe` produces `RuntimeError` containing a\n`ProtocolFailure` instead of crashing the Elm application.\n\n@docs CameraError, ProtocolError, errorToString\n\n","unions":[{"name":"CameraError","comment":" Something that went wrong while using `Camera`.\n\n  - `UnsupportedBrowser` means the required browser camera API is absent.\n  - `InsecureContext` means the page is not allowed to request a camera from\n    its current origin.\n  - `PermissionDenied` means camera access was refused.\n  - `DeviceNotFound` means no camera matched the request.\n  - `DeviceInformationUnavailable` means the browser listed a camera without\n    enough information to select it. Opening a camera and trying again may help.\n  - `DeviceUnavailable` means a matching camera could not be read, for example\n    because another application owns it or the operating system rejected it.\n  - `UnsupportedConstraint` means the browser does not recognize a requested\n    constraint.\n  - `Overconstrained` contains the reported constraint name, when available,\n    and the browser's message.\n  - `OpenAlreadyPending` means another open operation has not completed.\n  - `OperationCanceled` means the operation was canceled before completion.\n  - `StaleCamera` and `StaleSnapshot` identify resources that no longer exist.\n  - `PreviewFailed`, `CaptureFailed`, and `EncodingFailed` describe failures in\n    their respective operations.\n  - `UnknownCameraError` preserves an otherwise unclassified browser failure.\n  - `ProtocolFailure` contains a message from the runtime that Elm could not\n    read.\n\n","args":[],"cases":[["UnsupportedBrowser",["String.String"]],["InsecureContext",[]],["PermissionDenied",[]],["DeviceNotFound",[]],["DeviceInformationUnavailable",[]],["DeviceUnavailable",["String.String"]],["UnsupportedConstraint",["String.String"]],["Overconstrained",["Maybe.Maybe String.String","String.String"]],["OpenAlreadyPending",[]],["OperationCanceled",[]],["StaleCamera",["Camera.CameraId"]],["StaleSnapshot",["Camera.Snapshot.Handle"]],["PreviewFailed",["String.String"]],["CaptureFailed",["String.String"]],["EncodingFailed",["String.String"]],["UnknownCameraError",["String.String"]],["ProtocolFailure",["Camera.ProtocolError"]]]},{"name":"Command","comment":" A request sent to the browser runtime.\n\nMost applications can use the named command functions. `send` is useful when\nkeeping commands as values is more convenient.\n\n","args":[],"cases":[["EnumerateDevices",[]],["Open",["Camera.OpenOptions"]],["SetEnabled",["Camera.CameraId","Basics.Bool"]],["Close",["Camera.CameraId"]],["GetSupportedConstraints",[]],["GetCapabilities",["Camera.CameraId"]],["GetSettings",["Camera.CameraId"]],["Configure",["Camera.CameraId","Camera.Configuration.Constraints"]],["CapturePng",["Camera.CameraId","Camera.Snapshot.Options"]],["CreateSnapshotObjectUrl",["Camera.Snapshot.Handle"]],["DiscardSnapshot",["Camera.Snapshot.Handle"]]]},{"name":"Event","comment":" A reply or camera event received from the browser runtime.\n\nEach command produces a matching completion event containing a `Result`.\nDevice and camera changes can arrive on their own. `RuntimeError` contains a\nfailure that could not be tied to a completion event. An ended camera is already\nclosed and does not need to be passed to `close`.\n\n","args":[],"cases":[["DevicesCompleted",["Result.Result Camera.CameraError (List.List Camera.Device)"]],["DevicesChanged",["Result.Result Camera.CameraError (List.List Camera.Device)"]],["OpenCompleted",["Result.Result Camera.CameraError Camera.OpenedCamera"]],["EnabledCompleted",["Camera.CameraId","Basics.Bool","Result.Result Camera.CameraError ()"]],["CloseCompleted",["Camera.CameraId","Result.Result Camera.CameraError ()"]],["SupportedConstraintsCompleted",["Result.Result Camera.CameraError (List.List Camera.Configuration.SupportedConstraint)"]],["CapabilitiesCompleted",["Camera.CameraId","Result.Result Camera.CameraError Camera.Configuration.Capabilities"]],["SettingsCompleted",["Camera.CameraId","Result.Result Camera.CameraError Camera.Configuration.Settings"]],["ConfigureCompleted",["Camera.CameraId","Result.Result Camera.CameraError Camera.Configuration.Settings"]],["SnapshotCaptured",["Camera.CameraId","Result.Result Camera.CameraError Camera.Snapshot.Metadata"]],["SnapshotObjectUrlCreated",["Camera.Snapshot.Handle","Result.Result Camera.CameraError Camera.Snapshot.Url"]],["SnapshotDiscarded",["Camera.Snapshot.Handle","Result.Result Camera.CameraError ()"]],["CameraMuted",["Camera.CameraId"]],["CameraUnmuted",["Camera.CameraId"]],["CameraEnded",["Camera.CameraId"]],["RuntimeError",["Camera.CameraError"]]]}],"aliases":[{"name":"CameraId","comment":" A handle for an open camera.\n\nThe camera itself stays in the browser. IDs are never reused, and using one\nafter its camera has closed or ended produces `StaleCamera`.\n\n","args":[],"type":"Camera.Internal.Id.CameraId"},{"name":"CommandPort","comment":" A port provided by the application for sending camera commands to the\nbrowser.\n","args":["msg"],"type":"( String.String, Json.Encode.Value ) -> Platform.Cmd.Cmd msg"},{"name":"Device","comment":" A camera listed by the browser.\n\nThe label is `Nothing` when the browser does not provide one.\n\n","args":[],"type":"{ id : Camera.DeviceId, label : Maybe.Maybe String.String }"},{"name":"DeviceId","comment":" A camera device known to the browser.\n","args":[],"type":"Camera.Internal.Id.DeviceId"},{"name":"EventPort","comment":" A port provided by the application for receiving camera events from the\nbrowser.\n","args":["msg"],"type":"(( String.String, Json.Encode.Value ) -> msg) -> Platform.Sub.Sub msg"},{"name":"OpenOptions","comment":" The device and initial settings to ask for when opening a camera.\n","args":[],"type":"{ deviceId : Maybe.Maybe Camera.DeviceId, constraints : Camera.Configuration.Constraints }"},{"name":"OpenedCamera","comment":" The handle and initial information returned for an opened camera.\n","args":[],"type":"{ id : Camera.CameraId, capabilities : Camera.Configuration.Capabilities, settings : Camera.Configuration.Settings }"},{"name":"ProtocolError","comment":" Details about a message from the browser runtime that Elm could not read.\n","args":[],"type":"{ event : String.String, message : String.String }"}],"values":[{"name":"capabilities","comment":" Ask what an open camera can do.\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Platform.Cmd.Cmd msg"},{"name":"capturePng","comment":" Take a PNG snapshot of the camera's current frame.\n\nThe result arrives in `SnapshotCaptured`. The PNG stays in the browser until\nits handle is passed to `discardSnapshot` or the runtime shuts down.\n\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Camera.Snapshot.Options -> Platform.Cmd.Cmd msg"},{"name":"close","comment":" Close and release a camera.\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Platform.Cmd.Cmd msg"},{"name":"configure","comment":" Ask a camera to use new settings.\n\nThe result arrives in `ConfigureCompleted` with the settings the browser\nactually applied.\n\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Camera.Configuration.Constraints -> Platform.Cmd.Cmd msg"},{"name":"defaultOpenOptions","comment":" Options that let the browser choose the camera and its settings.\n","type":"Camera.OpenOptions"},{"name":"devices","comment":" Ask the browser for its current list of cameras.\n\nBrowsers often hide device IDs until the page has opened a camera. In that\ncase, the result is `Err DeviceInformationUnavailable`. Call `devices` again\nafter a successful `OpenCompleted` to get the selectable cameras.\n\n","type":"Camera.CommandPort msg -> Platform.Cmd.Cmd msg"},{"name":"discardSnapshot","comment":" Release a snapshot and any browser URLs created for it.\n\nThe result arrives in `SnapshotDiscarded`. A snapshot that has already been\nreleased produces `StaleSnapshot`.\n\n","type":"Camera.CommandPort msg -> Camera.Snapshot.Handle -> Platform.Cmd.Cmd msg"},{"name":"errorToString","comment":" Describe a camera error in friendly language.\n\nBrowser-provided details are included when they help explain the failure.\n\n","type":"Camera.CameraError -> String.String"},{"name":"open","comment":" Open the browser's default camera.\n\nThis is usually the right choice on desktop computers. The result arrives in\n`OpenCompleted`.\n\n","type":"Camera.CommandPort msg -> Platform.Cmd.Cmd msg"},{"name":"openFront","comment":" Open a camera while preferring one that faces the user.\n\nThe browser may choose another camera when needed. The result arrives in\n`OpenCompleted`.\n\n","type":"Camera.CommandPort msg -> Platform.Cmd.Cmd msg"},{"name":"openRear","comment":" Open a camera while preferring one that faces away from the user.\n\nThe browser may choose another camera when needed. The result arrives in\n`OpenCompleted`.\n\n","type":"Camera.CommandPort msg -> Platform.Cmd.Cmd msg"},{"name":"openWithOptions","comment":" Open a camera with a chosen device or initial settings.\n\nThe result arrives in `OpenCompleted`.\n\n","type":"Camera.CommandPort msg -> Camera.OpenOptions -> Platform.Cmd.Cmd msg"},{"name":"preview","comment":" Show a camera's live video in a `camera-preview` element.\n\nThe given attributes are added to the element. Adding, removing, or changing a\npreview does not open or close its camera.\n\n","type":"Camera.CameraId -> List.List (Html.Attribute msg) -> Html.Html msg"},{"name":"send","comment":" Send a `Command` through the application's command port.\n\nThe named command functions are usually more convenient.\n\n","type":"Camera.CommandPort msg -> Camera.Command -> Platform.Cmd.Cmd msg"},{"name":"setEnabled","comment":" Pause or resume camera output without releasing the camera.\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Basics.Bool -> Platform.Cmd.Cmd msg"},{"name":"settings","comment":" Ask which settings a camera is currently using.\n","type":"Camera.CommandPort msg -> Camera.CameraId -> Platform.Cmd.Cmd msg"},{"name":"snapshotObjectUrl","comment":" Create a browser URL for showing or downloading a snapshot.\n","type":"Camera.CommandPort msg -> Camera.Snapshot.Handle -> Platform.Cmd.Cmd msg"},{"name":"subscribe","comment":" Listen for camera events through the application's event port.\n\nUse `Sub.map` to turn these events into application messages. Keep the\nsubscription active while a command is pending or a camera is open.\n\n","type":"Camera.EventPort Camera.Event -> Platform.Sub.Sub Camera.Event"},{"name":"supportedConstraints","comment":" Ask which camera setting names the browser recognizes.\n","type":"Camera.CommandPort msg -> Platform.Cmd.Cmd msg"}],"binops":[]},{"name":"Camera.Configuration","comment":" Types for asking what a camera can do and changing how it behaves.\n\nAn application can change only settings that both the browser recognizes and\nthe particular camera supports.\n\nCamera configuration has three related parts:\n\n  - `Capabilities` contains the values a camera can support.\n  - `Constraints` contains the values the application asks for.\n  - `Settings` contains the values the browser is actually using.\n\nA browser may know a setting without supporting every value or combination on\na particular camera. Properties it does not report are `Nothing`. After\nconfiguring a camera, use the returned `Settings` as the camera's current\nsettings.\n\n\n# Camera state\n\n@docs Capabilities, Constraints, defaultConstraints, Settings\n\n\n# Constraint support\n\n@docs SupportedConstraint, supportedConstraintToString, NumericRange, contains\n\n\n# Modes\n\n@docs FacingMode, facingModeToString, MeteringMode, meteringModeToString, ResizeMode, resizeModeToString\n\n","unions":[{"name":"FacingMode","comment":" The direction a camera faces relative to its device.\n\nUnknown values are kept so newer browser values can still pass through Elm.\n\n","args":[],"cases":[["UserFacing",[]],["EnvironmentFacing",[]],["LeftFacing",[]],["RightFacing",[]],["UnknownFacingMode",["String.String"]]]},{"name":"MeteringMode","comment":" An automatic or manual mode used by camera controls.\n\n`Continuous` is commonly used for autofocus, automatic exposure, and automatic\nwhite balance. Unknown browser values are kept in `UnknownMeteringMode`.\n\n","args":[],"cases":[["NoMetering",[]],["Manual",[]],["SingleShot",[]],["Continuous",[]],["UnknownMeteringMode",["String.String"]]]},{"name":"ResizeMode","comment":" Whether the browser may crop and scale camera output.\n","args":[],"cases":[["NoResize",[]],["CropAndScale",[]],["UnknownResizeMode",["String.String"]]]},{"name":"SupportedConstraint","comment":" A camera setting name recognized by the browser.\n\nA particular camera may still not support the setting or a requested\ncombination of values. Unknown names are kept in `UnknownConstraint`.\n\n","args":[],"cases":[["WidthConstraint",[]],["HeightConstraint",[]],["AspectRatioConstraint",[]],["FrameRateConstraint",[]],["FacingModeConstraint",[]],["ResizeModeConstraint",[]],["FocusModeConstraint",[]],["FocusDistanceConstraint",[]],["ExposureModeConstraint",[]],["ExposureCompensationConstraint",[]],["ExposureTimeConstraint",[]],["IsoConstraint",[]],["WhiteBalanceModeConstraint",[]],["ColorTemperatureConstraint",[]],["BrightnessConstraint",[]],["ContrastConstraint",[]],["SaturationConstraint",[]],["SharpnessConstraint",[]],["ZoomConstraint",[]],["TorchConstraint",[]],["PanConstraint",[]],["TiltConstraint",[]],["BackgroundBlurConstraint",[]],["UnknownConstraint",["String.String"]]]}],"aliases":[{"name":"Capabilities","comment":" The values supported by an open camera.\n\nNumbers use ranges, while modes and Boolean properties list their available\nvalues. `Nothing` means the camera does not report that property.\n\n","args":[],"type":"{ width : Maybe.Maybe Camera.Configuration.NumericRange, height : Maybe.Maybe Camera.Configuration.NumericRange, aspectRatio : Maybe.Maybe Camera.Configuration.NumericRange, frameRate : Maybe.Maybe Camera.Configuration.NumericRange, facingMode : Maybe.Maybe (List.List Camera.Configuration.FacingMode), resizeMode : Maybe.Maybe (List.List Camera.Configuration.ResizeMode), focusMode : Maybe.Maybe (List.List Camera.Configuration.MeteringMode), focusDistance : Maybe.Maybe Camera.Configuration.NumericRange, exposureMode : Maybe.Maybe (List.List Camera.Configuration.MeteringMode), exposureCompensation : Maybe.Maybe Camera.Configuration.NumericRange, exposureTime : Maybe.Maybe Camera.Configuration.NumericRange, iso : Maybe.Maybe Camera.Configuration.NumericRange, whiteBalanceMode : Maybe.Maybe (List.List Camera.Configuration.MeteringMode), colorTemperature : Maybe.Maybe Camera.Configuration.NumericRange, brightness : Maybe.Maybe Camera.Configuration.NumericRange, contrast : Maybe.Maybe Camera.Configuration.NumericRange, saturation : Maybe.Maybe Camera.Configuration.NumericRange, sharpness : Maybe.Maybe Camera.Configuration.NumericRange, zoom : Maybe.Maybe Camera.Configuration.NumericRange, torch : Maybe.Maybe (List.List Basics.Bool), pan : Maybe.Maybe Camera.Configuration.NumericRange, tilt : Maybe.Maybe Camera.Configuration.NumericRange, backgroundBlur : Maybe.Maybe (List.List Basics.Bool) }"},{"name":"Constraints","comment":" Settings to ask a camera to use.\n\nEvery field is optional. Keep this value in your application model when making\nseveral changes, and use `defaultConstraints` when starting without preferences.\n\n","args":[],"type":"{ width : Maybe.Maybe Basics.Float, height : Maybe.Maybe Basics.Float, aspectRatio : Maybe.Maybe Basics.Float, frameRate : Maybe.Maybe Basics.Float, facingMode : Maybe.Maybe Camera.Configuration.FacingMode, resizeMode : Maybe.Maybe Camera.Configuration.ResizeMode, focusMode : Maybe.Maybe Camera.Configuration.MeteringMode, focusDistance : Maybe.Maybe Basics.Float, exposureMode : Maybe.Maybe Camera.Configuration.MeteringMode, exposureCompensation : Maybe.Maybe Basics.Float, exposureTime : Maybe.Maybe Basics.Float, iso : Maybe.Maybe Basics.Float, whiteBalanceMode : Maybe.Maybe Camera.Configuration.MeteringMode, colorTemperature : Maybe.Maybe Basics.Float, brightness : Maybe.Maybe Basics.Float, contrast : Maybe.Maybe Basics.Float, saturation : Maybe.Maybe Basics.Float, sharpness : Maybe.Maybe Basics.Float, zoom : Maybe.Maybe Basics.Float, torch : Maybe.Maybe Basics.Bool, pan : Maybe.Maybe Basics.Float, tilt : Maybe.Maybe Basics.Float, backgroundBlur : Maybe.Maybe Basics.Bool }"},{"name":"NumericRange","comment":" A range of values supported by a camera.\n\n`step` is `Nothing` when the camera does not report an increment.\n\n","args":[],"type":"{ minimum : Basics.Float, maximum : Basics.Float, step : Maybe.Maybe Basics.Float }"},{"name":"Settings","comment":" The settings a camera is currently using.\n\nThe browser returns these after opening or configuring a camera. A field is\n`Nothing` when the browser does not report it.\n\n","args":[],"type":"{ width : Maybe.Maybe Basics.Int, height : Maybe.Maybe Basics.Int, aspectRatio : Maybe.Maybe Basics.Float, frameRate : Maybe.Maybe Basics.Float, facingMode : Maybe.Maybe Camera.Configuration.FacingMode, resizeMode : Maybe.Maybe Camera.Configuration.ResizeMode, deviceId : Maybe.Maybe Camera.Internal.Id.DeviceId, groupId : Maybe.Maybe String.String, focusMode : Maybe.Maybe Camera.Configuration.MeteringMode, focusDistance : Maybe.Maybe Basics.Float, exposureMode : Maybe.Maybe Camera.Configuration.MeteringMode, exposureCompensation : Maybe.Maybe Basics.Float, exposureTime : Maybe.Maybe Basics.Float, iso : Maybe.Maybe Basics.Float, whiteBalanceMode : Maybe.Maybe Camera.Configuration.MeteringMode, colorTemperature : Maybe.Maybe Basics.Float, brightness : Maybe.Maybe Basics.Float, contrast : Maybe.Maybe Basics.Float, saturation : Maybe.Maybe Basics.Float, sharpness : Maybe.Maybe Basics.Float, zoom : Maybe.Maybe Basics.Float, torch : Maybe.Maybe Basics.Bool, pan : Maybe.Maybe Basics.Float, tilt : Maybe.Maybe Basics.Float, backgroundBlur : Maybe.Maybe Basics.Bool }"}],"values":[{"name":"contains","comment":" Check whether a value is within a camera's advertised minimum and maximum.\n\nThis does not check whether the value follows the optional `step` increment.\n\n","type":"Camera.Configuration.NumericRange -> Basics.Float -> Basics.Bool"},{"name":"defaultConstraints","comment":" Camera constraints with no requested values.\n","type":"Camera.Configuration.Constraints"},{"name":"facingModeToString","comment":" Return the Web API name for a facing mode.\n","type":"Camera.Configuration.FacingMode -> String.String"},{"name":"meteringModeToString","comment":" Return the Web API name for a metering mode.\n","type":"Camera.Configuration.MeteringMode -> String.String"},{"name":"resizeModeToString","comment":" Return the Web API name for a resize mode.\n","type":"Camera.Configuration.ResizeMode -> String.String"},{"name":"supportedConstraintToString","comment":" Return the Web API name for a supported constraint.\n","type":"Camera.Configuration.SupportedConstraint -> String.String"}],"binops":[]},{"name":"Camera.Snapshot","comment":" Types for working with PNG snapshots.\n\nSnapshot data stays in the browser rather than passing through Elm ports. Elm\nreceives `Metadata` with an opaque `Handle`, which can be used to create a URL\nfor showing or downloading the PNG.\n\nThe browser keeps each successful snapshot until its handle is passed to\n`Camera.discardSnapshot`, or until the camera runtime shuts down. Dropping the\nhandle from your Elm model, removing an image from the page, or closing the\ncamera does not release the snapshot. `Camera.discardSnapshot` releases both\nthe PNG and any URLs created for it. A browser integration that retains the\nimmutable `Blob` returned by `cameraRuntime.snapshotBlob(handle)` can extend the\nunderlying data's lifetime beyond that operation.\n\n\n# Identity and metadata\n\n@docs Handle, Url, Metadata\n\n\n# Capture options\n\n@docs Options, Crop, defaultOptions\n\n\n# Browser integrations\n\n@docs encodeHandle, handleDecoder\n\n\n# Object URLs\n\n@docs urlToString\n\n","unions":[],"aliases":[{"name":"Crop","comment":" A rectangular part of the camera image, measured in pixels.\n","args":[],"type":"{ x : Basics.Int, y : Basics.Int, width : Basics.Int, height : Basics.Int }"},{"name":"Handle","comment":" A handle for a PNG snapshot stored in the browser.\n\nThe snapshot remains stored until this handle is passed to\n`Camera.discardSnapshot` or the runtime shuts down. Handles are never reused.\n\n","args":[],"type":"Camera.Internal.Id.SnapshotHandle"},{"name":"Metadata","comment":" Information about a PNG snapshot stored in the browser.\n\n`byteSize` is the size of the encoded PNG.\n\n","args":[],"type":"{ handle : Camera.Snapshot.Handle, width : Basics.Int, height : Basics.Int, mimeType : String.String, byteSize : Basics.Int }"},{"name":"Options","comment":" Options for cropping and resizing a PNG snapshot.\n\nThe crop uses pixels from the camera image. `width` and `height` resize the\nresult before it is encoded. When only one dimension is given, the original\naspect ratio is preserved.\n\n","args":[],"type":"{ crop : Maybe.Maybe Camera.Snapshot.Crop, width : Maybe.Maybe Basics.Int, height : Maybe.Maybe Basics.Int }"},{"name":"Url","comment":" A browser URL created for showing or downloading a snapshot.\n","args":[],"type":"Camera.Internal.Id.SnapshotUrl"}],"values":[{"name":"defaultOptions","comment":" Options that keep the complete camera frame at its original size.\n","type":"Camera.Snapshot.Options"},{"name":"encodeHandle","comment":" Encode a snapshot handle for an application-owned browser integration.\n","type":"Camera.Snapshot.Handle -> Json.Encode.Value"},{"name":"handleDecoder","comment":" Decode a snapshot handle returned by an application-owned browser integration.\n","type":"Json.Decode.Decoder Camera.Snapshot.Handle"},{"name":"urlToString","comment":" Get the string value of a snapshot URL.\n\nThe URL works until its snapshot is discarded and should not be stored\npermanently.\n\n","type":"Camera.Snapshot.Url -> String.String"}],"binops":[]}]