Struct pcx::Reader[][src]

pub struct Reader<R: Read> {
    pub header: Header,
    // some fields omitted
}

PCX file reader.

Fields

File header. All useful values are available via Reader methods so you don't actually need it.

Methods

impl Reader<BufReader<File>>
[src]

Start reading PCX file.

impl<R: Read> Reader<R>
[src]

Start reading PCX file.

Get width and height of the image.

The width of this image.

The height of this image.

Whether this image is paletted or 24-bit RGB.

Get number of colors in the palette if this image is paletted. Number of colors is either 2, 4, 8, 16 or 256.

Read next row of the paletted image. Check that is_paletted() is true before calling this function.

buffer length must be equal to the image width.

Order of rows is from top to bottom, order of pixels is from left to right.

Read next row of the RGB image to separate R, G and B buffers. Check that is_paletted() is false before calling this function.

r, g, b buffer lengths must be equal to the image width.

Order of rows is from top to bottom, order of pixels is from left to right.

Read next row of the RGB image to one buffer with interleaved RGB values. Check that is_paletted() is false before calling this function.

rgb buffer length must be equal to the image width multiplied by 3.

Order of rows is from top to bottom, order of pixels is from left to right.

Read color palette.

If palette contains 256-colors then it is stored at the end of file and this function will read the file to the end.

Returns number of colors in palette or zero if there is no palette. The actual number of bytes written to the output buffer is equal to the returned value multiplied by 3. Format of the output buffer is R, G, B, R, G, B, ...

Trait Implementations

impl<R: Clone + Read> Clone for Reader<R>
[src]

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

impl<R: Debug + Read> Debug for Reader<R>
[src]

Formats the value using the given formatter. Read more

Auto Trait Implementations

impl<R> Send for Reader<R> where
    R: Send

impl<R> Sync for Reader<R> where
    R: Sync