pub struct PdfPageImageObject<'a> { /* private fields */ }
Expand description

A single PdfPageObject of type PdfPageObjectType::Image. The page object defines a single bitmapped image.

Page objects can be created either attached to a PdfPage (in which case the page object’s memory is owned by the containing page) or detached from any page (in which case the page object’s memory is owned by the object). Page objects are not rendered until they are attached to a page; page objects that are never attached to a page will be lost when they fall out of scope.

The simplest way to create a page image object that is immediately attached to a page is to call the PdfPageObjects::create_image_object() function.

Creating a detached page image object offers more scope for customization, but you must add the object to a containing PdfPage manually. To create a detached page image object, use the PdfPageImageObject::new() function. The detached page image object can later be attached to a page by using the PdfPageObjects::add_image_object() function.

Implementations

Creates a new PdfPageImageObject from the given arguments. The returned page object will not be rendered until it is added to a PdfPage using the PdfPageObjects::add_image_object() function.

The returned page object will have its width and height both set to 1.0 points. Use the PdfPageObjectCommon::scale() function to apply a horizontal and vertical scale to the object after it is created, or use one of the PdfPageImageObject::new_with_width(), PdfPageImageObject::new_with_height(), or PdfPageImageObject::new_with_size() functions to scale the page object to a specific width and/or height at the time the object is created.

Creates a new PdfPageImageObject from the given arguments. The page object will be scaled horizontally to match the given width; its height will be adjusted to maintain the aspect ratio of the given image. The returned page object will not be rendered until it is added to a PdfPage using the PdfPageObjects::add_image_object() function.

Creates a new PdfPageImageObject from the given arguments. The page object will be scaled vertically to match the given height; its width will be adjusted to maintain the aspect ratio of the given image. The returned page object will not be rendered until it is added to a PdfPage using the PdfPageObjects::add_image_object() function.

Creates a new PdfPageImageObject from the given arguments. The page object will be scaled to match the given width and height. The returned page object will not be rendered until it is added to a PdfPage using the PdfPageObjects::add_image_object() function.

Returns a new Image::DynamicImage created from the bitmap buffer backing this PdfPageImageObject, ignoring any image filters, image mask, or object transforms applied to this page object.

Returns a new Image::DynamicImage created from the bitmap buffer backing this PdfPageImageObject, taking into account any image filters, image mask, and object transforms applied to this page object.

Applies the byte data in the given Image::DynamicImage to this PdfPageImageObject.

Applies the byte data in the given PdfBitmap to this PdfPageImageObject.

Returns the horizontal dots per inch resolution of the image assigned to this PdfPageImageObject, based on the intrinsic resolution of the assigned image and the dimensions of this object.

Returns the vertical dots per inch resolution of the image assigned to this PdfPageImageObject, based on the intrinsic resolution of the assigned image and the dimensions of this object.

Returns the bits per pixel for the image assigned to this PdfPageImageObject.

This value is not available if this object has not been attached to a PdfPage.

Returns the color space for the image assigned to this PdfPageImageObject.

This value is not available if this object has not been attached to a PdfPage.

Returns the collection of image filters currently applied to this PdfPageImageObject.

Trait Implementations

Converts to this type from the input type.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

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

Returns true if this PdfPageObject contains transparency.
Returns the bounding box of this PdfPageObject. Read more
Applies the given transformation, expressed as six values representing the six configurable elements of a nine-element 3x3 PDF transformation matrix, to this PdfPageObject. Read more
Transforms this PdfPageObject by applying the transformation matrix read from the given PdfPageObject. Read more
Returns the current horizontal translation of the origin of this PdfPageObject.
Returns the current vertical translation of the origin of this PdfPageObject.
Returns the current horizontal scale factor applied to this PdfPageObject.
Returns the current vertical scale factor applied to this PdfPageObject.
Returns the counter-clockwise rotation applied to this PdfPageObject, in radians. Read more
Returns the current x axis skew applied to this PdfPageObject, in radians. Read more
Returns the current y axis skew applied to this PdfPageObject, in radians. Read more
Sets the blend mode that will be applied when painting this PdfPageObject. Read more
Returns the color of any filled paths in this PdfPageObject.
Sets the color of any filled paths in this PdfPageObject.
Returns the color of any stroked lines in this PdfPageObject.
Sets the color of any stroked lines in this PdfPageObject. Read more
Returns the width of any stroked lines in this PdfPageObject.
Sets the width of any stroked lines in this PdfPageObject. Read more
Returns the line join style that will be used when painting stroked path segments in this PdfPageObject. Read more
Sets the line join style that will be used when painting stroked path segments in this PdfPageObject. Read more
Returns the line cap style that will be used when painting stroked path segments in this PdfPageObject. Read more
Sets the line cap style that will be used when painting stroked path segments in this PdfPageObject. Read more
Returns the width of this PdfPageObject.
Returns the height of this PdfPageObject.
Returns true if the bounds of this PdfPageObject lie entirely within the given rectangle.
Returns true if the bounds of this PdfPageObject lie at least partially within the given rectangle. Read more
Moves the origin of this PdfPageObject by the given horizontal and vertical delta distances.
Returns the current horizontal and vertical translation of the origin of this PdfPageObject.
Changes the size of this PdfPageObject, scaling it by the given horizontal and vertical scale factors. Read more
Flips this PdfPageObject horizontally around its origin by applying a horizontal scale factor of -1.
Flips this PdfPageObject vertically around its origin by applying a vertical scale factor of -1.
Reflects this PdfPageObject by flipping it both horizontally and vertically around its origin.
Returns the current horizontal and vertical scale factors applied to this PdfPageObject.
Rotates this PdfPageObject counter-clockwise by the given number of degrees.
Returns the counter-clockwise rotation applied to this PdfPageObject, in degrees. Read more
Rotates this PdfPageObject clockwise by the given number of degrees.
Returns the clockwise rotation applied to this PdfPageObject, in degrees. Read more
Rotates this PdfPageObject counter-clockwise by the given number of radians.
Rotates this PdfPageObject clockwise by the given number of radians.
Returns the clockwise rotation applied to this PdfPageObject, in radians. Read more
Skews the axes of this PdfPageObject by the given angles in degrees.
Returns the current x axis and y axis skew angles applied to this PdfPageObject, in degrees. Read more
Returns the current x axis skew angle applied to this PdfPageObject, in degrees. Read more
Returns the current y axis skew applied to this PdfPageObject, in degrees. Read more
Skews the axes of this PdfPageObject by the given angles in radians.
Returns the current x axis and y axis skew angles applied to this PdfPageObject, in radians. Read more
The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.