00001 /* 00002 * Copyright (c) 2007. The BATI team. All right reserved. 00003 * 00004 * This file is part of BATI library. 00005 * 00006 * BATI library is free software: you can redistribute it and/or modify 00007 * it under the terms of the GNU General Public License as published by 00008 * the Free Software Foundation, either version 3 of the License, or 00009 * (at your option) any later version. 00010 * 00011 * BATI library is distributed in the hope that it will be useful, 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00014 * GNU General Public License for more details. 00015 * 00016 * You should have received a copy of the GNU General Public License 00017 * along with BATI library. If not, see <http://www.gnu.org/licenses/>. 00018 */ 00019 /* @(#)rasterfile.h 1.11 89/08/21 SMI */ 00020 00021 /* 00022 * Description of header for files containing raster images 00023 */ 00024 00025 #ifndef _rasterfile_h 00026 #define _rasterfile_h 00027 00029 struct rasterfile { 00030 int ras_magic; 00031 int ras_width; 00032 int ras_height; 00033 int ras_depth; 00034 int ras_length; 00035 int ras_type; 00036 int ras_maptype; 00037 int ras_maplength; 00038 /* color map follows for ras_maplength bytes, followed by image */ 00039 }; 00040 #define RAS_MAGIC 0x59a66a95 00041 00042 /* Sun supported ras_type's */ 00043 #define RT_OLD 0 /* Raw pixrect image in 68000 byte order */ 00044 #define RT_STANDARD 1 /* Raw pixrect image in 68000 byte order */ 00045 #define RT_BYTE_ENCODED 2 /* Run-length compression of bytes */ 00046 #define RT_FORMAT_RGB 3 /* XRGB or RGB instead of XBGR or BGR */ 00047 #define RT_FORMAT_TIFF 4 /* tiff <-> standard rasterfile */ 00048 #define RT_FORMAT_IFF 5 /* iff (TAAC format) <-> standard rasterfile */ 00049 #define RT_EXPERIMENTAL 0xffff /* Reserved for testing */ 00050 00051 /* Sun registered ras_maptype's */ 00052 #define RMT_RAW 2 00053 /* Sun supported ras_maptype's */ 00054 #define RMT_NONE 0 /* ras_maplength is expected to be 0 */ 00055 #define RMT_EQUAL_RGB 1 /* red[ras_maplength/3],green[],blue[] */ 00056 00057 /* 00058 * NOTES: 00059 * Each line of the image is rounded out to a multiple of 16 bits. 00060 * This corresponds to the rounding convention used by the memory pixrect 00061 * package (/usr/include/pixrect/memvar.h) of the SunWindows system. 00062 * The ras_encoding field (always set to 0 by Sun's supported software) 00063 * was renamed to ras_length in release 2.0. As a result, rasterfiles 00064 * of type 0 generated by the old software claim to have 0 length; for 00065 * compatibility, code reading rasterfiles must be prepared to compute the 00066 * true length from the width, height, and depth fields. 00067 */ 00068 00069 #endif