pub struct ImageDisplay { /* private fields */ }Expand description
Displays images in the terminal with ASCII fallback support.
Provides terminal rendering of images with:
- Metadata display (format, size, dimensions)
- ASCII placeholder for unsupported terminals
- Automatic resizing to fit terminal bounds (max 80x30)
- Multi-image support with vertical organization
Implementations§
Source§impl ImageDisplay
impl ImageDisplay
Sourcepub fn with_config(config: DisplayConfig) -> Self
pub fn with_config(config: DisplayConfig) -> Self
Create a new image display with custom configuration.
Sourcepub fn render_image(&self, metadata: &ImageMetadata) -> ImageResult<String>
pub fn render_image(&self, metadata: &ImageMetadata) -> ImageResult<String>
Sourcepub fn calculate_resized_dimensions(
&self,
original_width: u32,
original_height: u32,
) -> (u32, u32)
pub fn calculate_resized_dimensions( &self, original_width: u32, original_height: u32, ) -> (u32, u32)
Sourcepub fn verify_metadata_present(
&self,
display_output: &str,
metadata: &ImageMetadata,
) -> ImageResult<bool>
pub fn verify_metadata_present( &self, display_output: &str, metadata: &ImageMetadata, ) -> ImageResult<bool>
Sourcepub fn verify_fits_in_terminal(&self, display_output: &str) -> ImageResult<bool>
pub fn verify_fits_in_terminal(&self, display_output: &str) -> ImageResult<bool>
Sourcepub fn render_multiple_images(
&self,
metadata_list: &[ImageMetadata],
) -> ImageResult<String>
pub fn render_multiple_images( &self, metadata_list: &[ImageMetadata], ) -> ImageResult<String>
Sourcepub fn verify_multiple_images_organized(
&self,
display_output: &str,
metadata_list: &[ImageMetadata],
) -> ImageResult<bool>
pub fn verify_multiple_images_organized( &self, display_output: &str, metadata_list: &[ImageMetadata], ) -> ImageResult<bool>
Trait Implementations§
Auto Trait Implementations§
impl Freeze for ImageDisplay
impl RefUnwindSafe for ImageDisplay
impl Send for ImageDisplay
impl Sync for ImageDisplay
impl Unpin for ImageDisplay
impl UnwindSafe for ImageDisplay
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 moreSource§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<R, P> ReadPrimitive<R> for P
impl<R, P> ReadPrimitive<R> for P
Source§fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
fn read_from_little_endian(read: &mut R) -> Result<Self, Error>
Read this value from the supplied reader. Same as
ReadEndian::read_from_little_endian().