package bimage

  1. Overview
  2. Docs

Expr implements an operation combinator which can be used to build operations from low-level functions

type _ t =
  1. | Kernel : Input.index * Kernel.t -> float t
  2. | Input : Input.index * int t * int t * int t -> float t
  3. | X : int t
  4. | Y : int t
  5. | C : int t
  6. | Int : int -> int t
  7. | Float : float -> float t
  8. | Bool : bool -> bool t
  9. | Float_of_int : int t -> float t
  10. | Int_of_float : float t -> int t
  11. | Fadd : float t * float t -> float t
  12. | Fsub : float t * float t -> float t
  13. | Fmul : float t * float t -> float t
  14. | Fdiv : float t * float t -> float t
  15. | Fpow : float t * float t -> float t
  16. | Fsqrt : float t -> float t
  17. | Fsin : float t -> float t
  18. | Fcos : float t -> float t
  19. | Ftan : float t -> float t
  20. | Fmod : float t * float t -> float t
  21. | Iadd : int t * int t -> int t
  22. | Isub : int t * int t -> int t
  23. | Imul : int t * int t -> int t
  24. | Idiv : int t * int t -> int t
  25. | Imod : int t * int t -> int t
  26. | Gt : 'a t * 'a t -> bool t
  27. | Eq : 'a t * 'a t -> bool t
  28. | Lt : 'a t * 'a t -> bool t
  29. | And : bool t * bool t -> bool t
  30. | Or : bool t * bool t -> bool t
  31. | Not : bool t -> bool t
  32. | Cond : bool t * 'a t * 'a t -> 'a t
  33. | Func : 'b t * (int -> int -> int -> 'b -> 'a t) -> 'a t
  34. | Pixel : Input.index * int t * int t -> Pixel.t t
  35. | Pixel_norm : Input.index * int t * int t -> Pixel.t t
  36. | Value : 'a -> 'a t
  37. | Pair : 'a t * 'b t -> ('a * 'b) t
  38. | Kind_min : Input.index -> float t
  39. | Kind_max : Input.index -> float t
  40. | Channels : Input.index -> int t
  41. | Shape : Input.index -> (int * int * int) t
val op : ?x:int ref -> ?y:int ref -> ?c:int ref -> float t -> ('a, 'b, 'c) Image.t array -> int -> int -> int -> float
val int : int -> int t

Create an int Expr

val float : float -> float t

Create a float Expr

val int_of_float : float t -> int t
val float_of_int : int t -> float t
val x : int t
val y : int t
val c : int t
val kernel : Input.index -> Kernel.t -> float t

Create a kernel expr from an existing kernel

val join_kernel : Input.index -> (float t -> float t -> float t) -> Kernel.t -> Kernel.t -> float t

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

val combine_kernel : Input.index -> Kernel.t -> Kernel.t -> float t
val transform : Input.index -> Transform.t -> float t

Apply a transformation

val rotate : Input.index -> ?center:(float * float) -> float -> float t
val scale : Input.index -> float -> float -> float t
val threshold : Input.index -> float array -> float t
val pair : 'a t -> 'b t -> ('a * 'b) t

Create a new Pair expr, used for joining existing expressions

val pixel : Input.index -> int t -> int t -> Pixel.t t

Create a Pixel expr, for extracting pixels

val pixel_norm : Input.index -> int t -> int t -> Pixel.t t

Create a Pixel_norm expr, for extracting normalized pixels

val kind_min : Input.index -> float t
val kind_max : Input.index -> float t
val channels : Input.index -> int t
val value : 'a -> 'a t

Create a Value expr

val shape : Input.index -> (int * int * int) t
val func : 'b t -> (int -> int -> int -> 'b -> 'a t) -> 'a t

Create a Func expr

val map : ('b -> 'a t) -> 'b t -> 'a t
val input : int -> int t -> int t -> int t -> float t

Get input data from the specified index

val fadd : float t -> float t -> float t
val fsub : float t -> float t -> float t
val fmul : float t -> float t -> float t
val fdiv : float t -> float t -> float t
val iadd : int t -> int t -> int t
val isub : int t -> int t -> int t
val imul : int t -> int t -> int t
val idiv : int t -> int t -> int t
val pow : float t -> float t -> float t
val sqrt : float t -> float t
val sin : float t -> float t
val cos : float t -> float t
val tan : float t -> float t
val pi : unit -> float t
val and_ : bool t -> bool t -> bool t
val or_ : bool t -> bool t -> bool t
val not_ : bool t -> bool t
val cond : bool t -> 'a t -> 'a t -> 'a t
val blend : Input.index -> Input.index -> float t

An expression to average two images

val min : Input.index -> Input.index -> float t

An expression to take the lowest value from two images

val max : Input.index -> Input.index -> float t

An expression to take the highest value from two images

val brightness : Input.index -> float t -> float t

Multiply each pixel component

val grayscale : Input.index -> float t
val color : Input.index -> float t
val kernel_3x3 : Input.index -> Kernel.t -> float t
module Infix : sig ... end
OCaml

Innovation. Community. Security.