-
-
Notifications
You must be signed in to change notification settings - Fork 623
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Split cairo_draw_image into two functions
In some cases you are already working with a cairo_t and know your destination image size, this adds an API that allows you to handle these cases more easily. Along with now being able to draw images with an alpha level. It also leaves the original API unchanged.
- Loading branch information
1 parent
2ade1e2
commit 96337be
Showing
2 changed files
with
73 additions
and
33 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,11 @@ | ||
$#include <cairo.h> | ||
$#include <libcairo_imlib2_helper.h> | ||
|
||
void cairo_draw_image(const char *, cairo_surface_t *, int, int, double, double, | ||
/* Paints the image onto the cairo_surface_t */ | ||
void cairo_draw_image(const char *, cairo_surface_t *, int, int, | ||
double scale_x=1.0, double scale_y=1.0, | ||
double * return_scale_w, double * return_scale_h); | ||
|
||
/* Places an image onto a cairo_t but doesn't call cairo_paint */ | ||
void cairo_place_image(const char *file, cairo_t *cr, int x, int y, | ||
int width, int height, double alpha=1.0); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters