Main Page | Class Hierarchy | Class List | File List | Class Members

image.h

00001 /* 00002 * This file is part of libCP 00003 * FILE: image.h 00004 * AUTHOR: Harald Studer <hs@lexip.ch> 00005 * Mathias Herzog <mathu@gmx.ch> 00006 * 00007 * 00008 * Copyright (c) 2004, The libCP project 00009 * 00010 * This program is free software; you can redistribute it and/or modify 00011 * it under the terms of the GNU Public License as published by 00012 * the Free Software Foundation; either version 2 of the License, or 00013 * (at your opinion) any later version. 00014 * 00015 * This program is distributed in the hope that it will be useful, 00016 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00017 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 00018 * General Public License for more details. 00019 * 00020 * You should have received a copy of the GNU General Public License 00021 * along with this program; see the file COPYING. If not, write to 00022 * the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 00023 * Boston, MA 02111-1307, USA. 00024 */ 00025 00026 #ifndef _LIBCP_IMAGE_H_ 00027 #define _LIBCP_IMAGE_H_ 00028 00029 #include <cstdlib> 00030 #include <iostream> 00031 00032 using namespace std; 00033 00034 #include "globals.h" 00035 #include "baseimage.h" 00036 00037 namespace LIBCP{ 00038 00039 00040 struct Color{ 00041 Uint8 red; 00042 Uint8 green; 00043 Uint8 blue; 00044 }; 00045 00051 class Image : public BaseImage 00052 { 00053 public: 00054 ~Image(); 00055 //static Image* createImage( char* file, int format ); 00056 static Image* createImage( int width, int height, int type ); 00057 static Image* createImage( void* buffer, int width, 00058 int height, int type ); 00059 Uint8* pixel( int x, int y ); 00060 //int width(); 00061 //int height(); 00062 void lock(); 00063 void unlock(); 00064 int depth(); 00065 int pitch(); 00066 //int type(); 00067 bool isValidPixel(int x, int y); 00068 //void saveToFile( char* filename, int format ); 00069 void setBuffer( void* buffer ); 00070 Image& operator=( Image& i ); 00071 void* getBuffer(); 00072 00073 private: 00074 Image( void* buffer, int width, int height, int depth, int pitch, int type ); 00075 void* m_buffer; 00076 //int m_width, m_height; 00077 int m_depth; //byte per pixel: 1, 3, 4 00078 int m_pitch; //lenght of a image scanline in byte 00079 //int m_type; //type of the image: COLOR32, COLOR24, GRAY, BINARY 00080 00081 };//end of class Image definition 00082 00083 } 00084 #endif /* _LIBCP_IMAGE_H_ */

Generated on Wed May 26 16:43:53 2004 for libcp by doxygen 1.3.7