00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #ifndef __BLITTER_H_
00021 #define __BLITTER_H_
00022
00023 #ifdef HAVE_CONFIG_H
00024 #include "config.h"
00025 #endif
00026
00027 #ifdef DEBUG
00028 # ifndef NO_DEBUG_CLIPPER
00029 # define DEBUG_CLIPPER
00030 # endif
00031 #else
00032 # ifdef DEBUG_CLIPPER
00033 # error DEBUG_CLIPPER defined without DEBUG
00034 # endif
00035 #endif
00036
00037 #include <exception>
00038 #include "rect.h"
00039
00040 class chunck;
00046 class blitter {
00047 private:
00048 char * _ptr;
00049 char * _offset;
00050 point _clip;
00051 rect _src;
00052 point _cur;
00053 bool _outside;
00054 #ifdef DEBUG_CLIPPER
00055 int _clipped;
00056 int _clipped_block;
00057 #endif
00058 public:
00065 blitter(char * buffer, const point & dstsize, const rect & src) throw();
00066 virtual ~blitter();
00067 void blit(char *, unsigned int) throw(std::exception);
00068 void blit(chunck &, unsigned int) throw(std::exception);
00069 void put(char) throw(std::exception);
00070 void put(char, unsigned int) throw(std::exception);
00071 void advance(int = 1, int = 0) throw();
00072 void advance_block(int = 1, int = 0) throw();
00073 void put_block(unsigned int) throw(std::exception);
00074 void put_block(chunck &) throw(std::exception);
00075 void put_block(unsigned char *) throw(std::exception);
00076 void put_block(unsigned int, unsigned int, unsigned int, unsigned int) throw(std::exception);
00077 void block_copy(int);
00078 };
00079
00080 #endif