Bitmap: Difference between revisions

623 bytes added ,  1 year ago
Line 445:
vtypedef pixmap (a : t@ype, w : int, h : int) =
[p : addr] pixmap (a, w, h, p)
 
(* A shorthand for a pixmap with "some" width and height, and with its
pixel storage at "some" address. *)
vtypedef pixmap (a : t@ype) = [w, h : int] pixmap (a, w, h)
 
(* A shorthand for a pixmap with "some" POSITIVE width and POSITIVE
height, and with its pixel storage at "some" address. *)
vtypedef pixmap1 (a : t@ype) = [w, h : pos] pixmap (a, w, h)
 
(*------------------------------------------------------------------*)
Line 580 ⟶ 588:
(FILEref, &array (a?, n) >> array (a, n), size_t n, a) ->
bool (* success *)
 
fn {}
pixmap_width :
{a : t@ype}
{w, h : int}
(!pixmap (rgb24a, w, h, p)) -<> size_t w
 
fn {}
pixmap_height :
{a : t@ype}
{w, h : int}
(!pixmap (a, w, h)) -<> size_t h
 
overload pixmap_make with pixmap_make_array
Line 601 ⟶ 621:
overload dump with pixmap_dump
overload load with pixmap_load
 
overload width with pixmap_width
overload height with pixmap_height
 
(*------------------------------------------------------------------*)
Line 612 ⟶ 635:
 
(* Thus an RGB pixmap type can be written as
pixmap (rgb24, w, h, p) *)
 
pixmap (rgb24, w, h, p)
 
*)
 
(*------------------------------------------------------------------*)
1,448

edits