/* * Image.h -- Image support routines. * * Authors : Patrick LECOANET * Creation date : Wed Dec 8 11:04:44 1999 * * $Id$ */ /* * Copyright (c) 1999 CENA, Patrick Lecoanet -- * * This code is free software; you can redistribute it and/or * modify it under the terms of the GNU Library General Public * License as published by the Free Software Foundation; either * version 2 of the License, or (at your option) any later version. * * This code is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU * Library General Public License for more details. * * You should have received a copy of the GNU Library General Public * License along with this code; if not, write to the Free * Software Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. * */ #ifndef _Image_h #define _Image_h #include #include "Types.h" typedef struct { unsigned char *pixels; int width; int height; int rowstride; } BitmapBits; typedef struct { XImage *pixels; XImage *mask; BitmapBits *b_bits; int width; int height; struct _ImagePixmap *pixmaps; #ifdef SHM ArtPixBuf *pixbuf; #endif } ImageBits; typedef struct _SuckChar { int width; int bitmap_offset; } SuckChar; typedef struct _SuckFont { unsigned char *bitmap; int width; int height; int ascent; int descent; SuckChar chars[256]; } FontBitmap; ImageBits * GetImageBits(ZnWindow /* win */, char */* image_name */, ZnImage /* image */); Pixmap GetImagePixmap(ZnWindow /* win */, char */* image_name */, ZnImage /* image */, Pixmap *mask_pmap); void InvalidateImage(char */* image_name */); BitmapBits * GetBitmapMask(Display */* dpy */, Pixmap /* bitmap */); #define GetBitmapPixel(bbits, x, y) (((bbits)->pixels[(y)*(bbits)->rowstride+((x)>>3)]<<((x)&7))&0x80) FontBitmap * GetFontBitmap(ZnWindow win, ZnFont font); void rgb_text(art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, char *text, int num_chars, int start_x, int start_y, FontBitmap *fb, art_u32 rgba); void rgb_bitmap(art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, art_u8 *src, int start_x, int start_y, int src_width, int src_height, int src_rowstride, art_u32 rgba); void rgb_image(art_u8 *dst, int x0, int y0, int x1, int y1, int dst_rowstride, ArtPixBuf *pixbuf, int start_x, int start_y, int alpha); void tile_svp_aa(const ArtSVP *svp, int x0, int y0, int x1, int y1, int tile_x, int tile_y, ArtPixBuf *tile, art_u32 bg_color, art_u8 *buf, int rowstride); void tile_svp_alpha(const ArtSVP *svp, int x0, int y0, int x1, int y1, int tile_x, int tile_y, ArtPixBuf *tile, art_u8 alpha, art_u8 *buf, int rowstride); #ifdef SHM ArtPixBuf * GetImagePixbuf(ZnWindow /* win */, char */* image_name */, ZnImage /* image */); #endif #endif /* _Image_h */