30 #ifndef __CLAW_PCX_HPP__
31 #define __CLAW_PCX_HPP__
62 v_2_8_with_palette = 2,
63 v_2_8_without_palette = 3,
68 # pragma pack (push,1)
106 u_int_16 horizontal_dpi;
109 u_int_16 vertical_dpi;
118 u_int_8 color_planes;
122 u_int_16 bytes_per_line;
125 u_int_16 palette_info;
149 typedef std::vector<u_int_8> color_plane_type;
172 class rle_pcx_output_buffer
175 rle_pcx_output_buffer( color_plane_type& result );
177 void fill(
unsigned int n, u_int_8 pattern );
180 bool completed()
const;
184 color_plane_type& m_result;
187 unsigned int m_position;
195 class rle_pcx_decoder
197 rle_pcx_input_buffer,
198 rle_pcx_output_buffer >
202 read_mode( input_buffer_type& input, output_buffer_type& output );
216 unsigned int y )
const;
227 converter_16(
const header& h );
230 unsigned int y )
const;
234 const header& m_header;
249 unsigned int y )
const;
262 class converter_true_color
267 unsigned int y )
const;
275 void load( std::istream& f );
278 void check_if_pcx(
const header& h )
const;
280 void load_mono(
const header& h, std::istream& f );
281 void load_16_color_mapped(
const header& h, std::istream& f );
282 void load_true_color(
const header& h, std::istream& f );
283 void load_256_color_mapped(
const header& h, std::istream& f );
286 decompress_line( std::istream& f, color_plane_type&
scanline )
const;
288 template<
typename Converter>
290 (
const header& h, std::istream& f,
const Converter& convert );
321 template<
typename Iterator>
322 void raw( Iterator
first, Iterator last );
329 std::ostream& m_stream;
344 void save( std::ostream& os )
const;
348 ( std::ostream& os,
unsigned int bytes_per_line )
const;
349 void save_rle_true_color
350 ( std::ostream& os,
unsigned int bytes_per_line )
const;
354 const image& m_image;
359 pcx(
unsigned int w,
unsigned int h );
361 pcx( std::istream& f );
363 void save( std::ostream& os )
const;
372 #endif // __CLAW_PCX_HPP__