Struct pcx::WriterPaletted [−][src]
pub struct WriterPaletted<W: Write> { /* fields omitted */ }
Create paletted PCX image.
Methods
impl WriterPaletted<BufWriter<File>>
[src]
impl WriterPaletted<BufWriter<File>>
pub fn create_file<P: AsRef<Path>>(
path: P,
image_size: (u16, u16),
dpi: (u16, u16)
) -> Result<Self>
[src]
pub fn create_file<P: AsRef<Path>>(
path: P,
image_size: (u16, u16),
dpi: (u16, u16)
) -> Result<Self>
Start writing PCX file. This function will create a file if it does not exist, and will overwrite it if it does.
If you are not sure what to pass to dpi
value just use something like (100, 100)
or (300, 300)
.
impl<W: Write> WriterPaletted<W>
[src]
impl<W: Write> WriterPaletted<W>
pub fn new(stream: W, image_size: (u16, u16), dpi: (u16, u16)) -> Result<Self>
[src]
pub fn new(stream: W, image_size: (u16, u16), dpi: (u16, u16)) -> Result<Self>
Create new PCX writer.
If you are not sure what to pass to dpi
value just use something like (100, 100)
or (300, 300)
.
pub fn write_row(&mut self, row: &[u8]) -> Result<()>
[src]
pub fn write_row(&mut self, row: &[u8]) -> Result<()>
Write next row of pixels.
Row length must be equal to the width of the image passed to new
.
This function must be called number of times equal to the height of the image.
Order of rows is from top to bottom, order of pixels is from left to right.
pub fn write_palette(self, palette: &[u8]) -> Result<()>
[src]
pub fn write_palette(self, palette: &[u8]) -> Result<()>
Since palette is written to the end of PCX file this function must be called only after writing all the pixels.
Palette length must be not larger than 256*3 = 768 bytes and be divisible by 3. Format is R, G, B, R, G, B, ...
Trait Implementations
impl<W: Clone + Write> Clone for WriterPaletted<W>
[src]
impl<W: Clone + Write> Clone for WriterPaletted<W>
fn clone(&self) -> WriterPaletted<W>
[src]
fn clone(&self) -> WriterPaletted<W>
Returns a copy of the value. Read more
fn clone_from(&mut self, source: &Self)
1.0.0[src]
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from source
. Read more
impl<W: Debug + Write> Debug for WriterPaletted<W>
[src]
impl<W: Debug + Write> Debug for WriterPaletted<W>
Auto Trait Implementations
impl<W> Send for WriterPaletted<W> where
W: Send,
impl<W> Send for WriterPaletted<W> where
W: Send,
impl<W> Sync for WriterPaletted<W> where
W: Sync,
impl<W> Sync for WriterPaletted<W> where
W: Sync,