2 * Copyright (C) 2004-2008 Kim Woelders
4 * Permission is hereby granted, free of charge, to any person obtaining a copy
5 * of this software and associated documentation files (the "Software"), to
6 * deal in the Software without restriction, including without limitation the
7 * rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
8 * sell copies of the Software, and to permit persons to whom the Software is
9 * furnished to do so, subject to the following conditions:
11 * The above copyright notice and this permission notice shall be included in
12 * all copies of the Software, its documentation and marketing & publicity
13 * materials, and acknowledgment shall be given in the documentation, materials
14 * and software packages that this Software was used.
16 * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17 * IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18 * FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
19 * THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
20 * IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
21 * CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
30 typedef void EImageColorModifier;
33 int left, right, top, bottom;
36 #define EIMAGE_BLEND 0x0001
37 #define EIMAGE_ANTI_ALIAS 0x0002
38 #define EIMAGE_HIGH_MASK_THR 0x0004
39 #define EIMAGE_ISCALE 0x0f00 /* Intermediate scaling */
41 void EImageInit(void);
42 void EImageExit(int quit);
43 int EImageSetCacheSize(int size);
45 EImage *EImageCreate(int w, int h);
46 EImage *EImageCreateFromData(int w, int h, unsigned int *data);
47 EImage *EImageCreateScaled(EImage * im, int sx, int sy,
48 int sw, int sh, int dw, int dh);
50 void EImageFree(EImage * im);
51 void EImageDecache(EImage * im);
53 void EImageSave(EImage * im, const char *file);
54 EImage *EImageLoad(const char *file);
56 void EImageCheckAlpha(EImage * im);
58 void EImageSetHasAlpha(EImage * im, int has_alpha);
59 void EImageSetBorder(EImage * im, EImageBorder * border);
61 int EImageHasAlpha(EImage * im);
62 void EImageGetSize(EImage * im, int *pw, int *ph);
63 void *EImageGetData(EImage * im);
65 void EImageFill(EImage * im, int x, int y, int w, int h, int r,
67 void EImageOrientate(EImage * im, int orientation);
69 void EImageBlend(EImage * im, EImage * src, int flags,
70 int sx, int sy, int sw, int sh,
71 int dx, int dy, int dw, int dh,
73 void EImageBlendCM(EImage * im, EImage * src,
74 EImageColorModifier * icm);
75 void EImageTile(EImage * im, EImage * tile, int flags, int tw,
76 int th, int dx, int dy, int dw, int dh, int ox,
79 EImage *EImageGrabDrawable(Drawable draw, Pixmap mask,
80 int x, int y, int w, int h, int grab);
81 EImage *EImageGrabDrawableScaled(Win win,
82 Drawable draw, Pixmap mask,
83 int x, int y, int w, int h,
84 int iw, int ih, int grab,
85 int get_mask_from_shape);
87 void EImageRenderOnDrawable(EImage * im, Win win, Drawable draw,
89 int x, int y, int w, int h);
91 void EImageRenderPixmaps(EImage * im, Win win, int flags,
92 Pixmap * pmap, Pixmap * mask,
94 void EImagePixmapsFree(Pixmap pmap, Pixmap mask);
96 void EImageApplyToWin(EImage * im, Win win, int flags,
99 EImageColorModifier *EImageColorModifierCreate(void);
100 void EImageColorModifierSetTables(EImageColorModifier * icm,
106 void ScaleRect(Win wsrc, Drawable src, Win wdst, Pixmap dst,
107 int sx, int sy, int sw, int sh,
108 int dx, int dy, int dw, int dh, int flags);
109 void ScaleTile(Win wsrc, Drawable src, Win wdst, Pixmap dst,
110 int dx, int dy, int dw, int dh, int flags);
112 void EDrawableDumpImage(Drawable draw, const char *txt);
114 EImage *ThemeImageLoad(const char *file);
116 #endif /* _EIMAGE_H_ */