/* * 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 #ifdef GLX #include #include "Draw.h" #endif #include "Types.h" typedef struct { #ifdef GLX unsigned char *t_bits; /* Should be kept in sync with same part of */ GLuint texture; /* ImageBits */ ZnReal t; ZnReal s; #endif int width; int height; unsigned char *pixels; int rowstride; } BitmapBits; typedef struct _ImageBits { #ifdef GLX unsigned char *t_bits; /* Should be kept in sync with same part of */ GLuint texture; /* BitmapBits */ ZnReal t; ZnReal s; #endif int width; int height; XImage *pixels; XImage *mask; BitmapBits *b_bits; struct _ImagePixmap *pixmaps; } ImageBits; 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) #ifdef GLX TexFont * GetTexFont(ZnWindow /* win */, ZnFont /* font */); ImageBits * GetImageTexture(ZnWindow /* win */, char */* image_name */, ZnImage /* image */); BitmapBits * GetBitmapTexture(Display */* dpy */, Pixmap /* bitmap */); #endif #endif /* _Image_h */