Commit 814a5514 authored by Mike Wey's avatar Mike Wey

Update GdkPixbuf to 2.38.

parent df89b7a1
......@@ -102,7 +102,7 @@ GObject | 2.60
Gio | 2.60
Pango | 1.42
Atk | 2.32
Gdk-pixbuf | 2.36
Gdk-pixbuf | 2.38
Cairo | 1.12.2
GtksourceView | 3.24
GStreamer | 1.14
......
......@@ -703,41 +703,6 @@ public class Pixbuf : ObjectG, IconIF, LoadableIconIF
return gdk_pixbuf_calculate_rowstride(colorspace, hasAlpha, bitsPerSample, width, height);
}
/**
* Converts a #GdkPixdata to a #GdkPixbuf. If @copy_pixels is %TRUE or
* if the pixel data is run-length-encoded, the pixel data is copied into
* newly-allocated memory; otherwise it is reused.
*
* Deprecated: Use #GResource instead.
*
* Params:
* pixdata = a #GdkPixdata to convert into a #GdkPixbuf.
* copyPixels = whether to copy raw pixel data; run-length encoded
* pixel data is always copied.
*
* Returns: a new #GdkPixbuf.
*
* Throws: GException on failure.
*/
public static Pixbuf fromPixdata(Pixdata pixdata, bool copyPixels)
{
GError* err = null;
auto p = gdk_pixbuf_from_pixdata((pixdata is null) ? null : pixdata.getPixdataStruct(), copyPixels, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true);
}
/**
* Parses an image file far enough to determine its format and size.
*
......@@ -1366,6 +1331,11 @@ public class Pixbuf : ObjectG, IconIF, LoadableIconIF
}
/**
* Provides 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.
*
* Returns: A new reference to a read-only copy of
* the pixel data. Note that for mutable pixbufs, this function will
* incur a one-time copy of the pixel data for conversion into the
......@@ -1386,11 +1356,13 @@ public class Pixbuf : ObjectG, IconIF, LoadableIconIF
}
/**
* Returns a read-only pointer to the raw pixel data; must not be
* Provides a read-only pointer to the raw pixel 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.
*
* Returns: a read-only pointer to the raw pixel data
*
* Since: 2.32
*/
public ubyte* readPixels()
......@@ -1666,4 +1638,39 @@ public class Pixbuf : ObjectG, IconIF, LoadableIconIF
{
return gdk_pixbuf_set_option(gdkPixbuf, Str.toStringz(key), Str.toStringz(value)) != 0;
}
/**
* Converts a #GdkPixdata to a #GdkPixbuf. If @copy_pixels is %TRUE or
* if the pixel data is run-length-encoded, the pixel data is copied into
* newly-allocated memory; otherwise it is reused.
*
* Deprecated: Use #GResource instead.
*
* Params:
* pixdata = a #GdkPixdata to convert into a #GdkPixbuf.
* copyPixels = whether to copy raw pixel data; run-length encoded
* pixel data is always copied.
*
* Returns: a new #GdkPixbuf.
*
* Throws: GException on failure.
*/
public static Pixbuf fromPixdata(Pixdata pixdata, bool copyPixels)
{
GError* err = null;
auto p = gdk_pixbuf_from_pixdata((pixdata is null) ? null : pixdata.getPixdataStruct(), copyPixels, &err);
if (err !is null)
{
throw new GException( new ErrorG(err) );
}
if(p is null)
{
return null;
}
return ObjectG.getDObject!(Pixbuf)(cast(GdkPixbuf*) p, true);
}
}
......@@ -54,7 +54,6 @@ shared static this()
Linker.link(gdk_pixbuf_new_from_stream_finish, "gdk_pixbuf_new_from_stream_finish", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_new_from_xpm_data, "gdk_pixbuf_new_from_xpm_data", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_calculate_rowstride, "gdk_pixbuf_calculate_rowstride", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_from_pixdata, "gdk_pixbuf_from_pixdata", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_get_file_info, "gdk_pixbuf_get_file_info", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_get_file_info_async, "gdk_pixbuf_get_file_info_async", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_get_file_info_finish, "gdk_pixbuf_get_file_info_finish", LIBRARY_GDKPIXBUF);
......@@ -105,6 +104,7 @@ shared static this()
Linker.link(gdk_pixbuf_scale_simple, "gdk_pixbuf_scale_simple", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_set_option, "gdk_pixbuf_set_option", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_unref, "gdk_pixbuf_unref", LIBRARY_GDKPIXBUF);
Linker.link(gdk_pixbuf_from_pixdata, "gdk_pixbuf_from_pixdata", LIBRARY_GDKPIXBUF);
// gdkpixbuf.PixbufAnimation
......@@ -200,7 +200,6 @@ __gshared extern(C)
GdkPixbuf* function(GAsyncResult* asyncResult, GError** err) c_gdk_pixbuf_new_from_stream_finish;
GdkPixbuf* function(char** data) c_gdk_pixbuf_new_from_xpm_data;
int function(GdkColorspace colorspace, int hasAlpha, int bitsPerSample, int width, int height) c_gdk_pixbuf_calculate_rowstride;
GdkPixbuf* function(GdkPixdata* pixdata, int copyPixels, GError** err) c_gdk_pixbuf_from_pixdata;
GdkPixbufFormat* function(char* filename, int* width, int* height) c_gdk_pixbuf_get_file_info;
void function(char* filename, GCancellable* cancellable, GAsyncReadyCallback callback, void* userData) c_gdk_pixbuf_get_file_info_async;
GdkPixbufFormat* function(GAsyncResult* asyncResult, int* width, int* height, GError** err) c_gdk_pixbuf_get_file_info_finish;
......@@ -251,6 +250,7 @@ __gshared extern(C)
GdkPixbuf* function(GdkPixbuf* src, int destWidth, int destHeight, GdkInterpType interpType) c_gdk_pixbuf_scale_simple;
int function(GdkPixbuf* pixbuf, const(char)* key, const(char)* value) c_gdk_pixbuf_set_option;
void function(GdkPixbuf* pixbuf) c_gdk_pixbuf_unref;
GdkPixbuf* function(GdkPixdata* pixdata, int copyPixels, GError** err) c_gdk_pixbuf_from_pixdata;
// gdkpixbuf.PixbufAnimation
......@@ -344,7 +344,6 @@ alias c_gdk_pixbuf_new_from_stream_at_scale gdk_pixbuf_new_from_stream_at_scale;
alias c_gdk_pixbuf_new_from_stream_finish gdk_pixbuf_new_from_stream_finish;
alias c_gdk_pixbuf_new_from_xpm_data gdk_pixbuf_new_from_xpm_data;
alias c_gdk_pixbuf_calculate_rowstride gdk_pixbuf_calculate_rowstride;
alias c_gdk_pixbuf_from_pixdata gdk_pixbuf_from_pixdata;
alias c_gdk_pixbuf_get_file_info gdk_pixbuf_get_file_info;
alias c_gdk_pixbuf_get_file_info_async gdk_pixbuf_get_file_info_async;
alias c_gdk_pixbuf_get_file_info_finish gdk_pixbuf_get_file_info_finish;
......@@ -395,6 +394,7 @@ alias c_gdk_pixbuf_scale gdk_pixbuf_scale;
alias c_gdk_pixbuf_scale_simple gdk_pixbuf_scale_simple;
alias c_gdk_pixbuf_set_option gdk_pixbuf_set_option;
alias c_gdk_pixbuf_unref gdk_pixbuf_unref;
alias c_gdk_pixbuf_from_pixdata gdk_pixbuf_from_pixdata;
// gdkpixbuf.PixbufAnimation
......
......@@ -49,10 +49,8 @@ alias GdkColorspace Colorspace;
* scaling down. @GDK_INTERP_BILINEAR is the best choice if you
* aren't sure what to choose, it has a good speed/quality balance.
*
* <note>
* Cubic filtering is missing from the list; hyperbolic
* **Note**: Cubic filtering is missing from the list; hyperbolic
* interpolation is just as fast and results in higher quality.
* </note>
*/
public enum GdkInterpType
{
......@@ -84,6 +82,9 @@ public enum GdkInterpType
* Wolberg's "Digital Image Warping", and is formally defined as the
* hyperbolic-filter sampling the ideal hyperbolic-filter interpolated
* image (the filter is designed to be idempotent for 1:1 pixel mapping).
* **Deprecated**: this interpolation filter is deprecated, as in reality
* it has a lower quality than the @GDK_INTERP_BILINEAR filter
* (Since: 2.38)
*/
HYPER = 3,
}
......@@ -389,12 +390,6 @@ public alias extern(C) int function(char* buf, size_t count, GError** error, voi
enum PIXBUF_FEATURES_H = 1;
alias GDK_PIXBUF_FEATURES_H = PIXBUF_FEATURES_H;
/**
* Magic number for #GdkPixdata structures.
*/
enum PIXBUF_MAGIC_NUMBER = 1197763408;
alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;
/**
* Major version of gdk-pixbuf library, that is the "0" in
* "0.8.2" for example.
......@@ -406,14 +401,14 @@ alias GDK_PIXBUF_MAJOR = PIXBUF_MAJOR;
* Micro version of gdk-pixbuf library, that is the "2" in
* "0.8.2" for example.
*/
enum PIXBUF_MICRO = 12;
enum PIXBUF_MICRO = 1;
alias GDK_PIXBUF_MICRO = PIXBUF_MICRO;
/**
* Minor version of gdk-pixbuf library, that is the "8" in
* "0.8.2" for example.
*/
enum PIXBUF_MINOR = 36;
enum PIXBUF_MINOR = 38;
alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;
/**
......@@ -421,9 +416,15 @@ alias GDK_PIXBUF_MINOR = PIXBUF_MINOR;
* This is the version being compiled against; contrast with
* #gdk_pixbuf_version.
*/
enum PIXBUF_VERSION = "2.36.12";
enum PIXBUF_VERSION = "2.38.1";
alias GDK_PIXBUF_VERSION = PIXBUF_VERSION;
/**
* Magic number for #GdkPixdata structures.
*/
enum PIXBUF_MAGIC_NUMBER = 1197763408;
alias GDK_PIXBUF_MAGIC_NUMBER = PIXBUF_MAGIC_NUMBER;
/**
* The length of a #GdkPixdata structure without the @pixel_data pointer.
*/
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment