[−][src]Struct lodepng::ffi::Info
Information about the PNG image, except pixels, width and height
Fields
compression_method: c_uint
compression method of the original file. Always 0.
filter_method: c_uint
filter method of the original file
interlace_method: c_uint
interlace method of the original file
color: ColorMode
color type and bits, palette and transparency of the PNG file
background_defined: c_uint
suggested background color chunk (bKGD) This color uses the same color mode as the PNG (except alpha channel), which can be 1-bit to 16-bit.
For greyscale PNGs, r, g and b will all 3 be set to the same. When encoding the encoder writes the red one. For palette PNGs: When decoding, the RGB value will be stored, not a palette index. But when encoding, specify the index of the palette in background_r, the other two are then ignored.
The decoder does not use this background color to edit the color of pixels.
background_r: c_uint
red component of suggested background color
background_g: c_uint
green component of suggested background color
background_b: c_uint
blue component of suggested background color
time_defined: c_uint
set to 1 to make the encoder generate a tIME chunk
time: Time
time chunk (tIME)
phys_defined: c_uint
if 0, there is no pHYs chunk and the values below are undefined, if 1 else there is one
phys_x: c_uint
pixels per unit in x direction
phys_y: c_uint
pixels per unit in y direction
phys_unit: c_uint
may be 0 (unknown unit) or 1 (metre)
unknown_chunks_data: [*mut c_uchar; 3]
unknown chunks
There are 3 buffers, one for each position in the PNG where unknown chunks can appear
each buffer contains all unknown chunks for that position consecutively
The 3 buffers are the unknown chunks between certain critical chunks:
0: IHDR-PLTE
, 1: PLTE
-IDAT, 2: IDAT-IEND
Do not allocate or traverse this data yourself. Use the chunk traversing functions declared
later, such as lodepng_chunk_next and lodepng_chunk_append, to read/write this struct.
unknown_chunks_size: [usize; 3]
Methods
impl Info
[src]
pub fn new() -> Self
[src]
pub fn text_keys_cstr(&self) -> TextKeysCStrIter
[src]
pub fn itext_keys(&self) -> ITextKeysIter
[src]
pub fn clear_text(&mut self)
[src]
use this to clear the texts again after you filled them in
pub fn add_text(&mut self, key: &str, str: &str) -> Result<(), Error>
[src]
push back both texts at once
pub fn clear_itext(&mut self)
[src]
use this to clear the itexts again after you filled them in
pub fn add_itext(
&mut self,
key: &str,
langtag: &str,
transkey: &str,
text: &str
) -> Result<(), Error>
[src]
&mut self,
key: &str,
langtag: &str,
transkey: &str,
text: &str
) -> Result<(), Error>
push back the 4 texts of 1 chunk at once
pub fn append_chunk(
&mut self,
position: ChunkPosition,
chunk: ChunkRef
) -> Result<(), Error>
[src]
&mut self,
position: ChunkPosition,
chunk: ChunkRef
) -> Result<(), Error>
pub fn create_chunk<C: AsRef<[u8]>>(
&mut self,
position: ChunkPosition,
chtype: C,
data: &[u8]
) -> Result<(), Error>
[src]
&mut self,
position: ChunkPosition,
chtype: C,
data: &[u8]
) -> Result<(), Error>
pub fn get<Name: AsRef<[u8]>>(&self, index: Name) -> Option<ChunkRef>
[src]
pub fn unknown_chunks(&self, position: ChunkPosition) -> ChunksIter
[src]
Trait Implementations
impl Drop for Info
[src]
impl Clone for Info
[src]
fn clone(&self) -> Self
[src]
fn clone_from(&mut self, source: &Self)
1.0.0[src]
Performs copy-assignment from source
. Read more
impl Debug for Info
[src]
Auto Trait Implementations
impl !Send for Info
impl Unpin for Info
impl !Sync for Info
impl UnwindSafe for Info
impl RefUnwindSafe for Info
Blanket Implementations
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
fn to_owned(&self) -> T
[src]
fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,
type Error = <U as TryFrom<T>>::Error
The type returned in the event of a conversion error.
fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>
[src]
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,