/* * This file was generated automatically by ExtUtils::ParseXS version 2.18 from the * contents of Imlib2.xs. Do not edit this file, edit Imlib2.xs instead. * * ANY CHANGES MADE HERE WILL BE LOST! * */ #line 1 "lib/Image/Imlib2.xs" #include "EXTERN.h" #include "perl.h" #include "XSUB.h" #include "ppport.h" #include #include #include typedef Imlib_Image Image__Imlib2; typedef ImlibPolygon Image__Imlib2__Polygon; typedef Imlib_Color_Range Image__Imlib2__ColorRange; bool colours_equal(Imlib_Color col1, Imlib_Color col2) { return col1.red == col2.red && col1.green == col2.green && col1.blue == col2.blue; } static double TEXT_TO_RIGHT(void) { return IMLIB_TEXT_TO_RIGHT; } static double TEXT_TO_LEFT(void) { return IMLIB_TEXT_TO_LEFT; } static double TEXT_TO_UP(void) { return IMLIB_TEXT_TO_UP; } static double TEXT_TO_DOWN(void) { return IMLIB_TEXT_TO_DOWN; } static double TEXT_TO_ANGLE(void) { return IMLIB_TEXT_TO_ANGLE; } #ifndef PERL_UNUSED_VAR # define PERL_UNUSED_VAR(var) if (0) var = var #endif #line 65 "lib/Image/Imlib2.c" XS(XS_Image__Imlib2_TEXT_TO_RIGHT); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_TEXT_TO_RIGHT) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::TEXT_TO_RIGHT", ""); PERL_UNUSED_VAR(cv); /* -W */ { double RETVAL; dXSTARG; RETVAL = TEXT_TO_RIGHT(); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_TEXT_TO_LEFT); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_TEXT_TO_LEFT) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::TEXT_TO_LEFT", ""); PERL_UNUSED_VAR(cv); /* -W */ { double RETVAL; dXSTARG; RETVAL = TEXT_TO_LEFT(); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_TEXT_TO_UP); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_TEXT_TO_UP) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::TEXT_TO_UP", ""); PERL_UNUSED_VAR(cv); /* -W */ { double RETVAL; dXSTARG; RETVAL = TEXT_TO_UP(); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_TEXT_TO_DOWN); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_TEXT_TO_DOWN) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::TEXT_TO_DOWN", ""); PERL_UNUSED_VAR(cv); /* -W */ { double RETVAL; dXSTARG; RETVAL = TEXT_TO_DOWN(); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_TEXT_TO_ANGLE); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_TEXT_TO_ANGLE) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 0) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::TEXT_TO_ANGLE", ""); PERL_UNUSED_VAR(cv); /* -W */ { double RETVAL; dXSTARG; RETVAL = TEXT_TO_ANGLE(); XSprePUSH; PUSHn((double)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 0 || items > 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::new", "packname=\"Image::Imlib2\", x=256, y=256"); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; int x; int y; Image__Imlib2 RETVAL; if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } if (items < 2) x = 256; else { x = (int)SvIV(ST(1)); } if (items < 3) y = 256; else { y = (int)SvIV(ST(2)); } #line 79 "lib/Image/Imlib2.xs" { Imlib_Image image; image = imlib_create_image(x, y); imlib_context_set_image(image); imlib_image_set_has_alpha(1); RETVAL = image; } #line 222 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2__new_using_data); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__new_using_data) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 4) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::_new_using_data", "packname=\"Image::Imlib2\", x=256, y=256, data"); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; int x; int y; DATA32 * data = (DATA32 *)SvPV_nolen(ST(3)); Image__Imlib2 RETVAL; if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } if (items < 2) x = 256; else { x = (int)SvIV(ST(1)); } if (items < 3) y = 256; else { y = (int)SvIV(ST(2)); } #line 102 "lib/Image/Imlib2.xs" { Imlib_Image image; image = imlib_create_image_using_copied_data(x, y, data); imlib_context_set_image(image); imlib_image_set_has_alpha(1); RETVAL = image; } #line 276 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_will_blend); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_will_blend) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif PERL_UNUSED_VAR(cv); /* -W */ { char * packname; #line 121 "lib/Image/Imlib2.xs" char value; #line 298 "lib/Image/Imlib2.c" char RETVAL; dXSTARG; if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 126 "lib/Image/Imlib2.xs" { if (items > 1) { value = SvTRUE(ST(1))?1:0; imlib_context_set_blend(value); } RETVAL = imlib_context_get_blend(); } #line 317 "lib/Image/Imlib2.c" XSprePUSH; PUSHp((char *)&RETVAL, 1); } XSRETURN(1); } XS(XS_Image__Imlib2_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::DESTROY", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; if (SvROK(ST(0))) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not a reference"); #line 148 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_free_image(); } #line 350 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_load); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_load) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::load", "packname=\"Image::Imlib2\", filename"); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; char * filename = (char *)SvPV_nolen(ST(1)); Image__Imlib2 RETVAL; if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 164 "lib/Image/Imlib2.xs" { Imlib_Image image; Imlib_Load_Error err; image = imlib_load_image_with_error_return (filename, &err); if (err == IMLIB_LOAD_ERROR_FILE_DOES_NOT_EXIST) { Perl_croak(aTHX_ "Image::Imlib2 load error: File does not exist"); } if (err == IMLIB_LOAD_ERROR_FILE_IS_DIRECTORY) { Perl_croak(aTHX_ "Image::Imlib2 load error: File is directory"); } if (err == IMLIB_LOAD_ERROR_PERMISSION_DENIED_TO_READ) { Perl_croak(aTHX_ "Image::Imlib2 load error: Permission denied"); } if (err == IMLIB_LOAD_ERROR_NO_LOADER_FOR_FILE_FORMAT) { Perl_croak(aTHX_ "Image::Imlib2 load error: No loader for file format"); } RETVAL = image; } #line 400 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_save); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_save) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::save", "image, filename"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; char * filename = (char *)SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 198 "lib/Image/Imlib2.xs" { Imlib_Load_Error err; imlib_context_set_image(image); imlib_save_image_with_error_return(filename, &err); if (err != IMLIB_LOAD_ERROR_NONE) { Perl_croak(aTHX_ "Image::Imlib2 save error: Unknown error"); } } #line 440 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_get_width); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_get_width) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::get_width", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 219 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); RETVAL = imlib_image_get_width(); } #line 475 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_width); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_width) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::width", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 236 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); RETVAL = imlib_image_get_width(); } #line 511 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_get_height); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_get_height) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::get_height", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 253 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); RETVAL = imlib_image_get_height(); } #line 547 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_height); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_height) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::height", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 270 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); RETVAL = imlib_image_get_height(); } #line 583 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_set_color); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_set_color) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::set_color", "image, r, g, b, a"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int r = (int)SvIV(ST(1)); int g = (int)SvIV(ST(2)); int b = (int)SvIV(ST(3)); int a = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 291 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_context_set_color(r, g, b, a); } #line 620 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_set_colour); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_set_colour) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::set_colour", "image, r, g, b, a"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int r = (int)SvIV(ST(1)); int g = (int)SvIV(ST(2)); int b = (int)SvIV(ST(3)); int a = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 309 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_context_set_color(r, g, b, a); } #line 656 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_draw_point); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_point) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_point", "image, x, y"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 325 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_draw_pixel(x, y, 0); } #line 690 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_draw_line); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_line) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_line", "image, x1, y1, x2, y2"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x1 = (int)SvIV(ST(1)); int y1 = (int)SvIV(ST(2)); int x2 = (int)SvIV(ST(3)); int y2 = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 343 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_draw_line(x1, y1, x2, y2, 0); } #line 726 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_query_pixel); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_query_pixel) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::query_pixel", "image, x, y"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); #line 358 "lib/Image/Imlib2.xs" Imlib_Color color_return; #line 752 "lib/Image/Imlib2.c" if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 361 "lib/Image/Imlib2.xs" imlib_context_set_image(image); imlib_image_query_pixel(x, y, &color_return); XPUSHs(sv_2mortal(newSViv(color_return.red))); XPUSHs(sv_2mortal(newSViv(color_return.green))); XPUSHs(sv_2mortal(newSViv(color_return.blue))); XPUSHs(sv_2mortal(newSViv(color_return.alpha))); #line 768 "lib/Image/Imlib2.c" PUTBACK; return; } } XS(XS_Image__Imlib2_autocrop_dimensions); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_autocrop_dimensions) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::autocrop_dimensions", "image"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Image__Imlib2 image; #line 376 "lib/Image/Imlib2.xs" Imlib_Color c, bg, tl, tr, bl, br; int width, height; int cx = 0; int cy = 0; int cw, ch; int x1, y1, x2, y2; int i; bool abort; #line 800 "lib/Image/Imlib2.c" if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 386 "lib/Image/Imlib2.xs" imlib_context_set_image(image); width = imlib_image_get_width(); height = imlib_image_get_height(); cw = width; ch = height; /* guess the background colour algorithm from gimp's autocrop.c, originally pinched from pnmcrop: first see if three corners are equal, then if two are equal, otherwise give up */ imlib_image_query_pixel(0, 0, &tl); imlib_image_query_pixel(width - 1, 0, &tr); imlib_image_query_pixel(0, height - 1, &bl); imlib_image_query_pixel(width -1 , height - 1, &br); if (colours_equal(tr, bl) && colours_equal(tr, br)) { bg = tr; } else if (colours_equal(tl, bl) && colours_equal(tl, br)) { bg = tl; } else if (colours_equal(tl, tr) && colours_equal(tl, br)) { bg = tl; } else if (colours_equal(tl, tr) && colours_equal(tl, bl)) { bg = tl; } else if (colours_equal(tl, tr) || colours_equal(tl, bl) || colours_equal(tl, br)) { bg = tl; } else if (colours_equal(tr, bl) || colours_equal(tr, bl)) { bg = tr; } else if (colours_equal(br, bl)) { bg = br; } else { /* all different? give up */ XPUSHs(sv_2mortal(newSViv(cx))); XPUSHs(sv_2mortal(newSViv(cy))); XPUSHs(sv_2mortal(newSViv(cw))); XPUSHs(sv_2mortal(newSViv(ch))); return; } /* warn ("Have background colour: %i, %i, %i", bg.red, bg.green, bg.blue); */ /* check how many of the bottom lines are uniform */ abort = FALSE; for (y2 = height - 1; y2 >= 0 && !abort; y2--) { for (i = 0; i < width && !abort; i++) { imlib_image_query_pixel(i, y2, &c); abort = !colours_equal (c, bg); } } /* warn("x1 %i, y1 %i, x2 %i, y2 %i", x1, y1, x2, y2); */ if (y2 == -1) { /* plain colour */ XPUSHs(sv_2mortal(newSViv(cx))); XPUSHs(sv_2mortal(newSViv(cy))); XPUSHs(sv_2mortal(newSViv(cw))); XPUSHs(sv_2mortal(newSViv(ch))); return; } /* since now we don't need to check for the upper boundary of the outer loops as there is at least one pixel of different colour */ /* check how many of the top lines are uniform */ abort = FALSE; for (y1 = 0; !abort; y1++) { for (i = 0; i < width && !abort; i++) { imlib_image_query_pixel(i, y1, &c); abort = !colours_equal (c, bg); } } y2 += 1; /* to make y2 - y1 == height */ /* warn("x1 %i, y1 %i, x2 %i, y2 %i", x1, y1, x2, y2); */ /* the coordinates are now the first rows which DON'T match * the colour - crop instead to one row larger: */ if (y1 > 0) --y1; if (y2 < height-1) ++y2; /* check how many of the left lines are uniform */ abort = FALSE; for (x1 = 0; !abort; x1++) { for (i = y1; i < y2 && !abort; i++) { imlib_image_query_pixel(x1, i, &c); abort = !colours_equal (c, bg); } } /* warn("x1 %i, y1 %i, x2 %i, y2 %i", x1, y1, x2, y2); */ /* check how many of the right lines are uniform */ abort = FALSE; for (x2 = width - 1; !abort; x2--) { for (i = y1; i < y2 && !abort; i++) { imlib_image_query_pixel(x2, i, &c); abort = !colours_equal (c, bg); } } x2 += 1; /* to make x2 - x1 == width */ /* the coordinates are now the first columns which DON'T match * the color - crop instead to one column larger: */ if (x1 > 0) --x1; if (x2 < width-1) ++x2; /* warn("x1 %i, y1 %i, x2 %i, y2 %i", x1, y1, x2, y2); */ cx = x1; cy = y1; cw = x2 - x1; ch = y2 - y1; XPUSHs(sv_2mortal(newSViv(cx))); XPUSHs(sv_2mortal(newSViv(cy))); XPUSHs(sv_2mortal(newSViv(cw))); XPUSHs(sv_2mortal(newSViv(ch))); #line 930 "lib/Image/Imlib2.c" PUTBACK; return; } } XS(XS_Image__Imlib2_find_colour); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_find_colour) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::find_colour", "image"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Image__Imlib2 image; #line 515 "lib/Image/Imlib2.xs" Imlib_Color c; int r, g, b, a; int width, height; int x = 0; int y = 0; bool abort; #line 960 "lib/Image/Imlib2.c" if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 523 "lib/Image/Imlib2.xs" imlib_context_set_image(image); width = imlib_image_get_width(); height = imlib_image_get_height(); imlib_context_get_color(&r, &g, &b, &a); // warn("pr = %i, pg = %i, pb = %i", r, g, b); abort = FALSE; for (y = 0; y < height && !abort; y++) { for (x = 0; x < width && !abort; x++) { imlib_image_query_pixel(x, y, &c); abort = c.red == r && c.green == g && c.blue == b; } } if (abort) { XPUSHs(sv_2mortal(newSViv(x))); XPUSHs(sv_2mortal(newSViv(y))); } else { XPUSHs(newSV(0)); XPUSHs(newSV(0)); } #line 990 "lib/Image/Imlib2.c" PUTBACK; return; } } XS(XS_Image__Imlib2_fill); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_fill) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 3 || items > 4) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::fill", "image, x, y, newimage=NULL"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Image__Imlib2 image; Image__Imlib2 newimage; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); #line 555 "lib/Image/Imlib2.xs" Imlib_Color c; int r, g, b, a; int or, og, ob, oa; int width, height, px, py, west, east; AV* coords; SV* sv; int length; bool abort; #line 1025 "lib/Image/Imlib2.c" if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (items < 4) newimage = NULL; else { if (sv_derived_from(ST(3), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(3))); newimage = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "newimage is not of type Image::Imlib2"); } #line 565 "lib/Image/Imlib2.xs" imlib_context_set_image(image); width = imlib_image_get_width(); height = imlib_image_get_height(); imlib_image_query_pixel(x, y, &c); or = c.red; og = c.green; ob = c.blue; imlib_context_get_color(&r, &g, &b, &a); // warn("pr = %i, pg = %i, pb = %i", r, g, b); coords = newAV(); av_push(coords, newSViv(x)); av_push(coords, newSViv(y)); while (av_len(coords) != -1) { length = av_len(coords); // warn("length %i", length); sv = av_shift(coords); x = SvIVX(sv); sv_free(sv); sv = av_shift(coords); y = SvIVX(sv); sv_free(sv); imlib_image_query_pixel(x, y, &c); if ((c.red == or && c.green == og && c.blue == ob)) { if (newimage != NULL) { imlib_context_set_image(newimage); imlib_context_set_color(r, g, b, a); imlib_image_draw_pixel(x, y, 0); imlib_context_set_image(image); } imlib_image_draw_pixel(x, y, 0); west = x; east = x; abort = FALSE; while (!abort) { west -= 1; imlib_image_query_pixel(west, y, &c); abort = (west == 0 || !(c.red == or && c.green == og && c.blue == ob) ); } abort = FALSE; while (!abort) { east += 1; imlib_image_query_pixel(east, y, &c); abort = (east == width || !(c.red == or && c.green == og && c.blue == ob) ); } // warn(" %i-%i, %i", west, east, y); for (px = west; px <= east; px++) { if (newimage != NULL) { imlib_context_set_image(newimage); imlib_image_draw_pixel(px, y, 0); imlib_context_set_image(image); } imlib_image_draw_pixel(px, y, 0); py = y - 1; imlib_image_query_pixel(px, py, &c); if (py > 0 && (c.red == or && c.green == og && c.blue == ob) ) { // warn(" ^ %i, %i", px, py); av_push(coords, newSViv(px)); av_push(coords, newSViv(py)); } py = y + 1; imlib_image_query_pixel(px, py, &c); if (py < height && (c.red == or && c.green == og && c.blue == ob) ) { // warn(" v %i, %i", px, py); av_push(coords, newSViv(px)); av_push(coords, newSViv(py)); } } } } av_undef(coords); #line 1135 "lib/Image/Imlib2.c" PUTBACK; return; } } XS(XS_Image__Imlib2_draw_rectangle); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_rectangle) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_rectangle", "image, x, y, w, h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); int w = (int)SvIV(ST(3)); int h = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 668 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_draw_rectangle(x, y, w, h); } #line 1172 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_fill_rectangle); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_fill_rectangle) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::fill_rectangle", "image, x, y, w, h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); int w = (int)SvIV(ST(3)); int h = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 686 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_fill_rectangle(x, y, w, h); } #line 1208 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_draw_ellipse); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_ellipse) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_ellipse", "image, x, y, w, h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); int w = (int)SvIV(ST(3)); int h = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 704 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_draw_ellipse(x, y, w, h); } #line 1244 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_fill_ellipse); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_fill_ellipse) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::fill_ellipse", "image, x, y, w, h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); int w = (int)SvIV(ST(3)); int h = (int)SvIV(ST(4)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 722 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_fill_ellipse(x, y, w, h); } #line 1280 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_add_font_path); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_add_font_path) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::add_font_path", "image, directory"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; char * directory = (char *)SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 739 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_add_path_to_font_path(directory); } #line 1313 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_load_font); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_load_font) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::load_font", "image, fontname"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; char * fontname = (char *)SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 754 "lib/Image/Imlib2.xs" { Imlib_Font font; imlib_context_set_image(image); font = imlib_load_font(fontname); imlib_context_set_font(font); } #line 1349 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_get_text_size); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_get_text_size) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 2 || items > 4) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::get_text_size", "image, text, direction=IMLIB_TEXT_TO_RIGHT, angle=0"); PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(ax); /* -Wall */ SP -= items; { Image__Imlib2 image; char * text = (char *)SvPV_nolen(ST(1)); int direction; double angle; #line 774 "lib/Image/Imlib2.xs" int text_w; int text_h; #line 1377 "lib/Image/Imlib2.c" if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (items < 3) direction = IMLIB_TEXT_TO_RIGHT; else { direction = (int)SvIV(ST(2)); } if (items < 4) angle = 0; else { angle = (double)SvNV(ST(3)); } #line 778 "lib/Image/Imlib2.xs" imlib_context_set_image(image); imlib_context_set_direction(direction); imlib_context_set_angle(angle); imlib_get_text_size(text, &text_w, &text_h); XPUSHs(sv_2mortal(newSViv(text_w))); XPUSHs(sv_2mortal(newSViv(text_h))); #line 1406 "lib/Image/Imlib2.c" PUTBACK; return; } } XS(XS_Image__Imlib2_draw_text); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_text) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 4 || items > 6) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_text", "image, x, y, text, direction=IMLIB_TEXT_TO_RIGHT, angle=0"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); char * text = (char *)SvPV_nolen(ST(3)); int direction; double angle; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (items < 5) direction = IMLIB_TEXT_TO_RIGHT; else { direction = (int)SvIV(ST(4)); } if (items < 6) angle = 0; else { angle = (double)SvNV(ST(5)); } #line 800 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_context_set_direction(direction); imlib_context_set_angle(angle); imlib_text_draw(x, y, text); } #line 1458 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_crop); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_crop) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 5) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::crop", "image, x, y, w, h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); int w = (int)SvIV(ST(3)); int h = (int)SvIV(ST(4)); Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 820 "lib/Image/Imlib2.xs" { Imlib_Image cropped; imlib_context_set_image(image); cropped = imlib_create_cropped_image(x, y, w, h); RETVAL = cropped; } #line 1498 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_blend); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_blend) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 11) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::blend", "image, source, alpha, x, y, w, h, d_x, d_y, d_w, d_h"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2 source; int alpha = (int)SvIV(ST(2)); int x = (int)SvIV(ST(3)); int y = (int)SvIV(ST(4)); int w = (int)SvIV(ST(5)); int h = (int)SvIV(ST(6)); int d_x = (int)SvIV(ST(7)); int d_y = (int)SvIV(ST(8)); int d_w = (int)SvIV(ST(9)); int d_h = (int)SvIV(ST(10)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (sv_derived_from(ST(1), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(1))); source = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "source is not of type Image::Imlib2"); #line 850 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_blend_image_onto_image(source, alpha, x, y, w, h, d_x, d_y, d_w, d_h); } #line 1549 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_blur); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_blur) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::blur", "image, radius"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int radius = (int)SvIV(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 865 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_blur(radius); } #line 1581 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_sharpen); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_sharpen) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::sharpen", "image, radius"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int radius = (int)SvIV(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 879 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_sharpen(radius); } #line 1613 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_clone); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_clone) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::clone", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 892 "lib/Image/Imlib2.xs" { Imlib_Image cloned; imlib_context_set_image(image); cloned = imlib_clone_image(); RETVAL = cloned; } #line 1649 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_draw_polygon); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_draw_polygon) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::draw_polygon", "image, poly, closed"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2__Polygon poly; unsigned char closed = (unsigned char)SvUV(ST(2)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (sv_derived_from(ST(1), "Image::Imlib2::Polygon")) { IV tmp = SvIV((SV*)SvRV(ST(1))); poly = INT2PTR(Image__Imlib2__Polygon,tmp); } else Perl_croak(aTHX_ "poly is not of type Image::Imlib2::Polygon"); #line 913 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_draw_polygon(poly,closed); } #line 1692 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_fill_color_range_rectangle); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_fill_color_range_rectangle) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 7) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::fill_color_range_rectangle", "image, cr, x, y, width, height, angle"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2__ColorRange cr; int x = (int)SvIV(ST(2)); int y = (int)SvIV(ST(3)); int width = (int)SvIV(ST(4)); int height = (int)SvIV(ST(5)); double angle = (double)SvNV(ST(6)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); if (sv_derived_from(ST(1), "Image::Imlib2::ColorRange")) { IV tmp = SvIV((SV*)SvRV(ST(1))); cr = INT2PTR(Image__Imlib2__ColorRange,tmp); } else Perl_croak(aTHX_ "cr is not of type Image::Imlib2::ColorRange"); #line 932 "lib/Image/Imlib2.xs" { Imlib_Color_Range oldcr; imlib_context_set_image(image); oldcr = imlib_context_get_color_range(); imlib_context_set_color_range(cr); imlib_image_fill_color_range_rectangle(x,y,width,height,angle); imlib_context_set_color_range(oldcr); } #line 1741 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_image_orientate); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_image_orientate) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::image_orientate", "image, steps"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int steps = (int)SvIV(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 951 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_orientate(steps); } #line 1774 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_image_set_format); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_image_set_format) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::image_set_format", "image, format"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; char * format = (char *)SvPV_nolen(ST(1)); if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 963 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_set_format(format); } #line 1806 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_create_scaled_image); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_create_scaled_image) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::create_scaled_image", "image, dw, dh"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int dw = (int)SvIV(ST(1)); int dh = (int)SvIV(ST(2)); Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 977 "lib/Image/Imlib2.xs" { Imlib_Image dstimage; int sw, sh; imlib_context_set_image(image); sw = imlib_image_get_width(); sh = imlib_image_get_height(); if ( dw == 0 ) { dw = (int) (((double) dh * sw) / sh); } if ( dh == 0 ) { dh = (int) (((double) dw * sh) / sw); } dstimage = imlib_create_cropped_scaled_image(0, 0, sw, sh, dw, dh); RETVAL = dstimage; } #line 1855 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_set_quality); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_set_quality) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::set_quality", "image, qual"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; int qual = (int)SvIV(ST(1)); Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1006 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_attach_data_value("quality",NULL,qual,NULL); } #line 1890 "lib/Image/Imlib2.c" } XSRETURN(1); } XS(XS_Image__Imlib2_flip_horizontal); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_flip_horizontal) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::flip_horizontal", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1017 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_flip_horizontal(); } #line 1922 "lib/Image/Imlib2.c" } XSRETURN(1); } XS(XS_Image__Imlib2_flip_vertical); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_flip_vertical) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::flip_vertical", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1028 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_flip_vertical(); } #line 1954 "lib/Image/Imlib2.c" } XSRETURN(1); } XS(XS_Image__Imlib2_flip_diagonal); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_flip_diagonal) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::flip_diagonal", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1039 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_flip_diagonal(); } #line 1986 "lib/Image/Imlib2.c" } XSRETURN(1); } XS(XS_Image__Imlib2_has_alpha); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_has_alpha) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::has_alpha", "image, ..."); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; #line 1050 "lib/Image/Imlib2.xs" char value; #line 2008 "lib/Image/Imlib2.c" int RETVAL; dXSTARG; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1055 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); if (items > 1) { value = SvTRUE(ST(1))?1:0; imlib_image_set_has_alpha(value); } RETVAL = imlib_image_has_alpha(); } #line 2030 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_set_cache_size); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_set_cache_size) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 1 || items > 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::set_cache_size", "packname=\"Image::Imlib2\", size"); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; int size = (int)SvIV(ST(1)); if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 1077 "lib/Image/Imlib2.xs" { imlib_set_cache_size(size); } #line 2061 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_get_cache_size); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_get_cache_size) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::get_cache_size", "packname=\"Image::Imlib2\""); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; int RETVAL; dXSTARG; if (items < 1) packname = "Image::Imlib2"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 1089 "lib/Image/Imlib2.xs" { RETVAL = imlib_get_cache_size(); } #line 2092 "lib/Image/Imlib2.c" XSprePUSH; PUSHi((IV)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_set_changes_on_disk); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_set_changes_on_disk) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::set_changes_on_disk", "image"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 image; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); image = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "image is not of type Image::Imlib2"); #line 1102 "lib/Image/Imlib2.xs" { imlib_context_set_image(image); imlib_image_set_changes_on_disk(); } #line 2124 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2_create_transparent_image); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_create_transparent_image) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 2) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::create_transparent_image", "source, alpha"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 source; int alpha = (int)SvIV(ST(1)); #line 1116 "lib/Image/Imlib2.xs" Imlib_Image destination; Imlib_Color color_return; int x, y, w, h; #line 2149 "lib/Image/Imlib2.c" Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); source = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "source is not of type Image::Imlib2"); #line 1121 "lib/Image/Imlib2.xs" { imlib_context_set_image(source); w = imlib_image_get_width(); h = imlib_image_get_height(); destination = imlib_create_image(w, h); imlib_context_set_image(destination); imlib_image_set_has_alpha(1); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { imlib_context_set_image(source); imlib_image_query_pixel(x, y, &color_return); imlib_context_set_color(color_return.red, color_return.green, color_return.blue, alpha); imlib_context_set_image(destination); imlib_image_draw_pixel(x, y, 0); } } RETVAL = destination; } #line 2179 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2_create_blended_image); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2_create_blended_image) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::create_blended_image", "source1, source2, pc"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2 source1; Image__Imlib2 source2; int pc = (int)SvIV(ST(2)); #line 1154 "lib/Image/Imlib2.xs" Imlib_Image destination; Imlib_Color color1, color2; int x, y, w, h; int npc; #line 2208 "lib/Image/Imlib2.c" Image__Imlib2 RETVAL; if (sv_derived_from(ST(0), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(0))); source1 = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "source1 is not of type Image::Imlib2"); if (sv_derived_from(ST(1), "Image::Imlib2")) { IV tmp = SvIV((SV*)SvRV(ST(1))); source2 = INT2PTR(Image__Imlib2,tmp); } else Perl_croak(aTHX_ "source2 is not of type Image::Imlib2"); #line 1160 "lib/Image/Imlib2.xs" { npc = 100 - pc; imlib_context_set_image(source1); w = imlib_image_get_width(); h = imlib_image_get_height(); destination = imlib_create_image(w, h); imlib_context_set_image(destination); for (y = 0; y < h; y++) { for (x = 0; x < w; x++) { imlib_context_set_image(source1); imlib_image_query_pixel(x, y, &color1); imlib_context_set_image(source2); imlib_image_query_pixel(x, y, &color2); imlib_context_set_image(destination); imlib_context_set_color((color1.red * pc + color2.red * npc)/100, (color1.green * pc + color2.green * npc)/100, (color1.blue * pc + color2.blue * npc)/100, 255); imlib_image_draw_line(x, y, x, y, 0); } } RETVAL = destination; } #line 2247 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2__Polygon_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__Polygon_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::Polygon::new", "packname=\"Image::Imlib2::Polygon\""); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; Image__Imlib2__Polygon RETVAL; if (items < 1) packname = "Image::Imlib2::Polygon"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 1195 "lib/Image/Imlib2.xs" { ImlibPolygon poly; poly = imlib_polygon_new(); RETVAL = poly; } #line 2282 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2::Polygon", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2__Polygon_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__Polygon_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::Polygon::DESTROY", "poly"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2__Polygon poly; if (SvROK(ST(0))) { IV tmp = SvIV((SV*)SvRV(ST(0))); poly = INT2PTR(Image__Imlib2__Polygon,tmp); } else Perl_croak(aTHX_ "poly is not a reference"); #line 1212 "lib/Image/Imlib2.xs" { imlib_polygon_free(poly); } #line 2314 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2__Polygon_add_point); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__Polygon_add_point) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 3) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::Polygon::add_point", "poly, x, y"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2__Polygon poly; int x = (int)SvIV(ST(1)); int y = (int)SvIV(ST(2)); if (sv_derived_from(ST(0), "Image::Imlib2::Polygon")) { IV tmp = SvIV((SV*)SvRV(ST(0))); poly = INT2PTR(Image__Imlib2__Polygon,tmp); } else Perl_croak(aTHX_ "poly is not of type Image::Imlib2::Polygon"); #line 1226 "lib/Image/Imlib2.xs" { imlib_polygon_add_point(poly,x,y); } #line 2346 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2__Polygon_fill); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__Polygon_fill) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::Polygon::fill", "poly"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2__Polygon poly; if (sv_derived_from(ST(0), "Image::Imlib2::Polygon")) { IV tmp = SvIV((SV*)SvRV(ST(0))); poly = INT2PTR(Image__Imlib2__Polygon,tmp); } else Perl_croak(aTHX_ "poly is not of type Image::Imlib2::Polygon"); #line 1238 "lib/Image/Imlib2.xs" { imlib_image_fill_polygon(poly); } #line 2376 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2__ColorRange_new); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__ColorRange_new) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items < 0 || items > 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::ColorRange::new", "packname=\"Image::Imlib2::ColorRange\""); PERL_UNUSED_VAR(cv); /* -W */ { char * packname; Image__Imlib2__ColorRange RETVAL; if (items < 1) packname = "Image::Imlib2::ColorRange"; else { packname = (char *)SvPV_nolen(ST(0)); } #line 1252 "lib/Image/Imlib2.xs" { Imlib_Color_Range cr; cr = imlib_create_color_range(); RETVAL = cr; } #line 2409 "lib/Image/Imlib2.c" ST(0) = sv_newmortal(); sv_setref_pv(ST(0), "Image::Imlib2::ColorRange", (void*)RETVAL); } XSRETURN(1); } XS(XS_Image__Imlib2__ColorRange_DESTROY); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__ColorRange_DESTROY) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 1) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::ColorRange::DESTROY", "cr"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2__ColorRange cr; if (SvROK(ST(0))) { IV tmp = SvIV((SV*)SvRV(ST(0))); cr = INT2PTR(Image__Imlib2__ColorRange,tmp); } else Perl_croak(aTHX_ "cr is not a reference"); #line 1268 "lib/Image/Imlib2.xs" { Imlib_Color_Range oldcr; oldcr = imlib_context_get_color_range(); imlib_context_set_color_range(cr); imlib_free_color_range(); imlib_context_set_color_range(oldcr); } #line 2445 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } XS(XS_Image__Imlib2__ColorRange_add_color); /* prototype to pass -Wmissing-prototypes */ XS(XS_Image__Imlib2__ColorRange_add_color) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif if (items != 6) Perl_croak(aTHX_ "Usage: %s(%s)", "Image::Imlib2::ColorRange::add_color", "cr, d, r, g, b, a"); PERL_UNUSED_VAR(cv); /* -W */ { Image__Imlib2__ColorRange cr; int d = (int)SvIV(ST(1)); int r = (int)SvIV(ST(2)); int g = (int)SvIV(ST(3)); int b = (int)SvIV(ST(4)); int a = (int)SvIV(ST(5)); if (sv_derived_from(ST(0), "Image::Imlib2::ColorRange")) { IV tmp = SvIV((SV*)SvRV(ST(0))); cr = INT2PTR(Image__Imlib2__ColorRange,tmp); } else Perl_croak(aTHX_ "cr is not of type Image::Imlib2::ColorRange"); #line 1288 "lib/Image/Imlib2.xs" { Imlib_Color_Range oldcr; oldcr = imlib_context_get_color_range(); imlib_context_set_color_range(cr); imlib_context_set_color(r,b,g,a); imlib_add_color_to_color_range(d); imlib_context_set_color_range(oldcr); } #line 2485 "lib/Image/Imlib2.c" } XSRETURN_EMPTY; } #ifdef __cplusplus extern "C" #endif XS(boot_Image__Imlib2); /* prototype to pass -Wmissing-prototypes */ XS(boot_Image__Imlib2) { #ifdef dVAR dVAR; dXSARGS; #else dXSARGS; #endif char* file = __FILE__; PERL_UNUSED_VAR(cv); /* -W */ PERL_UNUSED_VAR(items); /* -W */ XS_VERSION_BOOTCHECK ; newXS("Image::Imlib2::TEXT_TO_RIGHT", XS_Image__Imlib2_TEXT_TO_RIGHT, file); newXS("Image::Imlib2::TEXT_TO_LEFT", XS_Image__Imlib2_TEXT_TO_LEFT, file); newXS("Image::Imlib2::TEXT_TO_UP", XS_Image__Imlib2_TEXT_TO_UP, file); newXS("Image::Imlib2::TEXT_TO_DOWN", XS_Image__Imlib2_TEXT_TO_DOWN, file); newXS("Image::Imlib2::TEXT_TO_ANGLE", XS_Image__Imlib2_TEXT_TO_ANGLE, file); newXSproto("Image::Imlib2::new", XS_Image__Imlib2_new, file, "$;$$"); newXSproto("Image::Imlib2::_new_using_data", XS_Image__Imlib2__new_using_data, file, "$;$$$"); newXSproto("Image::Imlib2::will_blend", XS_Image__Imlib2_will_blend, file, "$;$"); newXSproto("Image::Imlib2::DESTROY", XS_Image__Imlib2_DESTROY, file, "$"); newXSproto("Image::Imlib2::load", XS_Image__Imlib2_load, file, "$$"); newXSproto("Image::Imlib2::save", XS_Image__Imlib2_save, file, "$$"); newXSproto("Image::Imlib2::get_width", XS_Image__Imlib2_get_width, file, "$"); newXSproto("Image::Imlib2::width", XS_Image__Imlib2_width, file, "$"); newXSproto("Image::Imlib2::get_height", XS_Image__Imlib2_get_height, file, "$"); newXSproto("Image::Imlib2::height", XS_Image__Imlib2_height, file, "$"); newXSproto("Image::Imlib2::set_color", XS_Image__Imlib2_set_color, file, "$$$$$"); newXSproto("Image::Imlib2::set_colour", XS_Image__Imlib2_set_colour, file, "$$$$$"); newXSproto("Image::Imlib2::draw_point", XS_Image__Imlib2_draw_point, file, "$$$"); newXSproto("Image::Imlib2::draw_line", XS_Image__Imlib2_draw_line, file, "$$$$$"); newXSproto("Image::Imlib2::query_pixel", XS_Image__Imlib2_query_pixel, file, "$$"); newXSproto("Image::Imlib2::autocrop_dimensions", XS_Image__Imlib2_autocrop_dimensions, file, "$$"); newXSproto("Image::Imlib2::find_colour", XS_Image__Imlib2_find_colour, file, "$$"); newXSproto("Image::Imlib2::fill", XS_Image__Imlib2_fill, file, "$$$$;$"); newXSproto("Image::Imlib2::draw_rectangle", XS_Image__Imlib2_draw_rectangle, file, "$$$$$"); newXSproto("Image::Imlib2::fill_rectangle", XS_Image__Imlib2_fill_rectangle, file, "$$$$$"); newXSproto("Image::Imlib2::draw_ellipse", XS_Image__Imlib2_draw_ellipse, file, "$$$$$"); newXSproto("Image::Imlib2::fill_ellipse", XS_Image__Imlib2_fill_ellipse, file, "$$$$$"); newXSproto("Image::Imlib2::add_font_path", XS_Image__Imlib2_add_font_path, file, "$$"); newXSproto("Image::Imlib2::load_font", XS_Image__Imlib2_load_font, file, "$$"); newXSproto("Image::Imlib2::get_text_size", XS_Image__Imlib2_get_text_size, file, "$$"); newXSproto("Image::Imlib2::draw_text", XS_Image__Imlib2_draw_text, file, "$$$$;$$"); newXSproto("Image::Imlib2::crop", XS_Image__Imlib2_crop, file, "$$$$$"); newXSproto("Image::Imlib2::blend", XS_Image__Imlib2_blend, file, "$$$$$$$$$$$"); newXSproto("Image::Imlib2::blur", XS_Image__Imlib2_blur, file, "$$"); newXSproto("Image::Imlib2::sharpen", XS_Image__Imlib2_sharpen, file, "$$"); newXSproto("Image::Imlib2::clone", XS_Image__Imlib2_clone, file, "$"); newXSproto("Image::Imlib2::draw_polygon", XS_Image__Imlib2_draw_polygon, file, "$$$"); newXSproto("Image::Imlib2::fill_color_range_rectangle", XS_Image__Imlib2_fill_color_range_rectangle, file, "$$$$$$"); newXSproto("Image::Imlib2::image_orientate", XS_Image__Imlib2_image_orientate, file, "$$"); newXSproto("Image::Imlib2::image_set_format", XS_Image__Imlib2_image_set_format, file, "$$"); newXSproto("Image::Imlib2::create_scaled_image", XS_Image__Imlib2_create_scaled_image, file, "$$$"); newXSproto("Image::Imlib2::set_quality", XS_Image__Imlib2_set_quality, file, "$$"); newXSproto("Image::Imlib2::flip_horizontal", XS_Image__Imlib2_flip_horizontal, file, "$"); newXSproto("Image::Imlib2::flip_vertical", XS_Image__Imlib2_flip_vertical, file, "$"); newXSproto("Image::Imlib2::flip_diagonal", XS_Image__Imlib2_flip_diagonal, file, "$"); newXSproto("Image::Imlib2::has_alpha", XS_Image__Imlib2_has_alpha, file, "$;$"); newXSproto("Image::Imlib2::set_cache_size", XS_Image__Imlib2_set_cache_size, file, "$$"); newXSproto("Image::Imlib2::get_cache_size", XS_Image__Imlib2_get_cache_size, file, "$"); newXSproto("Image::Imlib2::set_changes_on_disk", XS_Image__Imlib2_set_changes_on_disk, file, "$"); newXSproto("Image::Imlib2::create_transparent_image", XS_Image__Imlib2_create_transparent_image, file, "$$"); newXSproto("Image::Imlib2::create_blended_image", XS_Image__Imlib2_create_blended_image, file, "$$"); newXSproto("Image::Imlib2::Polygon::new", XS_Image__Imlib2__Polygon_new, file, "$"); newXSproto("Image::Imlib2::Polygon::DESTROY", XS_Image__Imlib2__Polygon_DESTROY, file, "$"); newXSproto("Image::Imlib2::Polygon::add_point", XS_Image__Imlib2__Polygon_add_point, file, "$$$"); newXSproto("Image::Imlib2::Polygon::fill", XS_Image__Imlib2__Polygon_fill, file, "$"); newXSproto("Image::Imlib2::ColorRange::new", XS_Image__Imlib2__ColorRange_new, file, "$"); newXSproto("Image::Imlib2::ColorRange::DESTROY", XS_Image__Imlib2__ColorRange_DESTROY, file, "$"); newXSproto("Image::Imlib2::ColorRange::add_color", XS_Image__Imlib2__ColorRange_add_color, file, "$$"); XSRETURN_YES; }