Module Gdal.Band.Block

Block IO

These functions should generally be faster than the more generic read and write functions.

exception Wrong_dimensions
type offset_t = {
block : int * int;
offset : int * int;
}
val make_block_offset : block:(int * int) ‑> offset:(int * int) ‑> offset_t
val pixel_of_block_offset : (__t ‑> offset_t ‑> int * int

pixel_of_block_offset t returns a function which may be used to convert offsets within a block to pixel offsets within the band t.

val block_of_pixel_offset : (__t ‑> int ‑> int ‑> offset_t

block_of_pixel_offset t returns a function which returns the block_offset_t matching the pixel offset provided.

val get_block_count : (__t ‑> int * int

get_block_count t returns (nx, ny) giving the number of blocks in the band's x direction (nx) and the number of blocks in the band's y direction (ny).

val get_size : (__t ‑> int * int

get_size t returns the native (x, y) dimensions of the individual blocks making up t.

val read : ?⁠data:('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> ('v'et ‑> column:int ‑> row:int ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t

read ?data t ~column ~row returns the block at given offset in t.

val write : ('v'et ‑> column:int ‑> row:int ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> unit

write t ~column ~row data writes data to the block at the given offset in t.

val iter : ('v'et ‑> read:bool ‑> write:bool ‑> (int ‑> int ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> unit) ‑> unit

iter t ~read ~write f applies f to each block in t. The read and write arguments determine if values are from t, written to t or both.

val iter_read : ('v'et ‑> (int ‑> int ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> unit) ‑> unit

iter_read t f applies f to each block in t.

val iter_write : ('v'et ‑> (int ‑> int ‑> ('v'e, Bigarray.c_layout) Bigarray.Array2.t ‑> unit) ‑> unit

iter_write t f applies f to each block in t.