30 #ifndef __CLAW_BITMAP_HPP__
31 #define __CLAW_BITMAP_HPP__
65 BMP_COMPRESSION_RGB = 0,
66 BMP_COMPRESSION_RLE8 = 1,
67 BMP_COMPRESSION_RLE4 = 2,
68 BMP_COMPRESSION_BITFIELDS = 3
71 # pragma pack (push,2)
151 template<
bool Coded4bits >
152 class rle_bitmap_output_buffer
158 void fill(
unsigned int n,
unsigned char pattern );
162 void delta_move(
unsigned char x,
unsigned char y);
195 template<
typename OutputBuffer >
196 class rle_bitmap_decoder
197 :
public rle_decoder< char, file_input_buffer, OutputBuffer >
201 typedef OutputBuffer output_buffer_type;
205 output_buffer_type& output );
210 rle_bitmap_decoder< rle_bitmap_output_buffer<true> > rle4_decoder;
213 typedef rle_bitmap_decoder< rle_bitmap_output_buffer<false> >
219 class pixel1_to_pixel32
222 void operator()(
scanline& dest,
const char* src,
229 class pixel4_to_pixel32
232 void operator()(
scanline& dest,
const char* src,
239 class pixel8_to_pixel32
242 void operator()(
scanline& dest,
const char* src,
249 class pixel24_to_pixel32
252 void operator()(
scanline& dest,
const char* src,
260 void load( std::istream& f );
263 void load_palette(
const header& h, std::istream& f,
266 void load_1bpp(
const header& h, std::istream& f );
267 void load_4bpp(
const header& h, std::istream& f );
268 void load_8bpp(
const header& h, std::istream& f );
269 void load_24bpp(
const header& h, std::istream& f );
271 void load_4bpp_rle(
const header& h, std::istream& f,
273 void load_4bpp_rgb(
const header& h, std::istream& f,
275 void load_8bpp_rle(
const header& h, std::istream& f,
277 void load_8bpp_rgb(
const header& h, std::istream& f,
280 template<
typename Convert>
281 void load_rgb_data( std::istream& f,
unsigned int buffer_size,
283 const Convert& pixel_convert );
302 void save( std::ostream& f )
const;
305 void save_data( std::ostream& f )
const;
307 void pixel32_to_pixel24(
char* dest,
const scanline& src )
const;
309 void init_header(
header& h )
const;
313 const image& m_image;
318 bitmap(
unsigned int w,
unsigned int h );
320 bitmap( std::istream& f );
322 void save( std::ostream& f )
const;
330 #endif // __CLAW_BITMAP_HPP__