Go to the documentation of this file.
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;
369 #include <claw/impl/pcx_writer.tpp>
370 #include <claw/impl/pcx_reader.tpp>
372 #endif // __CLAW_PCX_HPP__
A class to help decoding run-length encoded (RLE) streams.
A class to help run-length encoding (RLE) streams.
rle_encoder< file_output_buffer > rle_pcx_encoder
RLE encoder for pcx format.
Fuction object to get the first element of a std::pair.
This class read data from a pcx file and store it in an image.
Some classes for the raw manipulation of the base types.
reader(image &img)
Constructor.
unsigned int max_encodable() const
Get the maximum number of pixel a code can encode.
Define the type of an unsigned integer stored with a given number of bits. Template parameters.
This is the main namespace.
pcx(unsigned int w, unsigned int h)
Constructor. Creates an empty image.
This class is made to help reading istreams with a buffer.
unsigned int min_interesting() const
Get the minimum number of pixels needed for encoding.
A palette of colors, for palettized images.
A palette of color, for palettized images.
The type of the output buffer associated with the file when encoding RLE data.
find_type_by_size< Size, signed_integers >::type type
The integer type that matches the given size.
void fill(const math::rectangle< int > r, const pixel_type &c)
Fill an area of the image with a given color.
u_int_8 pattern_type
The typ of the output patterns.
A class to deal with images.
A class to help decoding run-length encoded (RLE) streams.
void encode(unsigned int n, pattern_type pattern)
Encode a pixel data.
A class to deal with images.
A class for pcx pictures.
A class to help run-length encoding (RLE) streams.
void save(std::ostream &os) const
Save the content of the image in a stream.
This class write an image in a pcx file.
writer(const image &img)
Constructor.
void save(std::ostream &os) const
Save the content of the image in a stream.
void load(std::istream &f)
Load an image from a pcx file.
file_output_buffer(std::ostream &os)
Constructor.