sectionYPositions = computeSectionYPositions($el), 10)"
x-init="setTimeout(() => sectionYPositions = computeSectionYPositions($el), 10)"
>
On This Page
These functions should generally be faster than the more generic read
and write
functions.
val make_block_offset : block:(int * int) -> offset:(int * int) -> offset_t
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
.
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, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array2.t ->
('v, 'e) t ->
column:int ->
row:int ->
('v, 'e, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array2.t
read ?data t ~column ~row
returns the block at given offset in t
.
val write :
('v, 'e) t ->
column:int ->
row:int ->
('v, 'e, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array2.t ->
unit
write t ~column ~row data
writes data
to the block at the given offset in t
.
val iter :
('v, 'e) t ->
read:bool ->
write:bool ->
(int ->
int ->
('v, 'e, Stdlib.Bigarray.c_layout) Stdlib.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, 'e) t ->
(int ->
int ->
('v, 'e, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array2.t ->
unit) ->
unit
iter_read t f
applies f
to each block in t
.
val iter_write :
('v, 'e) t ->
(int ->
int ->
('v, 'e, Stdlib.Bigarray.c_layout) Stdlib.Bigarray.Array2.t ->
unit) ->
unit
iter_write t f
applies f
to each block in t
.