[{"name":"REGL","comment":"\n\n\n# REGL\n\nThis module exposes basic primitives for rendering with REGL.\n\n\n## Basics\n\n@docs Renderable, genProg, group, empty, render, Effect\n\n\n\n## User Configuration\n\n@docs REGLConfig, TimeInterval, configREGL\n\n\n## Direct REGL Commands\n\n@docs REGLStartConfig\n\n@docs TextureMagOption, TextureMinOption, TextureOptions, batchExec, createREGLProgram, loadTexture, startREGL, loadMSDFFont\n\n@docs decodeRecvMsg, Texture, REGLRecvMsg\n\n\n## Miscellaneous\n\n@docs toHtmlWith\n\n","unions":[{"name":"REGLRecvMsg","comment":" Receive messages from REGL.\n","args":[],"cases":[["REGLTextureLoaded",["REGL.Texture"]],["REGLFontLoaded",["String.String"]],["REGLProgramCreated",["String.String"]]]},{"name":"TextureMagOption","comment":" The magnification option for textures.\n\nUsers should use `MagLinear` for most cases.\nHowever, if pixel art is used, `MagNearest` should be used.\n\n","args":[],"cases":[["MagNearest",[]],["MagLinear",[]]]},{"name":"TextureMinOption","comment":" The minification option for textures.\n\nSimilar to the magnification option, users should use `MinLinear` for most cases.\n\n","args":[],"cases":[["MinNearest",[]],["MinLinear",[]],["NearestMipmapNearest",[]],["LinearMipmapNearest",[]],["NearestMipmapLinear",[]],["LinearMipmapLinear",[]]]},{"name":"TimeInterval","comment":" A time interval for the REGL configuration.\n\nUse `Millisecond` for fixed time intervals, and `AnimationFrame` for rendering at the refresh rate of the display.\n\n`Millisecond` should be considered as a debugging tool, and `AnimationFrame` should be used for production.\n\n","args":[],"cases":[["AnimationFrame",[]],["Millisecond",["Basics.Float"]]]}],"aliases":[{"name":"Effect","comment":" A post-processing effect.\n","args":[],"type":"REGL.Common.Effect"},{"name":"REGLConfig","comment":" The user configuration for REGL. Differing from the starting options. Users could change this at runtime.\n","args":[],"type":"{ timeInterval : REGL.TimeInterval }"},{"name":"REGLStartConfig","comment":" The configuration for starting REGL.\n\n`virtWidth` and `virtHeight` are the virtual width and height users defined.\n\n`fboNum` is the number of framebuffers created.\n\n`builtinPrograms` is a list of built-in programs that users want to enable.\n\n","args":[],"type":"{ virtWidth : Basics.Float, virtHeight : Basics.Float, fboNum : Basics.Int, builtinPrograms : Maybe.Maybe (List.List String.String) }"},{"name":"Renderable","comment":" A renderable object that can be rendered by REGL.\n","args":[],"type":"REGL.Common.Renderable"},{"name":"Texture","comment":" Texture Information\n","args":[],"type":"{ name : String.String, width : Basics.Int, height : Basics.Int }"},{"name":"TextureOptions","comment":" The texture options.\n","args":[],"type":"{ mag : Maybe.Maybe REGL.TextureMagOption, min : Maybe.Maybe REGL.TextureMinOption }"}],"values":[{"name":"batchExec","comment":" Execute a batch of commands.\n","type":"REGL.ExecPort msg -> List.List (REGL.ExecPort msg -> Platform.Cmd.Cmd msg) -> List.List (Platform.Cmd.Cmd msg)"},{"name":"configREGL","comment":" Reconfigure REGL at runtime.\n","type":"REGL.REGLConfig -> REGL.ExecPort msg -> Platform.Cmd.Cmd msg"},{"name":"createREGLProgram","comment":" Create a user-defined REGL program.\n","type":"String.String -> REGL.Program.REGLProgram -> REGL.ExecPort msg -> Platform.Cmd.Cmd msg"},{"name":"decodeRecvMsg","comment":" Decode a received message.\n","type":"Json.Encode.Value -> Maybe.Maybe REGL.REGLRecvMsg"},{"name":"empty","comment":" An empty renderable object.\n","type":"REGL.Renderable"},{"name":"genProg","comment":" Generate a renderable object from settings. Users can use this function to create custom renderable generators.\n","type":"Json.Encode.Value -> REGL.Renderable"},{"name":"group","comment":" Group a list of renderables into a single renderable with effects.\n","type":"List.List REGL.Effect -> List.List REGL.Renderable -> REGL.Renderable"},{"name":"loadMSDFFont","comment":" Load a MSDF font.\n","type":"String.String -> String.String -> String.String -> REGL.ExecPort msg -> Platform.Cmd.Cmd msg"},{"name":"loadTexture","comment":" Load a texture with name, url and options.\n","type":"String.String -> String.String -> Maybe.Maybe REGL.TextureOptions -> REGL.ExecPort msg -> Platform.Cmd.Cmd msg"},{"name":"render","comment":" Render a renderable object. Users need to use it to pass the render result to REGL in JS through a port.\n","type":"REGL.Renderable -> Json.Encode.Value"},{"name":"startREGL","comment":" Execute the start command for REGL.\n","type":"REGL.REGLStartConfig -> REGL.ExecPort msg -> Platform.Cmd.Cmd msg"},{"name":"toHtmlWith","comment":" Create the canvas HTML element.\n","type":"{ width : Basics.Int, height : Basics.Int } -> List.List (Html.Attribute msg) -> Html.Html msg"}],"binops":[]},{"name":"REGL.BuiltinPrograms","comment":"\n\n\n# Builtin Programs\n\n\n## Builtin Commands\n\n@docs clear, triangle, quad, texture, rectTexture\n@docs textbox, textboxPro, TextBoxOption, circle, centeredTexture, polyPrim, poly\n@docs lines, linestrip, lineloop, functionCurve\n\n\n## Utils\n\n@docs toRgbaList, Primitive, primitiveToValue\n\n\n## Advanced\n\n@docs saveAsTexture\n\n","unions":[{"name":"Primitive","comment":" OpenGL primitive types\n","args":[],"cases":[["Points",[]],["Lines",[]],["LineLoop",[]],["LineStrip",[]],["Triangles",[]],["TriangleStrip",[]],["TriangleFan",[]]]}],"aliases":[{"name":"TextBoxOption","comment":" Full TextBox options.\n","args":[],"type":"{ font : String.String, text : String.String, size : Basics.Float, color : Color.Color, wordBreak : Basics.Bool, width : Maybe.Maybe Basics.Float, lineHeight : Maybe.Maybe Basics.Float, wordSpacing : Maybe.Maybe Basics.Float, align : Maybe.Maybe String.String, letterSpacing : Maybe.Maybe Basics.Float }"}],"values":[{"name":"centeredTexture","comment":" Render a texture with center, size and angle for rotation.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Basics.Float -> String.String -> REGL.Common.Renderable"},{"name":"circle","comment":" Render a circle with center, radius and color.\n","type":"( Basics.Float, Basics.Float ) -> Basics.Float -> Color.Color -> REGL.Common.Renderable"},{"name":"clear","comment":" Clear the canvas with a color.\n","type":"Color.Color -> REGL.Common.Renderable"},{"name":"functionCurve","comment":" Render a function curve with a function, offset, range, samples, and color.\n","type":"(Basics.Float -> Basics.Float) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Basics.Float -> Color.Color -> REGL.Common.Renderable"},{"name":"lineloop","comment":" Render a line loop with vertices and color.\n","type":"List.List ( Basics.Float, Basics.Float ) -> Color.Color -> REGL.Common.Renderable"},{"name":"lines","comment":" Render lines with vertices and color.\n","type":"List.List ( ( Basics.Float, Basics.Float ), ( Basics.Float, Basics.Float ) ) -> Color.Color -> REGL.Common.Renderable"},{"name":"linestrip","comment":" Render line strip with vertices and color.\n","type":"List.List ( Basics.Float, Basics.Float ) -> Color.Color -> REGL.Common.Renderable"},{"name":"poly","comment":" Render a poly with vertices and color.\n","type":"List.List ( Basics.Float, Basics.Float ) -> Color.Color -> REGL.Common.Renderable"},{"name":"polyPrim","comment":" Render a poly with vertices, element array, primitives and color.\n","type":"List.List ( Basics.Float, Basics.Float ) -> List.List Basics.Float -> Color.Color -> REGL.BuiltinPrograms.Primitive -> REGL.Common.Renderable"},{"name":"primitiveToValue","comment":" Convert a primitive to a value.\n","type":"REGL.BuiltinPrograms.Primitive -> Json.Encode.Value"},{"name":"quad","comment":" Render a quad with three vertices and color.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Color.Color -> REGL.Common.Renderable"},{"name":"rectTexture","comment":" Render a texture with left-bottom coordinates and size.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> String.String -> REGL.Common.Renderable"},{"name":"saveAsTexture","comment":" Save the current FBO as a texture.\n\nThis is only an experimental feature and should be used with caution.\n\n","type":"String.String -> REGL.Common.Renderable"},{"name":"textbox","comment":" Render a textbox.\n","type":"( Basics.Float, Basics.Float ) -> Basics.Float -> String.String -> String.String -> Color.Color -> REGL.Common.Renderable"},{"name":"textboxPro","comment":" Render a textbox with more options.\n","type":"( Basics.Float, Basics.Float ) -> REGL.BuiltinPrograms.TextBoxOption -> REGL.Common.Renderable"},{"name":"texture","comment":" Render a texture with 4 points: left-bottom, right-bottom, right-top and left-top.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> String.String -> REGL.Common.Renderable"},{"name":"toRgbaList","comment":" Convert a color to a list of RGBA values.\n","type":"Color.Color -> List.List Basics.Float"},{"name":"triangle","comment":" Render a triangle with three vertices and color.\n","type":"( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> ( Basics.Float, Basics.Float ) -> Color.Color -> REGL.Common.Renderable"}],"binops":[]},{"name":"REGL.Compositors","comment":"\n\n\n# Compositors\n\nCompose two renderables using various shaders.\n\n\n## Default Compositors\n\n@docs dstOverSrc, maskBySrc\n\n\n## Fading Compositor\n\n@docs linearFade, imgFade\n\n","unions":[],"aliases":[],"values":[{"name":"dstOverSrc","comment":" Draw the dst renderable over the src renderable.\n","type":"REGL.Common.Renderable -> REGL.Common.Renderable -> REGL.Common.Renderable"},{"name":"imgFade","comment":" Fading effect using a mask image.\n\nMask image is a gradient image, similar to [this](https://github.com/linsyking/elm-regl/blob/main/docs/asset/mask.jpg).\n\n","type":"String.String -> Basics.Float -> REGL.Common.Renderable -> REGL.Common.Renderable -> REGL.Common.Renderable"},{"name":"linearFade","comment":" Linear fading effect.\n","type":"Basics.Float -> REGL.Common.Renderable -> REGL.Common.Renderable -> REGL.Common.Renderable"},{"name":"maskBySrc","comment":" Draw the dst renderable masked by the src renderable.\n","type":"REGL.Common.Renderable -> REGL.Common.Renderable -> REGL.Common.Renderable"}],"binops":[]},{"name":"REGL.Effects","comment":"\n\n\n# Effects\n\n@docs blur, gblur, crt, fxaa, alphamult\n\n","unions":[],"aliases":[],"values":[{"name":"alphamult","comment":" Multiply the alpha of a renderable.\n","type":"Basics.Float -> REGL.Common.Effect"},{"name":"blur","comment":" Blurs a renderable.\n","type":"Basics.Float -> REGL.Common.Effect"},{"name":"crt","comment":" Simple CRT effect. Must be applied at the outermost layer.\n","type":"Basics.Float -> REGL.Common.Effect"},{"name":"fxaa","comment":" Apply FXAA to a renderable.\n","type":"REGL.Common.Effect"},{"name":"gblur","comment":" Blurs a renderable. Gaussian blur.\n","type":"Basics.Float -> REGL.Common.Effect"}],"binops":[]},{"name":"REGL.Program","comment":"\n\n\n# Custom REGL Program\n\nUsers could define their own custom REGL program using this module.\nREGL programs could be used as a renderable generator, effect, or compositor.\n\n\n## Program Value\n\n@docs ProgValue\n\n\n## Program Construction\n\n@docs REGLProgram, encodeProgram\n\nUsually users could use the following functions to construct a custom program by only providing the fragment shader and uniforms:\n\n@docs makeEffectSimple, makeCompositorSimple\n\nIf more customization is needed, users could use the following functions:\n\n@docs makeCompositorProgram, makeEffectProgram\n\n","unions":[{"name":"ProgValue","comment":" A value that can be either a static value or a dynamic value.\n","args":[],"cases":[["DynamicValue",["String.String"]],["StaticValue",["Json.Encode.Value"]],["DynamicTextureValue",["String.String"]]]}],"aliases":[{"name":"REGLProgram","comment":" A custom program that can be used with REGL.\n","args":[],"type":"{ frag : String.String, vert : String.String, attributes : Maybe.Maybe (List.List ( String.String, REGL.Program.ProgValue )), uniforms : Maybe.Maybe (List.List ( String.String, REGL.Program.ProgValue )), elements : Maybe.Maybe REGL.Program.ProgValue, primitive : Maybe.Maybe REGL.Program.ProgValue, count : Maybe.Maybe REGL.Program.ProgValue }"}],"values":[{"name":"encodeProgram","comment":" Encode a custom program to an object.\n","type":"REGL.Program.REGLProgram -> Json.Encode.Value"},{"name":"makeCompositorProgram","comment":" Make a custom composite program.\n\n`src` and `dst` are the names of the texture uniforms in the program.\n\n","type":"String.String -> String.String -> REGL.Program.REGLProgram -> REGL.Program.REGLProgram"},{"name":"makeCompositorSimple","comment":" Make a custom composite program simply.\n\n`t1` and `t2` are the names of the texture uniforms in the program.\n\n","type":"String.String -> List.List ( String.String, REGL.Program.ProgValue ) -> REGL.Program.REGLProgram"},{"name":"makeEffectProgram","comment":" Make a custom effect program.\n\n`texname` is the name of the texture uniform in the program.\n\n","type":"String.String -> REGL.Program.REGLProgram -> REGL.Program.REGLProgram"},{"name":"makeEffectSimple","comment":" Make a custom effect program simply.\n\nIn the fragment shader, use `texture2D(texture, vuv)` to sample the texture.\n\nYou could also use `vec2 view` to get the size of virtual canvas.\n\n","type":"String.String -> List.List ( String.String, REGL.Program.ProgValue ) -> REGL.Program.REGLProgram"}],"binops":[]}]