package bimage

  1. Overview
  2. Docs

Module Bimage.DataSource

The Data module defines several operations on one dimensional image data

Sourcetype ('a, 'b) t = ('a, 'b, Bigarray.c_layout) Bigarray.Array1.t

Data type

Sourceval kind : ('a, 'b) t -> ('a, 'b) kind

Get the Bigarray.kind

Sourceval of_array : ('a, 'b) kind -> 'a array -> ('a, 'b) t

Converts an array to a Data.t of the given kind

Sourceval to_array : ('a, 'b) t -> 'a array

Converts a Data.t to an array

Sourceval create : ('a, 'b) kind -> int -> ('a, 'b) t

Create a new Data.t with the given length.

Sourceval length : ('a, 'b) t -> int

Returns the number of elements in a Data.t

Sourceval fold2 : ('a -> 'd -> 'c -> 'c) -> ('a, 'b) t -> ('d, 'e) t -> 'c -> 'c

Reduce over two Data.t

Sourceval fold : ('a -> 'c -> 'c) -> ('a, 'b) t -> 'c -> 'c

Reduce over a single Data.t

Sourceval fill : ('a, 'b) t -> 'a -> unit

fill d x sets each value of d to x

Sourceval map_inplace : ('a -> 'a) -> ('a, 'b) t -> unit

map_inplace f data runs f over each value of data

Sourceval map2_inplace : ('a -> 'c -> 'a) -> ('a, 'b) t -> ('c, 'd) t -> unit

map2_inplace f data1 data2 runs f over each value of data1 and data2

Sourceval slice : offs:int -> length:int -> ('a, 'b) t -> ('a, 'b) t

slice ~offs ~length data extracts a section of data of length values starting at index offs

Sourceval copy_to : dest:('a, 'b) t -> ('a, 'b) t -> unit

copy_to ~dest src copies each value from src to dest

Sourceval copy : ('a, 'b) t -> ('a, 'b) t

Create a new copy of Data.t

Sourceval convert : ('c, 'd) kind -> ('a -> 'c) -> ('a, 'b) t -> ('c, 'd) t

Convert between Data.t types

Sourceval convert_to : ('a -> 'c) -> dest:('c, 'd) t -> ('a, 'b) t -> unit

Convert between Data.t types with an existing destination image

Sourceval of_float : ?dest:('a, 'b) t -> ('a, 'b) kind -> (float, f32) t -> ('a, 'b) t

of_float ~dest k data converts a Data.t from float to k, storing the results in dest if provided.

Sourceval to_float : ?dest:(float, f32) t -> ('a, 'b) t -> (float, f32) t

to_float ~dest data converts a Data.t to float values, storing the results in dest if provided.

Sourceval hash : ('a, 'b) t -> int

Default hash function

Sourceval compare : ('a, 'b) t -> ('a, 'b) t -> int

Default comparison function

Sourceval equal : ('a, 'b) t -> ('a, 'b) t -> bool

Default equality function