Struct lodepng::ffi::Info [−][src]
#[repr(C)]pub struct Info { pub compression_method: c_uint, pub filter_method: c_uint, pub interlace_method: c_uint, pub color: ColorMode, pub background_defined: c_uint, pub background_r: c_uint, pub background_g: c_uint, pub background_b: c_uint, pub time_defined: c_uint, pub time: Time, pub phys_defined: c_uint, pub phys_x: c_uint, pub phys_y: c_uint, pub phys_unit: c_uint, pub unknown_chunks_data: [*mut c_uchar; 3], pub unknown_chunks_size: [usize; 3], // some fields omitted }
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]
impl Info
pub fn new() -> Self
[src]
pub fn new() -> Self
pub fn text_keys_cstr(&self) -> TextKeysCStrIter
[src]
pub fn text_keys_cstr(&self) -> TextKeysCStrIter
pub fn itext_keys(&self) -> ITextKeysIter
[src]
pub fn itext_keys(&self) -> ITextKeysIter
pub fn clear_text(&mut self)
[src]
pub fn clear_text(&mut self)
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]
pub fn add_text(&mut self, key: &str, str: &str) -> Result<(), Error>
push back both texts at once
pub fn clear_itext(&mut self)
[src]
pub fn clear_itext(&mut self)
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]
pub fn add_itext(
&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]
pub fn append_chunk(
&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]
pub fn create_chunk<C: AsRef<[u8]>>(
&mut self,
position: ChunkPosition,
chtype: C,
data: &[u8]
) -> Result<(), Error>
pub fn get<Name: AsRef<[u8]>>(&self, index: Name) -> Option<ChunkRef>
[src]
pub fn get<Name: AsRef<[u8]>>(&self, index: Name) -> Option<ChunkRef>
pub fn unknown_chunks(&self, position: ChunkPosition) -> ChunksIter
[src]
pub fn unknown_chunks(&self, position: ChunkPosition) -> ChunksIter