2006-03-29 11:13:17 -08:00
|
|
|
/*
|
2008-01-24 10:37:45 -08:00
|
|
|
* Copyright (C) 2004-2008 Kim Woelders
|
2006-03-29 11:13:17 -08:00
|
|
|
*
|
|
|
|
* Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
|
|
* of this software and associated documentation files (the "Software"), to
|
|
|
|
* deal in the Software without restriction, including without limitation the
|
|
|
|
* rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
|
|
|
|
* sell copies of the Software, and to permit persons to whom the Software is
|
|
|
|
* furnished to do so, subject to the following conditions:
|
|
|
|
*
|
|
|
|
* The above copyright notice and this permission notice shall be included in
|
|
|
|
* all copies of the Software, its documentation and marketing & publicity
|
|
|
|
* materials, and acknowledgment shall be given in the documentation, materials
|
|
|
|
* and software packages that this Software was used.
|
|
|
|
*
|
|
|
|
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
|
|
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
|
|
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
|
|
|
|
* THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
|
|
|
|
* IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
|
|
|
|
* CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
|
|
|
*/
|
|
|
|
#ifndef _EIMAGE_H_
|
|
|
|
#define _EIMAGE_H_
|
|
|
|
|
2006-05-13 06:25:30 -07:00
|
|
|
#include <X11/Xlib.h>
|
|
|
|
#include "xwin.h"
|
|
|
|
|
2006-03-29 11:13:17 -08:00
|
|
|
typedef void EImage;
|
|
|
|
typedef void EImageColorModifier;
|
|
|
|
|
2008-03-23 04:54:24 -07:00
|
|
|
typedef struct {
|
2006-03-29 11:13:17 -08:00
|
|
|
int left, right, top, bottom;
|
|
|
|
} EImageBorder;
|
|
|
|
|
2008-01-24 10:37:45 -08:00
|
|
|
#define EIMAGE_BLEND 0x0001
|
|
|
|
#define EIMAGE_ANTI_ALIAS 0x0002
|
|
|
|
#define EIMAGE_HIGH_MASK_THR 0x0004
|
|
|
|
#define EIMAGE_ISCALE 0x0f00 /* Intermediate scaling */
|
2007-04-06 15:20:07 -07:00
|
|
|
|
2006-03-29 11:13:17 -08:00
|
|
|
void EImageInit(Display * dpy);
|
2007-05-07 16:26:13 -07:00
|
|
|
int EImageSetCacheSize(int size);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
|
|
|
EImage *EImageCreate(int w, int h);
|
|
|
|
EImage *EImageCreateFromData(int w, int h, unsigned int *data);
|
|
|
|
EImage *EImageCreateScaled(EImage * im, int sx, int sy,
|
|
|
|
int sw, int sh, int dw, int dh);
|
|
|
|
|
|
|
|
void EImageFree(EImage * im);
|
|
|
|
void EImageDecache(EImage * im);
|
|
|
|
|
|
|
|
void EImageSave(EImage * im, const char *file);
|
|
|
|
EImage *EImageLoad(const char *file);
|
|
|
|
|
|
|
|
void EImageCheckAlpha(EImage * im);
|
|
|
|
|
|
|
|
void EImageSetHasAlpha(EImage * im, int has_alpha);
|
|
|
|
void EImageSetBorder(EImage * im, EImageBorder * border);
|
|
|
|
|
|
|
|
int EImageHasAlpha(EImage * im);
|
|
|
|
void EImageGetSize(EImage * im, int *pw, int *ph);
|
2006-12-28 09:44:42 -08:00
|
|
|
void *EImageGetData(EImage * im);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
|
|
|
void EImageFill(EImage * im, int x, int y, int w, int h, int r,
|
|
|
|
int g, int b, int a);
|
|
|
|
void EImageOrientate(EImage * im, int orientation);
|
|
|
|
|
2007-04-07 09:18:53 -07:00
|
|
|
void EImageBlend(EImage * im, EImage * src, int flags,
|
2006-03-29 11:13:17 -08:00
|
|
|
int sx, int sy, int sw, int sh,
|
|
|
|
int dx, int dy, int dw, int dh,
|
2007-04-07 09:18:53 -07:00
|
|
|
int merge_alpha);
|
2006-03-29 11:13:17 -08:00
|
|
|
void EImageBlendCM(EImage * im, EImage * src,
|
|
|
|
EImageColorModifier * icm);
|
2007-04-07 09:18:53 -07:00
|
|
|
void EImageTile(EImage * im, EImage * tile, int flags, int tw,
|
2006-03-29 11:13:17 -08:00
|
|
|
int th, int dx, int dy, int dw, int dh, int ox,
|
|
|
|
int oy);
|
|
|
|
|
|
|
|
EImage *EImageGrabDrawable(Drawable draw, Pixmap mask,
|
|
|
|
int x, int y, int w, int h, int grab);
|
2006-05-14 03:59:30 -07:00
|
|
|
EImage *EImageGrabDrawableScaled(Win win,
|
|
|
|
Drawable draw, Pixmap mask,
|
2006-03-29 11:13:17 -08:00
|
|
|
int x, int y, int w, int h,
|
|
|
|
int iw, int ih, int grab,
|
|
|
|
int get_mask_from_shape);
|
|
|
|
|
2006-05-13 06:25:30 -07:00
|
|
|
void EImageRenderOnDrawable(EImage * im, Win win, Drawable draw,
|
2007-04-06 15:20:07 -07:00
|
|
|
int flags,
|
|
|
|
int x, int y, int w, int h);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
2007-04-06 15:20:07 -07:00
|
|
|
void EImageRenderPixmaps(EImage * im, Win win, int flags,
|
2006-03-29 11:13:17 -08:00
|
|
|
Pixmap * pmap, Pixmap * mask,
|
|
|
|
int w, int h);
|
2007-12-15 08:29:22 -08:00
|
|
|
void EImagePixmapsFree(Pixmap pmap, Pixmap mask);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
2007-12-15 09:10:47 -08:00
|
|
|
void EImageApplyToWin(EImage * im, Win win, int flags,
|
|
|
|
int w, int h);
|
|
|
|
|
2006-03-29 14:56:29 -08:00
|
|
|
EImageColorModifier *EImageColorModifierCreate(void);
|
|
|
|
void EImageColorModifierSetTables(EImageColorModifier * icm,
|
|
|
|
unsigned char *r,
|
|
|
|
unsigned char *g,
|
|
|
|
unsigned char *b,
|
|
|
|
unsigned char *a);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
2007-12-30 13:18:04 -08:00
|
|
|
void ScaleRect(Win wsrc, Drawable src, Win wdst, Pixmap dst,
|
2006-03-29 11:13:17 -08:00
|
|
|
int sx, int sy, int sw, int sh,
|
2008-01-24 10:37:45 -08:00
|
|
|
int dx, int dy, int dw, int dh, int flags);
|
2008-01-14 13:49:12 -08:00
|
|
|
void ScaleTile(Win wsrc, Drawable src, Win wdst, Pixmap dst,
|
2008-01-24 10:37:45 -08:00
|
|
|
int dx, int dy, int dw, int dh, int flags);
|
2006-03-29 11:13:17 -08:00
|
|
|
|
2006-04-23 15:11:26 -07:00
|
|
|
void EDrawableDumpImage(Drawable draw, const char *txt);
|
|
|
|
|
2006-12-28 09:44:42 -08:00
|
|
|
EImage *ThemeImageLoad(const char *file);
|
|
|
|
|
2006-03-29 11:13:17 -08:00
|
|
|
#endif /* _EIMAGE_H_ */
|