package ocgtk
Install
dune-project
Dependency
Authors
Maintainers
Sources
sha256=4e50fdb5093136a10fc8ffbe388e44cbcb70d52f8afdd48863ec7e22580ff054
doc/ocgtk.gdkpixbuf/Ocgtk_gdkpixbuf/GdkPixbuf/Wrappers/Pixbuf/index.html
Module Wrappers.Pixbuf
type t = [ `pixbuf | `object_ ] Gobject.objval new_ : Gdkpixbuf_enums.colorspace -> bool -> int -> int -> int -> tCreate a new Pixbuf
val new_from_bytes :
Glib_bytes.t ->
Gdkpixbuf_enums.colorspace ->
bool ->
int ->
int ->
int ->
int ->
tCreate a new Pixbuf
Create a new Pixbuf
Create a new Pixbuf
val new_from_stream :
Ocgtk_gio.Gio.Wrappers.Input_stream.t ->
Ocgtk_gio.Gio.Wrappers.Cancellable.t option ->
(t, GError.t) resultCreate a new Pixbuf
val new_from_stream_at_scale :
Ocgtk_gio.Gio.Wrappers.Input_stream.t ->
int ->
int ->
bool ->
Ocgtk_gio.Gio.Wrappers.Cancellable.t option ->
(t, GError.t) resultCreate a new Pixbuf
val new_from_stream_finish :
Ocgtk_gio.Gio.Wrappers.Async_result.t ->
(t, GError.t) resultCreate a new Pixbuf
val new_from_xpm_data : string array -> tCreate a new Pixbuf
val set_option : t -> string -> string -> boolAttaches a key/value pair as an option to a `GdkPixbuf`.
If `key` already exists in the list of options attached to the `pixbuf`, the new value is ignored and `FALSE` is returned.
val scale_simple : t -> int -> int -> Gdkpixbuf_enums.interptype -> t optionCreate a new pixbuf containing a copy of `src` scaled to `dest_width` x `dest_height`.
This function leaves `src` unaffected.
The `interp_type` should be `GDK_INTERP_NEAREST` if you want maximum speed (but when scaling down `GDK_INTERP_NEAREST` is usually unusably ugly). The default `interp_type` should be `GDK_INTERP_BILINEAR` which offers reasonable quality and speed.
You can scale a sub-portion of `src` by creating a sub-pixbuf pointing into `src`; see method@GdkPixbuf.Pixbuf.new_subpixbuf.
If `dest_width` and `dest_height` are equal to the width and height of `src`, this function will return an unscaled copy of `src`.
For more complicated scaling/alpha blending see method@GdkPixbuf.Pixbuf.scale and method@GdkPixbuf.Pixbuf.composite.
val scale :
t ->
t ->
int ->
int ->
int ->
int ->
float ->
float ->
float ->
float ->
Gdkpixbuf_enums.interptype ->
unitCreates a transformation of the source image @src by scaling by @scale_x and @scale_y then translating by @offset_x and @offset_y, then renders the rectangle (@dest_x, @dest_y, @dest_width, @dest_height) of the resulting image onto the destination image replacing the previous contents.
Try to use gdk_pixbuf_scale_simple() first; this function is the industrial-strength power tool you can fall back to, if gdk_pixbuf_scale_simple() isn't powerful enough.
If the source rectangle overlaps the destination rectangle on the same pixbuf, it will be overwritten during the scaling which results in rendering artifacts.
val savev :
t ->
string ->
string ->
string array option ->
string array option ->
(bool, GError.t) resultVector version of `gdk_pixbuf_save()`.
Saves pixbuf to a file in `type`, which is currently "jpeg", "png", "tiff", "ico" or "bmp".
If @error is set, `FALSE` will be returned.
See method@GdkPixbuf.Pixbuf.save for more details.
val save_to_streamv :
t ->
Ocgtk_gio.Gio.Wrappers.Output_stream.t ->
string ->
string array option ->
string array option ->
Ocgtk_gio.Gio.Wrappers.Cancellable.t option ->
(bool, GError.t) resultSaves `pixbuf` to an output stream.
Supported file formats are currently "jpeg", "tiff", "png", "ico" or "bmp".
See method@GdkPixbuf.Pixbuf.save_to_stream for more details.
Modifies saturation and optionally pixelates `src`, placing the result in `dest`.
The `src` and `dest` pixbufs must have the same image format, size, and rowstride.
The `src` and `dest` arguments may be the same pixbuf with no ill effects.
If `saturation` is 1.0 then saturation is not changed. If it's less than 1.0, saturation is reduced (the image turns toward grayscale); if greater than 1.0, saturation is increased (the image gets more vivid colors).
If `pixelate` is `TRUE`, then pixels are faded in a checkerboard pattern to create a pixelated image.
val rotate_simple : t -> Gdkpixbuf_enums.pixbufrotation -> t optionRotates a pixbuf by a multiple of 90 degrees, and returns the result in a new pixbuf.
If `angle` is 0, this function will return a copy of `src`.
val remove_option : t -> string -> boolRemoves the key/value pair option attached to a `GdkPixbuf`.
val read_pixel_bytes : t -> Glib_bytes.tProvides a #GBytes buffer containing the raw pixel data; the data must not be modified.
This function allows skipping the implicit copy that must be made if gdk_pixbuf_get_pixels() is called on a read-only pixbuf.
Creates a new pixbuf which represents a sub-region of `src_pixbuf`.
The new pixbuf shares its pixels with the original pixbuf, so writing to one affects both. The new pixbuf holds a reference to `src_pixbuf`, so `src_pixbuf` will not be finalized until the new pixbuf is finalized.
Note that if `src_pixbuf` is read-only, this function will force it to be mutable.
val get_width : t -> intQueries the width of a pixbuf.
val get_rowstride : t -> intQueries the rowstride of a pixbuf, which is the number of bytes between the start of a row and the start of the next row.
val get_option : t -> string -> string optionLooks up @key in the list of options that may have been attached to the @pixbuf when it was loaded, or that may have been attached by another function using gdk_pixbuf_set_option().
For instance, the ANI loader provides "Title" and "Artist" options. The ICO, XBM, and XPM loaders provide "x_hot" and "y_hot" hot-spot options for cursor definitions. The PNG loader provides the tEXt ancillary chunk key/value pairs as options. Since 2.12, the TIFF and JPEG loaders return an "orientation" option string that corresponds to the embedded TIFF/Exif orientation tag (if present). Since 2.32, the TIFF loader sets the "multipage" option string to "yes" when a multi-page TIFF is loaded. Since 2.32 the JPEG and PNG loaders set "x-dpi" and "y-dpi" if the file contains image density information in dots per inch. Since 2.36.6, the JPEG loader sets the "comment" option with the comment EXIF tag.
val get_n_channels : t -> intQueries the number of channels of a pixbuf.
val get_height : t -> intQueries the height of a pixbuf.
val get_has_alpha : t -> boolQueries whether a pixbuf has an alpha channel (opacity information).
val get_colorspace : t -> Gdkpixbuf_enums.colorspaceQueries the color space of a pixbuf.
val get_bits_per_sample : t -> intQueries the number of bits per color sample in a pixbuf.
Flips a pixbuf horizontally or vertically and returns the result in a new pixbuf.
Clears a pixbuf to the given RGBA value, converting the RGBA value into the pixbuf's pixel format.
The alpha component will be ignored if the pixbuf doesn't have an alpha channel.
Copies the key/value pair options attached to a `GdkPixbuf` to another `GdkPixbuf`.
This is useful to keep original metadata after having manipulated a file. However be careful to remove metadata which you've already applied, such as the "orientation" option after rotating the image.
Copies a rectangular area from `src_pixbuf` to `dest_pixbuf`.
Conversion of pixbuf formats is done automatically.
If the source rectangle overlaps the destination rectangle on the same pixbuf, it will be overwritten during the copy operation. Therefore, you can not use this function to scroll a pixbuf.
Creates a new `GdkPixbuf` with a copy of the information in the specified `pixbuf`.
Note that this does not copy the options set on the original `GdkPixbuf`, use gdk_pixbuf_copy_options() for this.
val composite_color_simple :
t ->
int ->
int ->
Gdkpixbuf_enums.interptype ->
int ->
int ->
UInt32.t ->
UInt32.t ->
t optionCreates a new pixbuf by scaling `src` to `dest_width` x `dest_height` and alpha blending the result with a checkboard of colors `color1` and `color2`.
val composite_color :
t ->
t ->
int ->
int ->
int ->
int ->
float ->
float ->
float ->
float ->
Gdkpixbuf_enums.interptype ->
int ->
int ->
int ->
int ->
UInt32.t ->
UInt32.t ->
unitCreates a transformation of the source image @src by scaling by @scale_x and @scale_y then translating by @offset_x and @offset_y, then alpha blends the rectangle (@dest_x ,@dest_y, @dest_width, @dest_height) of the resulting image with a checkboard of the colors @color1 and @color2 and renders it onto the destination image.
If the source image has no alpha channel, and @overall_alpha is 255, a fast path is used which omits the alpha blending and just performs the scaling.
See gdk_pixbuf_composite_color_simple() for a simpler variant of this function suitable for many tasks.
val composite :
t ->
t ->
int ->
int ->
int ->
int ->
float ->
float ->
float ->
float ->
Gdkpixbuf_enums.interptype ->
int ->
unitCreates a transformation of the source image @src by scaling by @scale_x and @scale_y then translating by @offset_x and @offset_y.
This gives an image in the coordinates of the destination pixbuf. The rectangle (@dest_x, @dest_y, @dest_width, @dest_height) is then alpha blended onto the corresponding rectangle of the original destination image.
When the destination rectangle contains parts not in the source image, the data at the edges of the source image is replicated to infinity.
!(composite.png)
Takes an existing pixbuf and checks for the presence of an associated "orientation" option.
The orientation option may be provided by the JPEG loader (which reads the exif orientation tag) or the TIFF loader (which reads the TIFF orientation tag, and compensates it for the partial transforms performed by libtiff).
If an orientation option/tag is present, the appropriate transform will be performed so that the pixbuf is oriented correctly.
val get_pixel_bytes : t -> Glib_bytes.tGet property: pixel-bytes