1 /* 2 * A Z-Machine 3 * Copyright (C) 2000 Andrew Hunter 4 * 5 * This library is free software; you can redistribute it and/or 6 * modify it under the terms of the GNU Lesser General Public 7 * License as published by the Free Software Foundation; either 8 * version 2.1 of the License, or (at your option) any later version. 9 * 10 * This library is distributed in the hope that it will be useful, 11 * but WITHOUT ANY WARRANTY; without even the implied warranty of 12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 13 * Lesser General Public License for more details. 14 * 15 * You should have received a copy of the GNU Lesser General Public 16 * License along with this library; if not, write to the Free Software 17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 18 */ 19 20 /* 21 * Generic image routines 22 */ 23 24 #ifndef __IMAGE_H 25 #define __IMAGE_H 26 27 #include "ztypes.h" 28 #include "file.h" 29 30 /* 31 * This file is mainly here to help the display system deal with 32 * images... consequently, some features may or not be implemented 33 * depending on if they're actually *needed* for the display 34 * type. (The routines to do with getting the actual image data being 35 * the most likely suspects for this... X doesn't provide us with 36 * anything particularily high-level for dealing with images, but Mac 37 * OS does, so there we don't need to arse around in the actual image 38 * data.) 39 */ 40 41 typedef struct image_data image_data; /* Black box data type */ 42 43 image_data* image_load (ZFile* file, 44 int offset, 45 int len, 46 image_data* palimg); 47 void image_unload (image_data*); 48 void image_unload_rgb (image_data*); 49 50 int image_cmp_palette(image_data*, image_data*); 51 52 int image_width (image_data*); 53 int image_height (image_data*); 54 unsigned char* image_rgb (image_data*); 55 56 void image_resample (image_data*, int n, int d); 57 58 void image_set_data (image_data*, void*, 59 void (*destruct)(image_data*, void*)); 60 void* image_get_data (image_data*); 61 62 #endif 63 64