Struct xcf::Xcf

source ·
pub struct Xcf {
    pub header: XcfHeader,
    pub layers: Vec<Layer>,
}

Fields§

§header: XcfHeader§layers: Vec<Layer>

List of layers in the XCF file, in the order they are stored in the file. (I believe this is top layer to bottom layer)

See Xcf::layer to get a layer by name.

Implementations§

source§

impl Xcf

A GIMP XCF file.

If you need to access multiple layers at once, access layers field and use split_at.

source

pub fn open<P: AsRef<Path>>(p: P) -> Result<Xcf, Error>

Open an XCF file at the path specified.

source

pub fn load<R: Read + Seek>(rdr: R) -> Result<Xcf, Error>

Read an XCF file from a Reader.

source

pub fn width(&self) -> u32

Get the width of the canvas.

source

pub fn height(&self) -> u32

Get the height of the canvas.

source

pub fn dimensions(&self) -> (u32, u32)

source

pub fn layer(&self, name: &str) -> Option<&Layer>

Get a reference to a layer by name.

source

pub fn layer_mut(&mut self, name: &str) -> Option<&mut Layer>

Get a mutable reference to a layer by name.

Trait Implementations§

source§

impl Debug for Xcf

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for Xcf

§

impl Send for Xcf

§

impl Sync for Xcf

§

impl Unpin for Xcf

§

impl UnwindSafe for Xcf

Blanket Implementations§

source§

impl<T> Any for Twhere T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

const: unstable · source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> From<T> for T

const: unstable · source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for Twhere U: From<T>,

const: unstable · source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
const: unstable · source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
const: unstable · source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.