package xcursor

  1. Overview
  2. Docs

Cursor file modules.

Contains functions used for cursor files which contain the images and metadata for cursors.

module Card32 : sig ... end
module Header : sig ... end
module Image : sig ... end
type t = {
  1. header : Header.t;
  2. data : Bigstringaf.t;
}

Cursor file with parsed header.

val of_bigstring : Bigstringaf.t -> (t, string) Stdlib.result

Get a cursor from parsing a bigstring.

val of_descr : ?pos:int -> ?size:int -> Unix.file_descr -> (t, string) Stdlib.result

Get a cursor from parsing a memory-mapped a Unix file descriptor.

The file descriptor must have at least read permissions.

val toc_len : t -> int

The number of entries in the table of contents.

val image_indices : ?size:int -> t -> (int Image.t, string) Stdlib.result Stdlib.Seq.t

Return a lazy sequence of image indices in the table of contents.

If size is specified, filter by the notional size (i.e. the subtype) of the index.

Cursor.Image.t.pixels is the offset from the start of t.data.

val images : ?size:int -> t -> (Bigstringaf.t Image.t, string) Stdlib.result Stdlib.Seq.t

Return a lazy sequence of images in the cursor.

See image_indices for more information.