lablgtk3

OCaml interface to GTK+3
IN THIS PACKAGE
Module GdkPixbuf

The GdkPixbuf Structure

type pixbuf = [ `pixbuf ] Gobject.obj

@gtkdoc gdk-pixbuf gdk-pixbuf-gdk-pixbuf

type colorspace = [
| `RGB
]
type alpha_mode = [
| `BILEVEL
| `FULL
]
type interpolation = [
| `BILINEAR
| `HYPER
| `NEAREST
| `TILES
]
type gdkpixbuferror =
| ERROR_CORRUPT_IMAGE
| ERROR_INSUFFICIENT_MEMORY
| ERROR_BAD_OPTION
| ERROR_UNKNOWN_TYPE
| ERROR_UNSUPPORTED_OPERATION
| ERROR_FAILED
exception GdkPixbufError of gdkpixbuferror * string
val set_marshal_use_rle : bool -> unit

Creation

val create : width:int -> height:int -> ?bits:int -> ?colorspace:colorspace -> ?has_alpha:bool -> unit -> pixbuf

@gtkdoc gdk-pixbuf gdk-pixbuf-creating

val cast : 'a Gobject.obj -> pixbuf
val copy : pixbuf -> pixbuf
val subpixbuf : pixbuf -> src_x:int -> src_y:int -> width:int -> height:int -> pixbuf
val from_file : string -> pixbuf

@gtkdoc gdk-pixbuf gdk-pixbuf-file-loading

val get_file_info : string -> string * int * int
  • since GTK 2.4
val from_file_at_size : string -> width:int -> height:int -> pixbuf
  • since GTK 2.4

@gtkdoc gdk-pixbuf gdk-pixbuf-file-loading

val from_xpm_data : string array -> pixbuf
val from_data : width:int -> height:int -> ?bits:int -> ?rowstride:int -> ?has_alpha:bool -> Gpointer.region -> pixbuf

Accessors

val get_n_channels : pixbuf -> int
val get_has_alpha : pixbuf -> bool
val get_bits_per_sample : pixbuf -> int
val get_width : pixbuf -> int
val get_height : pixbuf -> int
val get_rowstride : pixbuf -> int
val get_pixels : pixbuf -> Gpointer.region

Transform

val add_alpha : ?transparent:(int * int * int) -> pixbuf -> pixbuf

@gtkdoc gdk-pixbuf gdk-pixbuf-util

val fill : pixbuf -> int32 -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-util

val saturate_and_pixelate : dest:pixbuf -> saturation:float -> pixelate:bool -> pixbuf -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-util

val copy_area : dest:pixbuf -> ?dest_x:int -> ?dest_y:int -> ?width:int -> ?height:int -> ?src_x:int -> ?src_y:int -> pixbuf -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-util

val scale : dest:pixbuf -> ?dest_x:int -> ?dest_y:int -> ?width:int -> ?height:int -> ?ofs_x:float -> ?ofs_y:float -> ?scale_x:float -> ?scale_y:float -> ?interp:interpolation -> pixbuf -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-scaling

val composite : dest:pixbuf -> alpha:int -> ?dest_x:int -> ?dest_y:int -> ?width:int -> ?height:int -> ?ofs_x:float -> ?ofs_y:float -> ?scale_x:float -> ?scale_y:float -> ?interp:interpolation -> pixbuf -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-scaling

Saving

val save : filename:string -> typ:string -> ?options:(string * string) list -> pixbuf -> unit

@gtkdoc gdk-pixbuf gdk-pixbuf-file-saving

val save_to_callback : pixbuf -> typ:string -> ?options:(string * string) list -> ( string -> unit ) -> unit
  • since GTK 2.4
val save_to_buffer : pixbuf -> typ:string -> ?options:(string * string) list -> Buffer.t -> unit
  • since GTK 2.4