Struct pcx::WriterRgb [−][src]
pub struct WriterRgb<W: Write> { /* fields omitted */ }
Create 24-bit RGB PCX image.
Methods
impl WriterRgb<BufWriter<File>>
[src]
impl WriterRgb<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> WriterRgb<W>
[src]
impl<W: Write> WriterRgb<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_from_separate(
&mut self,
r: &[u8],
g: &[u8],
b: &[u8]
) -> Result<()>
[src]
pub fn write_row_from_separate(
&mut self,
r: &[u8],
g: &[u8],
b: &[u8]
) -> Result<()>
Write next row of pixels from separate buffers for R, G and B channels.
Length of each of r
, g
and b
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_row(&mut self, rgb: &[u8]) -> Result<()>
[src]
pub fn write_row(&mut self, rgb: &[u8]) -> Result<()>
Write next row of pixels from buffer which contains RGB values interleaved (i.e. R, G, B, R, G, B, ...).
Length of the rgb
buffer must be equal to the width of the image passed to new
multiplied by 3.
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 finish(self) -> Result<()>
[src]
pub fn finish(self) -> Result<()>
Flush all data and finish writing.
If you simply drop WriterRgb
it will also flush everything but this function is preferable because errors won't be ignored.
Trait Implementations
impl<W: Clone + Write> Clone for WriterRgb<W>
[src]
impl<W: Clone + Write> Clone for WriterRgb<W>
fn clone(&self) -> WriterRgb<W>
[src]
fn clone(&self) -> WriterRgb<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 WriterRgb<W>
[src]
impl<W: Debug + Write> Debug for WriterRgb<W>
fn fmt(&self, f: &mut Formatter) -> Result
[src]
fn fmt(&self, f: &mut Formatter) -> Result
Formats the value using the given formatter. Read more
impl<W: Write> Drop for WriterRgb<W>
[src]
impl<W: Write> Drop for WriterRgb<W>