package bimage
Library
Module
Module type
Parameter
Class
Class type
Op is used to define pixel-level operations. These operations are performed on normalized floating-point values
type ('a, 'b, 'c) t = ('a, 'b, 'c) Image.t array -> int -> int -> int -> float
type ('a, 'b, 'c) f =
float ->
('a, 'b, 'c) Image.t array ->
int ->
int ->
int ->
float
val blend : ('a, 'b, 'c) t
Blend two images: a + b / 2
val min : ('a, 'b, 'c) t
Minimum pixel value of two images
val max : ('a, 'b, 'c) t
Maximum pixel value of two images
val grayscale : ('a, 'b, [< `Rgb | `Rgba ]) t
Convert a color image to grayscale
val color : ('a, 'b, [ `Gray ]) t
Convert a grayscale image to color
val eval :
?x:int ref ->
?y:int ref ->
?c:int ref ->
('a, 'b, 'c) t ->
('a, 'b, 'c, 'd, 'e, 'f) filter
Evaluate an operation
join f a b
builds a new operation of f(a, b)
map f a
builds a new operation of f(a)
val scalar : ('a, 'b, 'c) f
Builds an operation returning a single value
Builds an operation returning the maximum value for a given kind
Builds an operation returning the minimum value for a given kind
val invert_f : ('a, 'b, 'c) f
Invert a single value
val invert : ('a, 'b, 'c) t
Invert the values in an image
val cond :
(('a, 'b, 'c) Image.t array -> int -> int -> int -> bool) ->
('a, 'b, 'c) t ->
('a, 'b, 'c) t ->
('a, 'b, 'c) t
Conditional operation
Create a kernel operation using two kernels combined using the designated operation
Infix operator for join
using subtraction
Infix operator for join
using multiplication
Infix operator for join_kernel
using multiplication
val sobel_x : ('a, 'b, 'c) t
Sobel in the X direction
val sobel_y : ('a, 'b, 'c) t
Sobel in the Y direction
val sobel : ('a, 'b, 'c) t
Sobel kernel
val gaussian_blur : ?std:float -> int -> ('a, 'b, 'c) t
Blur using gaussian kernel. The size must be an odd number.
val transform : Transform.t -> ('a, 'b, 'c) t
Apply a transformation
val scale : float -> float -> ('a, 'b, 'c) t
Scale an image by the given amount
val brightness : float -> ('a, 'b, 'c) t
Adjust the brightness of an image. 0.0 will remove all brightness and 1.0 will keep the image as-is.
val threshold : float array -> ('a, 'b, 'c) t
Per-channel threshold -- each entry in the given array is the threshold for the channel with the same index