#[non_exhaustive]pub enum DynamicImage { ImageLuma8(GrayImage), ImageLumaA8(GrayAlphaImage), ImageRgb8(RgbImage), ImageRgba8(RgbaImage), ImageLuma16(ImageBuffer<Luma<u16>,Vec<u16>>), ImageLumaA16(ImageBuffer<LumaA<u16>,Vec<u16>>), ImageRgb16(ImageBuffer<Rgb<u16>,Vec<u16>>), ImageRgba16(ImageBuffer<Rgba<u16>,Vec<u16>>), ImageRgb32F(Rgb32FImage), ImageRgba32F(Rgba32FImage),}
Expand description
A Dynamic Image
This represents amatrix ofpixels which areconvertible from and to anRGBArepresentation. More variants that adhere to these principles may get added in the future, inparticular to cover other combinations typically used.
§Usage
This type can act as a converter between specificImageBuffer
instances.
useimage::{DynamicImage, GrayImage, RgbImage};letrgb: RgbImage = RgbImage::new(10,10);letluma: GrayImage = DynamicImage::ImageRgb8(rgb).into_luma8();
§Design
There is no goal to provide an all-encompassing type with all possible memory layouts. Thiswould hardly be feasible as a simple enum, due to the sheer number of combinations of channelkinds, channel order, and bit depth. Rather, this type provides an opinionated selection withnormalized channel order which can store common pixel values without loss.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
ImageLuma8(GrayImage)
Each pixel in this image is 8-bit Luma
ImageLumaA8(GrayAlphaImage)
Each pixel in this image is 8-bit Luma with alpha
ImageRgb8(RgbImage)
Each pixel in this image is 8-bit Rgb
ImageRgba8(RgbaImage)
Each pixel in this image is 8-bit Rgb with alpha
ImageLuma16(ImageBuffer<Luma<u16>,Vec<u16>>)
Each pixel in this image is 16-bit Luma
ImageLumaA16(ImageBuffer<LumaA<u16>,Vec<u16>>)
Each pixel in this image is 16-bit Luma with alpha
ImageRgb16(ImageBuffer<Rgb<u16>,Vec<u16>>)
Each pixel in this image is 16-bit Rgb
ImageRgba16(ImageBuffer<Rgba<u16>,Vec<u16>>)
Each pixel in this image is 16-bit Rgb with alpha
ImageRgb32F(Rgb32FImage)
Each pixel in this image is 32-bit float Rgb
ImageRgba32F(Rgba32FImage)
Each pixel in this image is 32-bit float Rgb with alpha
Implementations§
Source§implDynamicImage
implDynamicImage
Sourcepub fnnew(w:u32, h:u32, color:ColorType) ->DynamicImage
pub fnnew(w:u32, h:u32, color:ColorType) ->DynamicImage
Creates a dynamic image backed by a buffer depending onthe color type given.
Sourcepub fnnew_luma8(w:u32, h:u32) ->DynamicImage
pub fnnew_luma8(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of gray pixels.
Sourcepub fnnew_luma_a8(w:u32, h:u32) ->DynamicImage
pub fnnew_luma_a8(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of graypixels with transparency.
Sourcepub fnnew_rgb8(w:u32, h:u32) ->DynamicImage
pub fnnew_rgb8(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGB pixels.
Sourcepub fnnew_rgba8(w:u32, h:u32) ->DynamicImage
pub fnnew_rgba8(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGBA pixels.
Sourcepub fnnew_luma16(w:u32, h:u32) ->DynamicImage
pub fnnew_luma16(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of gray pixels.
Sourcepub fnnew_luma_a16(w:u32, h:u32) ->DynamicImage
pub fnnew_luma_a16(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of graypixels with transparency.
Sourcepub fnnew_rgb16(w:u32, h:u32) ->DynamicImage
pub fnnew_rgb16(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGB pixels.
Sourcepub fnnew_rgba16(w:u32, h:u32) ->DynamicImage
pub fnnew_rgba16(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGBA pixels.
Sourcepub fnnew_rgb32f(w:u32, h:u32) ->DynamicImage
pub fnnew_rgb32f(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGB pixels.
Sourcepub fnnew_rgba32f(w:u32, h:u32) ->DynamicImage
pub fnnew_rgba32f(w:u32, h:u32) ->DynamicImage
Creates a dynamic image backed by a buffer of RGBA pixels.
Sourcepub fnfrom_decoder(decoder: implImageDecoder) ->ImageResult<Self>
pub fnfrom_decoder(decoder: implImageDecoder) ->ImageResult<Self>
Decodes an encoded image into a dynamic image.
Sourcepub fnto_rgb16(&self) ->ImageBuffer<Rgb<u16>,Vec<u16>>
pub fnto_rgb16(&self) ->ImageBuffer<Rgb<u16>,Vec<u16>>
Returns a copy of this image as an RGB image.
Sourcepub fnto_rgb32f(&self) ->Rgb32FImage
pub fnto_rgb32f(&self) ->Rgb32FImage
Returns a copy of this image as an RGB image.
Sourcepub fnto_rgba16(&self) ->ImageBuffer<Rgba<u16>,Vec<u16>>
pub fnto_rgba16(&self) ->ImageBuffer<Rgba<u16>,Vec<u16>>
Returns a copy of this image as an RGBA image.
Sourcepub fnto_rgba32f(&self) ->Rgba32FImage
pub fnto_rgba32f(&self) ->Rgba32FImage
Returns a copy of this image as an RGBA image.
Sourcepub fnto_luma16(&self) ->ImageBuffer<Luma<u16>,Vec<u16>>
pub fnto_luma16(&self) ->ImageBuffer<Luma<u16>,Vec<u16>>
Returns a copy of this image as a Luma image.
Sourcepub fnto_luma32f(&self) ->ImageBuffer<Luma<f32>,Vec<f32>>
pub fnto_luma32f(&self) ->ImageBuffer<Luma<f32>,Vec<f32>>
Returns a copy of this image as a Luma image.
Sourcepub fnto_luma_alpha8(&self) ->GrayAlphaImage
pub fnto_luma_alpha8(&self) ->GrayAlphaImage
Returns a copy of this image as aLumaA
image.
Sourcepub fnto_luma_alpha16(&self) ->ImageBuffer<LumaA<u16>,Vec<u16>>
pub fnto_luma_alpha16(&self) ->ImageBuffer<LumaA<u16>,Vec<u16>>
Returns a copy of this image as aLumaA
image.
Sourcepub fnto_luma_alpha32f(&self) ->ImageBuffer<LumaA<f32>,Vec<f32>>
pub fnto_luma_alpha32f(&self) ->ImageBuffer<LumaA<f32>,Vec<f32>>
Returns a copy of this image as aLumaA
image.
Sourcepub fninto_rgb8(self) ->RgbImage
pub fninto_rgb8(self) ->RgbImage
Consume the image and returns a RGB image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_rgb16(self) ->ImageBuffer<Rgb<u16>,Vec<u16>>
pub fninto_rgb16(self) ->ImageBuffer<Rgb<u16>,Vec<u16>>
Consume the image and returns a RGB image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_rgb32f(self) ->Rgb32FImage
pub fninto_rgb32f(self) ->Rgb32FImage
Consume the image and returns a RGB image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_rgba8(self) ->RgbaImage
pub fninto_rgba8(self) ->RgbaImage
Consume the image and returns a RGBA image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_rgba16(self) ->ImageBuffer<Rgba<u16>,Vec<u16>>
pub fninto_rgba16(self) ->ImageBuffer<Rgba<u16>,Vec<u16>>
Consume the image and returns a RGBA image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_rgba32f(self) ->Rgba32FImage
pub fninto_rgba32f(self) ->Rgba32FImage
Consume the image and returns a RGBA image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_luma8(self) ->GrayImage
pub fninto_luma8(self) ->GrayImage
Consume the image and returns a Luma image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_luma16(self) ->ImageBuffer<Luma<u16>,Vec<u16>>
pub fninto_luma16(self) ->ImageBuffer<Luma<u16>,Vec<u16>>
Consume the image and returns a Luma image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_luma_alpha8(self) ->GrayAlphaImage
pub fninto_luma_alpha8(self) ->GrayAlphaImage
Consume the image and returns aLumaA
image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fninto_luma_alpha16(self) ->ImageBuffer<LumaA<u16>,Vec<u16>>
pub fninto_luma_alpha16(self) ->ImageBuffer<LumaA<u16>,Vec<u16>>
Consume the image and returns aLumaA
image.
If the image was already the correct format, it is returned as is.Otherwise, a copy is created.
Sourcepub fncrop(&mut self, x:u32, y:u32, width:u32, height:u32) ->DynamicImage
pub fncrop(&mut self, x:u32, y:u32, width:u32, height:u32) ->DynamicImage
Return a cut-out of this image delimited by the bounding rectangle.
Note: this method doesnot modify the object,and its signature will be replaced withcrop_imm()
’s in the 0.24 release
Sourcepub fncrop_imm(&self, x:u32, y:u32, width:u32, height:u32) ->DynamicImage
pub fncrop_imm(&self, x:u32, y:u32, width:u32, height:u32) ->DynamicImage
Return a cut-out of this image delimited by the bounding rectangle.
Sourcepub fnas_mut_rgb8(&mut self) ->Option<&mutRgbImage>
pub fnas_mut_rgb8(&mut self) ->Option<&mutRgbImage>
Return a mutable reference to an 8bit RGB image
Sourcepub fnas_mut_rgba8(&mut self) ->Option<&mutRgbaImage>
pub fnas_mut_rgba8(&mut self) ->Option<&mutRgbaImage>
Return a mutable reference to an 8bit RGBA image
Sourcepub fnas_mut_luma8(&mut self) ->Option<&mutGrayImage>
pub fnas_mut_luma8(&mut self) ->Option<&mutGrayImage>
Return a mutable reference to an 8bit Grayscale image
Sourcepub fnas_luma_alpha8(&self) ->Option<&GrayAlphaImage>
pub fnas_luma_alpha8(&self) ->Option<&GrayAlphaImage>
Return a reference to an 8bit Grayscale image with an alpha channel
Sourcepub fnas_mut_luma_alpha8(&mut self) ->Option<&mutGrayAlphaImage>
pub fnas_mut_luma_alpha8(&mut self) ->Option<&mutGrayAlphaImage>
Return a mutable reference to an 8bit Grayscale image with an alpha channel
Sourcepub fnas_rgb16(&self) ->Option<&ImageBuffer<Rgb<u16>,Vec<u16>>>
pub fnas_rgb16(&self) ->Option<&ImageBuffer<Rgb<u16>,Vec<u16>>>
Return a reference to an 16bit RGB image
Sourcepub fnas_mut_rgb16(&mut self) ->Option<&mutImageBuffer<Rgb<u16>,Vec<u16>>>
pub fnas_mut_rgb16(&mut self) ->Option<&mutImageBuffer<Rgb<u16>,Vec<u16>>>
Return a mutable reference to an 16bit RGB image
Sourcepub fnas_rgba16(&self) ->Option<&ImageBuffer<Rgba<u16>,Vec<u16>>>
pub fnas_rgba16(&self) ->Option<&ImageBuffer<Rgba<u16>,Vec<u16>>>
Return a reference to an 16bit RGBA image
Sourcepub fnas_mut_rgba16(&mut self) ->Option<&mutImageBuffer<Rgba<u16>,Vec<u16>>>
pub fnas_mut_rgba16(&mut self) ->Option<&mutImageBuffer<Rgba<u16>,Vec<u16>>>
Return a mutable reference to an 16bit RGBA image
Sourcepub fnas_rgb32f(&self) ->Option<&Rgb32FImage>
pub fnas_rgb32f(&self) ->Option<&Rgb32FImage>
Return a reference to an 32bit RGB image
Sourcepub fnas_mut_rgb32f(&mut self) ->Option<&mutRgb32FImage>
pub fnas_mut_rgb32f(&mut self) ->Option<&mutRgb32FImage>
Return a mutable reference to an 32bit RGB image
Sourcepub fnas_rgba32f(&self) ->Option<&Rgba32FImage>
pub fnas_rgba32f(&self) ->Option<&Rgba32FImage>
Return a reference to an 32bit RGBA image
Sourcepub fnas_mut_rgba32f(&mut self) ->Option<&mutRgba32FImage>
pub fnas_mut_rgba32f(&mut self) ->Option<&mutRgba32FImage>
Return a mutable reference to an 32bit RGBA image
Sourcepub fnas_luma16(&self) ->Option<&ImageBuffer<Luma<u16>,Vec<u16>>>
pub fnas_luma16(&self) ->Option<&ImageBuffer<Luma<u16>,Vec<u16>>>
Return a reference to an 16bit Grayscale image
Sourcepub fnas_mut_luma16(&mut self) ->Option<&mutImageBuffer<Luma<u16>,Vec<u16>>>
pub fnas_mut_luma16(&mut self) ->Option<&mutImageBuffer<Luma<u16>,Vec<u16>>>
Return a mutable reference to an 16bit Grayscale image
Sourcepub fnas_luma_alpha16(&self) ->Option<&ImageBuffer<LumaA<u16>,Vec<u16>>>
pub fnas_luma_alpha16(&self) ->Option<&ImageBuffer<LumaA<u16>,Vec<u16>>>
Return a reference to an 16bit Grayscale image with an alpha channel
Sourcepub fnas_mut_luma_alpha16( &mut self,) ->Option<&mutImageBuffer<LumaA<u16>,Vec<u16>>>
pub fnas_mut_luma_alpha16( &mut self,) ->Option<&mutImageBuffer<LumaA<u16>,Vec<u16>>>
Return a mutable reference to an 16bit Grayscale image with an alpha channel
Sourcepub fnas_flat_samples_u8(&self) ->Option<FlatSamples<&[u8]>>
pub fnas_flat_samples_u8(&self) ->Option<FlatSamples<&[u8]>>
Return a view on the raw sample buffer for 8 bit per channel images.
Sourcepub fnas_flat_samples_u16(&self) ->Option<FlatSamples<&[u16]>>
pub fnas_flat_samples_u16(&self) ->Option<FlatSamples<&[u16]>>
Return a view on the raw sample buffer for 16 bit per channel images.
Sourcepub fnas_flat_samples_f32(&self) ->Option<FlatSamples<&[f32]>>
pub fnas_flat_samples_f32(&self) ->Option<FlatSamples<&[f32]>>
Return a view on the raw sample buffer for 32bit per channel images.
Sourcepub fninto_bytes(self) ->Vec<u8>ⓘ
pub fninto_bytes(self) ->Vec<u8>ⓘ
Return this image’s pixels as a byte vector. If theImageBuffer
container isVec<u8>
, this operation is free. Otherwise, a copyis returned.
Sourcepub fngrayscale(&self) ->DynamicImage
pub fngrayscale(&self) ->DynamicImage
Return a grayscale version of this image.ReturnsLuma
images in most cases. However, forf32
images,this will return a grayscaleRgb/Rgba
image instead.
Sourcepub fnresize( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
pub fnresize( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
Resize this image using the specified filter algorithm.Returns a new image. The image’s aspect ratio is preserved.The image is scaled to the maximum possible size that fitswithin the bounds specified bynwidth
andnheight
.
Sourcepub fnresize_exact( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
pub fnresize_exact( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
Resize this image using the specified filter algorithm.Returns a new image. Does not preserve aspect ratio.nwidth
andnheight
are the new image’s dimensions
Sourcepub fnthumbnail(&self, nwidth:u32, nheight:u32) ->DynamicImage
pub fnthumbnail(&self, nwidth:u32, nheight:u32) ->DynamicImage
Scale this image down to fit within a specific size.Returns a new image. The image’s aspect ratio is preserved.The image is scaled to the maximum possible size that fitswithin the bounds specified bynwidth
andnheight
.
This method uses a fast integer algorithm where each sourcepixel contributes to exactly one target pixel.May give aliasing artifacts if new size is close to old size.
Sourcepub fnthumbnail_exact(&self, nwidth:u32, nheight:u32) ->DynamicImage
pub fnthumbnail_exact(&self, nwidth:u32, nheight:u32) ->DynamicImage
Scale this image down to a specific size.Returns a new image. Does not preserve aspect ratio.nwidth
andnheight
are the new image’s dimensions.This method uses a fast integer algorithm where each sourcepixel contributes to exactly one target pixel.May give aliasing artifacts if new size is close to old size.
Sourcepub fnresize_to_fill( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
pub fnresize_to_fill( &self, nwidth:u32, nheight:u32, filter:FilterType,) ->DynamicImage
Resize this image using the specified filter algorithm.Returns a new image. The image’s aspect ratio is preserved.The image is scaled to the maximum possible size that fitswithin the larger (relative to aspect ratio) of the boundsspecified bynwidth
andnheight
, then cropped tofit within the other bound.
Sourcepub fnblur(&self, sigma:f32) ->DynamicImage
pub fnblur(&self, sigma:f32) ->DynamicImage
Performs a Gaussian blur on this image.sigma
is a measure of how much to blur by.UseDynamicImage::fast_blur() for a faster but lessaccurate version.
Sourcepub fnfast_blur(&self, sigma:f32) ->DynamicImage
pub fnfast_blur(&self, sigma:f32) ->DynamicImage
Performs a fast blur on this image.sigma
is the standard deviation of the(approximated) Gaussian
Sourcepub fnunsharpen(&self, sigma:f32, threshold:i32) ->DynamicImage
pub fnunsharpen(&self, sigma:f32, threshold:i32) ->DynamicImage
Performs an unsharpen mask on this image.sigma
is the amount to blur the image by.threshold
is a control of how much to sharpen.
Seehttps://en.wikipedia.org/wiki/Unsharp_masking#Digital_unsharp_masking
Sourcepub fnfilter3x3(&self, kernel: &[f32]) ->DynamicImage
pub fnfilter3x3(&self, kernel: &[f32]) ->DynamicImage
Filters this image with the specified 3x3 kernel.
Sourcepub fnadjust_contrast(&self, c:f32) ->DynamicImage
pub fnadjust_contrast(&self, c:f32) ->DynamicImage
Adjust the contrast of this image.contrast
is the amount to adjust the contrast by.Negative values decrease the contrast and positive values increase the contrast.
Sourcepub fnbrighten(&self, value:i32) ->DynamicImage
pub fnbrighten(&self, value:i32) ->DynamicImage
Brighten the pixels of this image.value
is the amount to brighten each pixel by.Negative values decrease the brightness and positive values increase it.
Sourcepub fnhuerotate(&self, value:i32) ->DynamicImage
pub fnhuerotate(&self, value:i32) ->DynamicImage
Hue rotate the supplied image.value
is the degrees to rotate each pixel by.0 and 360 do nothing, the rest rotates by the given degree value.just like the css webkit filter hue-rotate(180)
Sourcepub fnflipv(&self) ->DynamicImage
pub fnflipv(&self) ->DynamicImage
Flip this image vertically
Useapply_orientation
if you want to flip the image in-place instead.
Sourcepub fnfliph(&self) ->DynamicImage
pub fnfliph(&self) ->DynamicImage
Flip this image horizontally
Useapply_orientation
if you want to flip the image in-place.
Sourcepub fnrotate90(&self) ->DynamicImage
pub fnrotate90(&self) ->DynamicImage
Rotate this image 90 degrees clockwise.
Sourcepub fnrotate180(&self) ->DynamicImage
pub fnrotate180(&self) ->DynamicImage
Rotate this image 180 degrees.
Useapply_orientation
if you want to rotate the image in-place.
Sourcepub fnrotate270(&self) ->DynamicImage
pub fnrotate270(&self) ->DynamicImage
Rotate this image 270 degrees clockwise.
Sourcepub fnapply_orientation(&mut self, orientation:Orientation)
pub fnapply_orientation(&mut self, orientation:Orientation)
Rotates and/or flips the image as indicated byOrientation.
This can be used to apply Exif orientation to an image,e.g. to correctly display a photo taken by a smartphone camera:
useimage::{DynamicImage, ImageReader, ImageDecoder};letmutdecoder = ImageReader::open("file.jpg")?.into_decoder()?;letorientation = decoder.orientation()?;letmutimage = DynamicImage::from_decoder(decoder)?;image.apply_orientation(orientation);
Note that for some orientations cannot be efficiently applied in-place.In that case this function will make a copy of the image internally.
If this matters to you, please see the documentation on the variants ofOrientationto learn which orientations can and cannot be applied without copying.
Sourcepub fnwrite_to<W:Write +Seek>( &self, w:&mut W, format:ImageFormat,) ->ImageResult<()>
pub fnwrite_to<W:Write +Seek>( &self, w:&mut W, format:ImageFormat,) ->ImageResult<()>
Encode this image and write it tow
.
Assumes the writer is buffered. In most cases,you should wrap your writer in aBufWriter
for best performance.
Sourcepub fnwrite_with_encoder(&self, encoder: implImageEncoder) ->ImageResult<()>
pub fnwrite_with_encoder(&self, encoder: implImageEncoder) ->ImageResult<()>
Encode this image with the provided encoder.
Sourcepub fnsave<Q>(&self, path: Q) ->ImageResult<()>
pub fnsave<Q>(&self, path: Q) ->ImageResult<()>
Saves the buffer to a file at the path specified.
The image format is derived from the file extension.
Sourcepub fnsave_with_format<Q>( &self, path: Q, format:ImageFormat,) ->ImageResult<()>
pub fnsave_with_format<Q>( &self, path: Q, format:ImageFormat,) ->ImageResult<()>
Saves the buffer to a file at the specified path inthe specified format.
Seesave_buffer_with_format
forsupported types.
Trait Implementations§
Source§implClone forDynamicImage
implClone forDynamicImage
Source§implDebug forDynamicImage
implDebug forDynamicImage
Source§implDefault forDynamicImage
implDefault forDynamicImage
Source§implFrom<DynamicImage> forImageBuffer<Luma<u16>,Vec<u16>>
implFrom<DynamicImage> forImageBuffer<Luma<u16>,Vec<u16>>
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forGrayImage
implFrom<DynamicImage> forGrayImage
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forImageBuffer<LumaA<u16>,Vec<u16>>
implFrom<DynamicImage> forImageBuffer<LumaA<u16>,Vec<u16>>
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forGrayAlphaImage
implFrom<DynamicImage> forGrayAlphaImage
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forImageBuffer<Rgb<u16>,Vec<u16>>
implFrom<DynamicImage> forImageBuffer<Rgb<u16>,Vec<u16>>
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forRgbImage
implFrom<DynamicImage> forRgbImage
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forRgba32FImage
implFrom<DynamicImage> forRgba32FImage
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forImageBuffer<Rgba<u16>,Vec<u16>>
implFrom<DynamicImage> forImageBuffer<Rgba<u16>,Vec<u16>>
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<DynamicImage> forRgbaImage
implFrom<DynamicImage> forRgbaImage
Source§fnfrom(value:DynamicImage) -> Self
fnfrom(value:DynamicImage) -> Self
Source§implFrom<ImageBuffer<Luma<f32>,Vec<f32>>> forDynamicImage
implFrom<ImageBuffer<Luma<f32>,Vec<f32>>> forDynamicImage
Source§implFrom<ImageBuffer<Luma<u16>,Vec<u16>>> forDynamicImage
implFrom<ImageBuffer<Luma<u16>,Vec<u16>>> forDynamicImage
Source§implFrom<ImageBuffer<Luma<u8>,Vec<u8>>> forDynamicImage
implFrom<ImageBuffer<Luma<u8>,Vec<u8>>> forDynamicImage
Source§implFrom<ImageBuffer<LumaA<f32>,Vec<f32>>> forDynamicImage
implFrom<ImageBuffer<LumaA<f32>,Vec<f32>>> forDynamicImage
Source§implFrom<ImageBuffer<LumaA<u16>,Vec<u16>>> forDynamicImage
implFrom<ImageBuffer<LumaA<u16>,Vec<u16>>> forDynamicImage
Source§implFrom<ImageBuffer<LumaA<u8>,Vec<u8>>> forDynamicImage
implFrom<ImageBuffer<LumaA<u8>,Vec<u8>>> forDynamicImage
Source§fnfrom(image:GrayAlphaImage) -> Self
fnfrom(image:GrayAlphaImage) -> Self
Source§implFrom<ImageBuffer<Rgb<f32>,Vec<f32>>> forDynamicImage
implFrom<ImageBuffer<Rgb<f32>,Vec<f32>>> forDynamicImage
Source§fnfrom(image:Rgb32FImage) -> Self
fnfrom(image:Rgb32FImage) -> Self
Source§implFrom<ImageBuffer<Rgb<u16>,Vec<u16>>> forDynamicImage
implFrom<ImageBuffer<Rgb<u16>,Vec<u16>>> forDynamicImage
Source§implFrom<ImageBuffer<Rgb<u8>,Vec<u8>>> forDynamicImage
implFrom<ImageBuffer<Rgb<u8>,Vec<u8>>> forDynamicImage
Source§implFrom<ImageBuffer<Rgba<f32>,Vec<f32>>> forDynamicImage
implFrom<ImageBuffer<Rgba<f32>,Vec<f32>>> forDynamicImage
Source§fnfrom(image:Rgba32FImage) -> Self
fnfrom(image:Rgba32FImage) -> Self
Source§implFrom<ImageBuffer<Rgba<u16>,Vec<u16>>> forDynamicImage
implFrom<ImageBuffer<Rgba<u16>,Vec<u16>>> forDynamicImage
Source§implFrom<ImageBuffer<Rgba<u8>,Vec<u8>>> forDynamicImage
implFrom<ImageBuffer<Rgba<u8>,Vec<u8>>> forDynamicImage
Source§implGenericImage forDynamicImage
implGenericImage forDynamicImage
Source§fnget_pixel_mut(&mut self, _:u32, _:u32) -> &mutRgba<u8>
👎Deprecated since 0.24.0: Useget_pixel
andput_pixel
instead.
fnget_pixel_mut(&mut self, _:u32, _:u32) -> &mutRgba<u8>
get_pixel
andput_pixel
instead.Do not use is function: It is unimplemented!
Source§fnput_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)
fnput_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)
Source§fnblend_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)
fnblend_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)
pixels_mut
to blend the pixels directlySource§unsafe fnunsafe_put_pixel(&mut self, x:u32, y:u32, pixel: Self::Pixel)
unsafe fnunsafe_put_pixel(&mut self, x:u32, y:u32, pixel: Self::Pixel)
Source§fncopy_from<O>(&mut self, other:&O, x:u32, y:u32) ->ImageResult<()>where O:GenericImageView<Pixel = Self::Pixel>,
fncopy_from<O>(&mut self, other:&O, x:u32, y:u32) ->ImageResult<()>where O:GenericImageView<Pixel = Self::Pixel>,
Source§fncopy_within(&mut self, source:Rect, x:u32, y:u32) ->bool
fncopy_within(&mut self, source:Rect, x:u32, y:u32) ->bool
Source§fnsub_image( &mut self, x:u32, y:u32, width:u32, height:u32,) ->SubImage<&mut Self>where Self:Sized,
fnsub_image( &mut self, x:u32, y:u32, width:u32, height:u32,) ->SubImage<&mut Self>where Self:Sized,
GenericImageView::view
The coordinates set the position of the top left corner of theSubImage
.Source§implGenericImageView forDynamicImage
implGenericImageView forDynamicImage
Source§fndimensions(&self) -> (u32,u32)
fndimensions(&self) -> (u32,u32)
Source§fnget_pixel(&self, x:u32, y:u32) ->Rgba<u8>
fnget_pixel(&self, x:u32, y:u32) ->Rgba<u8>
Source§fnin_bounds(&self, x:u32, y:u32) ->bool
fnin_bounds(&self, x:u32, y:u32) ->bool
Source§unsafe fnunsafe_get_pixel(&self, x:u32, y:u32) -> Self::Pixel
unsafe fnunsafe_get_pixel(&self, x:u32, y:u32) -> Self::Pixel
Source§implPartialEq forDynamicImage
implPartialEq forDynamicImage
implStructuralPartialEq forDynamicImage
Auto Trait Implementations§
implFreeze forDynamicImage
implRefUnwindSafe forDynamicImage
implSend forDynamicImage
implSync forDynamicImage
implUnpin forDynamicImage
implUnwindSafe forDynamicImage
Blanket Implementations§
Source§impl<T>BorrowMut<T> for Twhere T: ?Sized,
impl<T>BorrowMut<T> for Twhere T: ?Sized,
Source§fnborrow_mut(&mut self) ->&mut T
fnborrow_mut(&mut self) ->&mut T
Source§impl<T>CloneToUninit for Twhere T:Clone,
impl<T>CloneToUninit for Twhere T:Clone,
Source§impl<T>IntoEither for T
impl<T>IntoEither for T
Source§fninto_either(self, into_left:bool) ->Either<Self, Self>
fninto_either(self, into_left:bool) ->Either<Self, Self>
self
into aLeft
variant ofEither<Self, Self>
ifinto_left
istrue
.Convertsself
into aRight
variant ofEither<Self, Self>
otherwise.Read moreSource§fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
self
into aLeft
variant ofEither<Self, Self>
ifinto_left(&self)
returnstrue
.Convertsself
into aRight
variant ofEither<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§fnread_from_little_endian(read:&mut R) ->Result<Self,Error>
fnread_from_little_endian(read:&mut R) ->Result<Self,Error>
ReadEndian::read_from_little_endian()
.