Bimage.ExprExpr define a combinator which can be used to build filters
type image = Image.anytype 'a t = | Kernel : Input.index * Kernel.t -> pixel t |
| Transform : Input.index * Transform.t -> pixel t |
| Image : Input.index -> image t |
| Input : Input.index * int t * int t -> pixel t |
| X : int t |
| Y : int t |
| Int : int -> int t |
| Float : float -> float t |
| Bool : bool -> bool t |
| Gt : 'a t * 'a t -> bool t |
| Eq : 'a t * 'a t -> bool t |
| Lt : 'a t * 'a t -> bool t |
| And : bool t * bool t -> bool t |
| Or : bool t * bool t -> bool t |
| Not : bool t -> bool t |
| Cond : bool t * 'a t * 'a t -> 'a t |
| Func : 'b t * ( int -> int -> 'b -> 'a t ) -> 'a t |
| Pixel : 'b Pixel.t -> pixel t |
| Pixel_get : pixel t * int t -> float t |
| Pixel_set : pixel t * int t * float t -> pixel t |
| Value : 'a -> 'a t |
| Pair : 'a t * 'b t -> ('a * 'b) t |
| Shape : Input.index -> (int * int * int) t |
| Option : 'a t option -> 'a option t |
val compute_at :
?x:int Stdlib.ref ->
?y:int Stdlib.ref ->
pixel t ->
Input.t ->
int ->
int ->
pixelCompute value of expression at the given point
val int : int -> int tCreate an int Expr
val float : float -> float tCreate a float Expr
val x : int tval y : int tval none : 'a option tval image : ?input:Input.index -> unit -> image tval input : ?index:Input.index -> int t -> int t -> pixel tGet input data from the specified index
val value : 'a -> 'a tCreate a Value expr
val shape : ?input:Input.index -> unit -> (int * int * int) tval kernel : ?input:Input.index -> Kernel.t -> pixel tCreate a kernel expr from an existing kernel
val combine_kernel :
?input:Input.index ->
( float -> float -> float ) ->
Kernel.t t ->
Kernel.t t ->
pixel tCreate a kernel expession using two kernels combined using the designated operation
val kernel_3x3 : ?input:Input.index -> Kernel.t -> pixel tval gaussian_blur : ?std:float -> ?input:Input.index -> int -> pixel tval sobel_x : ?input:Input.index -> unit -> pixel tval sobel_y : ?input:Input.index -> unit -> pixel tval sobel : ?input:Input.index -> unit -> pixel tval transform : ?input:Input.index -> Transform.t -> pixel tApply a transformation
val rotate : ?input:Input.index -> ?center:(float * float) -> float -> pixel tval rotate_90 : ?input:Input.index -> unit -> pixel tval rotate_180 : ?input:Input.index -> unit -> pixel tval rotate_270 : ?input:Input.index -> unit -> pixel tval scale : ?input:Input.index -> float -> float -> pixel tval resize : ?input:Input.index -> int -> int -> pixel tval channels : ?input:Input.index -> unit -> int tval pi : unit -> float tval blend : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel tAn expression to average two images
val min : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel tAn expression to take the lowest value from two images
val max : ?input0:Input.index -> ?input1:Input.index -> unit -> pixel tAn expression to take the highest value from two images
val brightness : ?input:Input.index -> float t -> pixel tMultiply each pixel component
val grayscale : ?input:Input.index -> unit -> pixel tval color : ?input:Input.index -> unit -> pixel tval invert : ?input:Input.index -> unit -> pixel tval gamma : ?input:Input.index -> float -> pixel tval gamma_log : ?input:Input.index -> ?gamma:float -> unit -> pixel tval gamma_lin : ?input:Input.index -> ?gamma:float -> unit -> pixel tmodule Infix : sig ... end