The output buffer for the RLE decoder. More...
Public Member Functions | |
rle_targa_output_buffer (image &img, bool up_down, bool left_right) | |
Constructor. | |
void | fill (unsigned int n, rgba_pixel_8 pattern) |
Copy a pixel a certain number of times. | |
void | copy (unsigned int n, input_buffer_type &buffer) |
Direct copy of a certain number of pixels from the file. | |
bool | completed () const |
Tell if we have completely filled the image. | |
Private Types | |
typedef rgba_pixel_8 | pixel_type |
The type of he pixels in the input buffer. | |
typedef InputBuffer | input_buffer_type |
The type of the input buffer. | |
Private Member Functions | |
void | adjust_position (int x) |
Recalculate the position in the file. | |
Private Attributes | |
image & | m_image |
The targa image to fill. | |
unsigned int | m_x |
Current column index in the image. | |
unsigned int | m_y |
Current row index in the image. | |
const int | m_x_inc |
Horizontal increment. | |
const int | m_y_inc |
Vertical increment. |
The output buffer for the RLE decoder.
Template parameters
Definition at line 273 of file targa.hpp.
typedef InputBuffer claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::input_buffer_type [private] |
typedef rgba_pixel_8 claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::pixel_type [private] |
claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::rle_targa_output_buffer | ( | image & | img, |
bool | up_down, | ||
bool | left_right | ||
) |
Constructor.
img | The targa image we're loading. |
up_down | Tell if the image is stored from top to bottom. |
left_right | Tell if the image is stored from left to right. |
Definition at line 87 of file targa_reader.tpp.
References claw::graphic::image::height(), claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_image, claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_x, claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_y, and claw::graphic::image::width().
void claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::adjust_position | ( | int | x ) | [private] |
Recalculate the position in the file.
x | The x-coordinate where we stopped. |
If x is lower tha zero, the position is set at the end of the previous line ; if is greater or equal to the width of the image, the position is set at the begining of the next line ; otherwise the position is set to x.
Definition at line 168 of file targa_reader.tpp.
References claw::graphic::targa::reader::m_image, and claw::graphic::image::width().
bool claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::completed | ( | ) | const |
Tell if we have completely filled the image.
Definition at line 151 of file targa_reader.tpp.
References claw::graphic::image::height(), and claw::graphic::targa::reader::m_image.
void claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::copy | ( | unsigned int | n, |
input_buffer_type & | buffer | ||
) |
Direct copy of a certain number of pixels from the file.
n | The number of pixels to write. |
buffer | The buffer from which we read. |
Definition at line 131 of file targa_reader.tpp.
References claw::graphic::targa::reader::m_image, and claw::graphic::image::width().
void claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::fill | ( | unsigned int | n, |
rgba_pixel_8 | pattern | ||
) |
Copy a pixel a certain number of times.
n | The number of pixel to write. |
pattern | The pixel to copy. |
Definition at line 109 of file targa_reader.tpp.
References claw::graphic::targa::reader::m_image, and claw::graphic::image::width().
image& claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_image [private] |
The targa image to fill.
Definition at line 295 of file targa.hpp.
Referenced by claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::rle_targa_output_buffer().
unsigned int claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_x [private] |
Current column index in the image.
Definition at line 298 of file targa.hpp.
Referenced by claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::rle_targa_output_buffer().
const int claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_x_inc [private] |
unsigned int claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_y [private] |
Current row index in the image.
Definition at line 301 of file targa.hpp.
Referenced by claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::rle_targa_output_buffer().
const int claw::graphic::targa::reader::rle_targa_output_buffer< InputBuffer >::m_y_inc [private] |