Struct printpdf::ImageXObject
source · pub struct ImageXObject {
pub width: Px,
pub height: Px,
pub color_space: ColorSpace,
pub bits_per_component: ColorBits,
pub interpolate: bool,
pub image_data: Vec<u8>,
pub image_filter: Option<ImageFilter>,
pub smask: Option<SMask>,
pub clipping_bbox: Option<CurTransMat>,
}
Fields§
§width: Px
Width of the image (original width, not scaled width)
height: Px
Height of the image (original height, not scaled height)
color_space: ColorSpace
Color space (Greyscale, RGB, CMYK)
bits_per_component: ColorBits
Bits per color component (1, 2, 4, 8, 16) - 1 for black/white, 8 Greyscale / RGB, etc. If using a JPXDecode filter (for JPEG images), this can be inferred from the image data
interpolate: bool
Should the image be interpolated when scaled?
image_data: Vec<u8>
The actual data from the image
image_filter: Option<ImageFilter>
Decompression filter for image_data
, if None
assumes uncompressed raw pixels in the expected color format.
smask: Option<SMask>
§clipping_bbox: Option<CurTransMat>
Required bounds to clip the image, in unit space
Default value: Identity matrix ([1 0 0 1 0 0]
) - used when value is None
Implementations§
source§impl ImageXObject
impl ImageXObject
pub fn try_from<'a, T: ImageDecoder<'a>>(image: T) -> Result<Self, ImageError>
pub fn from_dynamic_image(image: &DynamicImage) -> Self
Trait Implementations§
source§impl Clone for ImageXObject
impl Clone for ImageXObject
source§fn clone(&self) -> ImageXObject
fn clone(&self) -> ImageXObject
Returns a copy of the value. Read more
1.0.0 · source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source
. Read moresource§impl Debug for ImageXObject
impl Debug for ImageXObject
source§impl From<ImageXObject> for Image
impl From<ImageXObject> for Image
source§fn from(image: ImageXObject) -> Self
fn from(image: ImageXObject) -> Self
Converts to this type from the input type.
source§impl From<ImageXObject> for Stream
impl From<ImageXObject> for Stream
source§fn from(img: ImageXObject) -> Stream
fn from(img: ImageXObject) -> Stream
Converts to this type from the input type.
source§impl From<ImageXObject> for XObject
impl From<ImageXObject> for XObject
source§fn from(i: ImageXObject) -> XObject
fn from(i: ImageXObject) -> XObject
Converts to this type from the input type.
Auto Trait Implementations§
impl RefUnwindSafe for ImageXObject
impl Send for ImageXObject
impl Sync for ImageXObject
impl Unpin for ImageXObject
impl UnwindSafe for ImageXObject
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