pub fn v_concat<I, P, S>(images: &[I]) -> Result<ImageBuffer<P, Vec<S>>>
    where
        I: GenericImageView<Pixel = P>,
        P: Pixel<Subpixel = S> + 'static,
        S: Primitive + 'static,
    {
        // The height is the sum of all images height.
        let img_height_out: u32 = images.iter().map(image::GenericImageView::height).sum();

        // The final width is the maximum width from the input images.
        let img_width_out: u32 = images
            .iter()
            .map(image::GenericImageView::width)
            .max()
            .unwrap_or(0);

        // Initialize an image buffer with the appropriate size.
        let mut imgbuf = image::ImageBuffer::new(img_width_out, img_height_out);
        let mut accumulated_height = 0;

        // Copy each input image at the correct location in the output image.
        for img in images {
            imgbuf.copy_from(img, (img_width_out - img.width()) / 2, accumulated_height)?;
            accumulated_height += img.height();
        }

        Ok(imgbuf)
    }
/// Concatenates a collection of images vertically.
///
/// This allows the program to draw individual lines at a time
/// and stitch them together vertically.
///
/// # Errors
/// Returns an [`ImageError`] if the image cannot be copied to the buffer.
///
/// [`ImageError`]: image::error::ImageError
Concatenates a collection of images vertically.
This allows the program to draw individual lines at a time
and stitch them together vertically.
Concatenates a collection of images vertically . This allows the program to draw individual lines at a time and stitch them together vertically .
pub fn v_concat<I, P, S>(images: &[I]) -> Result<ImageBuffer<P, Vec<S>>>
    where
        I: GenericImageView<Pixel = P>,
        P: Pixel<Subpixel = S> + 'static,
        S: Primitive + 'static,
    {
        // The height is the sum of all images height.
        let img_height_out: u32 = images.iter().map(image::GenericImageView::height).sum();
        // The final width is the maximum width from the input images.
        let img_width_out: u32 = images
            .iter()
            .map(image::GenericImageView::width)
            .max()
            .unwrap_or(0);
        // Initialize an image buffer with the appropriate size.
        let mut imgbuf = image::ImageBuffer::new(img_width_out, img_height_out);
        let mut accumulated_height = 0;
        // Copy each input image at the correct location in the output image.
        for img in images {
            imgbuf.copy_from(img, (img_width_out - img.width()) / 2, accumulated_height)?;
            accumulated_height += img.height();
        }
        Ok(imgbuf)
    }
pub fn v_concat < I , P , S > ( images : & [ I ] ) -> Result < ImageBuffer < P , Vec < S > > > where I : GenericImageView < Pixel = P > , P : Pixel < Subpixel = S > + ' static , S : Primitive + ' static , { // The height is the sum of all images height. let img_height_out : u32 = images . iter ( ) . map ( image :: GenericImageView :: height ) . sum ( ) ; // The final width is the maximum width from the input images. let img_width_out : u32 = images . iter ( ) . map ( image :: GenericImageView :: width ) . max ( ) . unwrap_or ( 0 ) ; // Initialize an image buffer with the appropriate size. let mut imgbuf = image :: ImageBuffer :: new ( img_width_out , img_height_out ) ; let mut accumulated_height = 0 ; // Copy each input image at the correct location in the output image. for img in images { imgbuf . copy_from ( img , ( img_width_out - img . width ( ) ) / 2 , accumulated_height ) ? ; accumulated_height += img . height ( ) ; } Ok ( imgbuf ) }
Concatenates a collection of images vertically.
Concatenates a collection of images vertically .
images
&[I]
images
&[I]
errors
Returns an [`ImageError`] if the image cannot be copied to the buffer.

[`ImageError`]: image::error::ImageError
Returns an [ ` ImageError ` ] if the image cannot be copied to the buffer . [ ` ImageError ` ] : image :: error :: ImageError