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.

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.

Read next row of the RGB image. 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.

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, ...