Back to index

extremetuxracer  0.5beta
rgb_reader.h
Go to the documentation of this file.
00001 /* 
00002  * Copyright (C) 2004-2005 Volker Stroebel <volker@planetpenguin.de>
00003  * 
00004  * This program is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU General Public License
00006  * as published by the Free Software Foundation; either version 2
00007  * of the License, or (at your option) any later version.
00008  * 
00009  * This program is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00012  * GNU General Public License for more details.
00013  * 
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  */
00018 
00019 #ifndef _RGB_READER_H
00020 #define _RGB_READER_H
00021 
00022 #include "image.h"
00023 
00024 #include <stdio.h>
00025 #include <stdlib.h>
00026 
00027 namespace pp {
00028        
00029 class ReaderRGB : public Image
00030 {
00031        typedef struct  
00032        {
00033               unsigned short imagic;
00034               unsigned short type;
00035               unsigned short dim;
00036               unsigned short sizeX, sizeY, sizeZ;
00037               unsigned long min, max;
00038               unsigned long wasteBytes;
00039               char name[80];
00040               unsigned long colorMap;
00041               FILE *file;
00042               unsigned char *tmp[5];
00043               unsigned long rleEnd;
00044               unsigned int *rowStart;
00045               unsigned int *rowSize;
00046        }ImageInfo;
00047 
00048        ReaderRGB::ImageInfo* ImageOpen(const char *fileName);
00049        void ImageGetRawData( ReaderRGB::ImageInfo *image, unsigned char *data);
00050        void ImageGetRow( ReaderRGB::ImageInfo *image, unsigned char *buf, int y, int z);
00051        void ImageClose( ReaderRGB::ImageInfo *image);
00052        
00053 public:
00054        
00055        ReaderRGB(const char* fileName);
00056        ~ReaderRGB();
00057 };
00058 
00059 
00060 } //namespace pp
00061 
00062 #endif // RGB_READER_H