Bimage.Pixel
Pixel
defines operations on individual pixels, which are stored as floatarray
val fill : 'a t -> float -> unit
val length : 'a t -> int
Get the number of channels in a pixel
val get : 'a t -> int -> float
Get value at index
val set : 'a t -> int -> float -> unit
Set value at index
val data : 'a t -> floatarray
Returns the underlying pixel data
val iter : ( int -> float -> unit ) -> 'a t -> unit
Iterate over pixel values
map f x
executes f
for each value in x
, returning a new Pixel.t
map_inplace f x
executes f
for each value in x
, assigning the new value to the same * index
Executes a function over each item in two pixels
map2 f x y
executes f
for each value in x
and y
, returning a new Pixel.t
val fold : ?ignore_alpha:bool -> ( float -> 'a -> 'a ) -> 'b t -> 'a -> 'a
Reduction over a pixel
val pp : Stdlib.Format.formatter -> 'a t -> unit
module Infix : sig ... end