[][src]Struct printpdf::types::plugins::graphics::xobject::ImageXObject

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 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>

Compression filter used for this image

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

Methods

impl<'a> ImageXObject[src]

pub fn new(
    width: Px,
    height: Px,
    color_space: ColorSpace,
    bits: ColorBits,
    interpolate: bool,
    image_filter: Option<ImageFilter>,
    bbox: Option<CurTransMat>,
    data: Vec<u8>
) -> Self
[src]

Creates a new ImageXObject

pub fn try_from<T: ImageDecoder<'a>>(image: T) -> Result<Self, ImageError>[src]

pub fn from_dynamic_image(image: &DynamicImage) -> Self[src]

Trait Implementations

impl Clone for ImageXObject[src]

impl Debug for ImageXObject[src]

impl From<ImageXObject> for Image[src]

impl Into<Stream> for ImageXObject[src]

Auto Trait Implementations

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> SetParameter for T

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

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

The type returned in the event of a conversion error.