package bimage

  1. Overview
  2. Docs

Module Bimage.ExprSource

Expr define a combinator which can be used to build filters

Sourcetype image = Image.any
Sourcetype 'a t =
  1. | Kernel : Input.index * Kernel.t -> pixel t
  2. | Transform : Input.index * Transform.t -> pixel t
  3. | Image : Input.index -> image t
  4. | Input : Input.index * int t * int t -> pixel t
  5. | X : int t
  6. | Y : int t
  7. | Int : int -> int t
  8. | Float : float -> float t
  9. | Bool : bool -> bool t
  10. | Gt : 'a t * 'a t -> bool t
  11. | Eq : 'a t * 'a t -> bool t
  12. | Lt : 'a t * 'a t -> bool t
  13. | And : bool t * bool t -> bool t
  14. | Or : bool t * bool t -> bool t
  15. | Not : bool t -> bool t
  16. | Cond : bool t * 'a t * 'a t -> 'a t
  17. | Func : 'b t * (int -> int -> 'b -> 'a t) -> 'a t
  18. | Pixel : 'b Pixel.t -> pixel t
  19. | Pixel_get : pixel t * int t -> float t
  20. | Pixel_set : pixel t * int t * float t -> pixel t
  21. | Value : 'a -> 'a t
  22. | Pair : 'a t * 'b t -> ('a * 'b) t
  23. | Shape : Input.index -> (int * int * int) t
  24. | Option : 'a t option -> 'a option t
Sourceval compute_at : ?x:int ref -> ?y:int ref -> pixel t -> Input.t -> int -> int -> pixel

Compute value of expression at the given point

Sourceval int : int -> int t

Create an int Expr

Sourceval float : float -> float t

Create a float Expr

Sourceval int_of_float : float t -> int t
Sourceval float_of_int : int t -> float t
Sourceval x : int t
Sourceval y : int t
Sourceval some : 'a t -> 'a option t
Sourceval none : 'a option t
Sourceval pixel : 'a Pixel.t -> pixel t
Sourceval pixel_map : (float -> float) -> pixel t -> pixel t
Sourceval image : ?input:Input.index -> unit -> image t
Sourceval get : pixel t -> int t -> float t

Get pixel index

Sourceval set : pixel t -> int t -> float t -> pixel t

Set pixel index

Sourceval set_rgb : pixel t -> float t -> float t -> float t -> pixel t

Update pixel with RGB values

Sourceval input : ?index:Input.index -> int t -> int t -> pixel t

Get input data from the specified index

Sourceval value : 'a -> 'a t

Create a Value expr

Sourceval shape : ?input:Input.index -> unit -> (int * int * int) t
Sourceval func : 'b t -> (int -> int -> 'b -> 'a t) -> 'a t

Create a Func expr

Sourceval kernel : ?input:Input.index -> Kernel.t -> pixel t

Create a kernel expr from an existing kernel

Sourceval combine_kernel : ?input:Input.index -> (float -> float -> float) -> Kernel.t t -> Kernel.t t -> pixel t

Create a kernel expession using two kernels combined using the designated operation

Sourceval kernel_3x3 : ?input:Input.index -> Kernel.t -> pixel t
Sourceval gaussian_blur : ?std:float -> ?input:Input.index -> int -> pixel t
Sourceval sobel_x : ?input:Input.index -> unit -> pixel t
Sourceval sobel_y : ?input:Input.index -> unit -> pixel t
Sourceval sobel : ?input:Input.index -> unit -> pixel t
Sourceval transform : ?input:Input.index -> Transform.t -> pixel t

Apply a transformation

Sourceval rotate : ?input:Input.index -> ?center:(float * float) -> float -> pixel t
Sourceval rotate_90 : ?input:Input.index -> unit -> pixel t
Sourceval rotate_180 : ?input:Input.index -> unit -> pixel t
Sourceval rotate_270 : ?input:Input.index -> unit -> pixel t
Sourceval scale : ?input:Input.index -> float -> float -> pixel t
Sourceval resize : ?input:Input.index -> int -> int -> pixel t
Sourceval pair : 'a t -> 'b t -> ('a * 'b) t

Create a new Pair expr, used for joining existing expressions

Sourceval channels : ?input:Input.index -> unit -> int t
Sourceval map : ('b -> 'a t) -> 'b t -> 'a t
Sourceval (let*) : 'b t -> ('b -> 'a t) -> 'a t
Sourceval (let+) : 'b t -> ('b -> 'a) -> 'a t
Sourceval map2 : ('a -> 'b -> 'c t) -> 'a t -> 'b t -> 'c t
Sourceval fadd : float t -> float t -> float t
Sourceval fsub : float t -> float t -> float t
Sourceval fmul : float t -> float t -> float t
Sourceval fdiv : float t -> float t -> float t
Sourceval iadd : int t -> int t -> int t
Sourceval isub : int t -> int t -> int t
Sourceval imul : int t -> int t -> int t
Sourceval idiv : int t -> int t -> int t
Sourceval pow : float t -> float t -> float t
Sourceval sqrt : float t -> float t
Sourceval sin : float t -> float t
Sourceval cos : float t -> float t
Sourceval tan : float t -> float t
Sourceval pi : unit -> float t
Sourceval and_ : bool t -> bool t -> bool t
Sourceval or_ : bool t -> bool t -> bool t
Sourceval not_ : bool t -> bool t
Sourceval cond : bool t -> 'a t -> 'a t -> 'a t
Sourceval blend : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel t

An expression to average two images

Sourceval min : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel t

An expression to take the lowest value from two images

Sourceval max : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel t

An expression to take the highest value from two images

Sourceval brightness : ?input:Input.index -> float t -> pixel t

Multiply each pixel component

Sourceval grayscale : ?input:Input.index -> unit -> pixel t
Sourceval color : ?input:Input.index -> unit -> pixel t
Sourceval invert : ?input:Input.index -> unit -> pixel t
Sourceval gamma : ?input:Input.index -> float -> pixel t
Sourceval gamma_log : ?input:Input.index -> ?gamma:float -> unit -> pixel t
Sourceval gamma_lin : ?input:Input.index -> ?gamma:float -> unit -> pixel t
Sourcemodule Infix : sig ... end
OCaml

Innovation. Community. Security.