pub struct PsdWriter {
psd: PsdFile,
color_type: ImageColorType,
compress: bool,
zlib_compression_level: u32,
encoding: Encoding,
}Available on crate feature
utils-psd only.Expand description
A simple PSD writer.
Fields§
§psd: PsdFile§color_type: ImageColorType§compress: bool§zlib_compression_level: u32§encoding: EncodingImplementations§
Source§impl PsdWriter
impl PsdWriter
Sourcepub fn new(
width: u32,
height: u32,
color_type: ImageColorType,
depth: u8,
encoding: Encoding,
) -> Result<Self>
pub fn new( width: u32, height: u32, color_type: ImageColorType, depth: u8, encoding: Encoding, ) -> Result<Self>
Creates a new PSD writer with the specified dimensions, color type, and bit depth.
Sourcepub fn compress(self, compress: bool) -> Self
pub fn compress(self, compress: bool) -> Self
Sets whether to compress image data in the PSD file.
Sourcepub fn zlib_compression_level(self, level: u32) -> Self
pub fn zlib_compression_level(self, level: u32) -> Self
Sets the zlib compression level for the PSD file.
Sourcepub fn add_layer(
&mut self,
name: &str,
x: u32,
y: u32,
data: ImageData,
option: Option<PsdLayerOption>,
) -> Result<()>
pub fn add_layer( &mut self, name: &str, x: u32, y: u32, data: ImageData, option: Option<PsdLayerOption>, ) -> Result<()>
Add a layer to the PSD file.
name- The name of the layer.x- The x position of the layer.y- The y position of the layer.data- The image data of the layer.option- The options for the layer.
Sourcepub fn add_layer_group(
&mut self,
name: &str,
is_closed: bool,
option: Option<PsdLayerOption>,
) -> Result<()>
pub fn add_layer_group( &mut self, name: &str, is_closed: bool, option: Option<PsdLayerOption>, ) -> Result<()>
Adds the start of a layer group to the PSD file.
Sourcepub fn add_layer_group_end(&mut self) -> Result<()>
pub fn add_layer_group_end(&mut self) -> Result<()>
Adds the end of a layer group to the PSD file.
Auto Trait Implementations§
impl Freeze for PsdWriter
impl RefUnwindSafe for PsdWriter
impl Send for PsdWriter
impl Sync for PsdWriter
impl Unpin for PsdWriter
impl UnwindSafe for PsdWriter
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more