Movatterモバイル変換


[0]ホーム

URL:


Docs.rs

EnumDynamicImage

Source
#[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
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

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

Source

pub fnnew(w:u32, h:u32, color:ColorType) ->DynamicImage

Creates a dynamic image backed by a buffer depending onthe color type given.

Source

pub fnnew_luma8(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of gray pixels.

Source

pub fnnew_luma_a8(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of graypixels with transparency.

Source

pub fnnew_rgb8(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGB pixels.

Source

pub fnnew_rgba8(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGBA pixels.

Source

pub fnnew_luma16(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of gray pixels.

Source

pub fnnew_luma_a16(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of graypixels with transparency.

Source

pub fnnew_rgb16(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGB pixels.

Source

pub fnnew_rgba16(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGBA pixels.

Source

pub fnnew_rgb32f(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGB pixels.

Source

pub fnnew_rgba32f(w:u32, h:u32) ->DynamicImage

Creates a dynamic image backed by a buffer of RGBA pixels.

Source

pub fnfrom_decoder(decoder: implImageDecoder) ->ImageResult<Self>

Decodes an encoded image into a dynamic image.

Source

pub fnto_rgb8(&self) ->RgbImage

Returns a copy of this image as an RGB image.

Source

pub fnto_rgb16(&self) ->ImageBuffer<Rgb<u16>,Vec<u16>>

Returns a copy of this image as an RGB image.

Source

pub fnto_rgb32f(&self) ->Rgb32FImage

Returns a copy of this image as an RGB image.

Source

pub fnto_rgba8(&self) ->RgbaImage

Returns a copy of this image as an RGBA image.

Source

pub fnto_rgba16(&self) ->ImageBuffer<Rgba<u16>,Vec<u16>>

Returns a copy of this image as an RGBA image.

Source

pub fnto_rgba32f(&self) ->Rgba32FImage

Returns a copy of this image as an RGBA image.

Source

pub fnto_luma8(&self) ->GrayImage

Returns a copy of this image as a Luma image.

Source

pub fnto_luma16(&self) ->ImageBuffer<Luma<u16>,Vec<u16>>

Returns a copy of this image as a Luma image.

Source

pub fnto_luma32f(&self) ->ImageBuffer<Luma<f32>,Vec<f32>>

Returns a copy of this image as a Luma image.

Source

pub fnto_luma_alpha8(&self) ->GrayAlphaImage

Returns a copy of this image as aLumaA image.

Source

pub fnto_luma_alpha16(&self) ->ImageBuffer<LumaA<u16>,Vec<u16>>

Returns a copy of this image as aLumaA image.

Source

pub fnto_luma_alpha32f(&self) ->ImageBuffer<LumaA<f32>,Vec<f32>>

Returns a copy of this image as aLumaA image.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

pub fnas_rgb8(&self) ->Option<&RgbImage>

Return a reference to an 8bit RGB image

Source

pub fnas_mut_rgb8(&mut self) ->Option<&mutRgbImage>

Return a mutable reference to an 8bit RGB image

Source

pub fnas_rgba8(&self) ->Option<&RgbaImage>

Return a reference to an 8bit RGBA image

Source

pub fnas_mut_rgba8(&mut self) ->Option<&mutRgbaImage>

Return a mutable reference to an 8bit RGBA image

Source

pub fnas_luma8(&self) ->Option<&GrayImage>

Return a reference to an 8bit Grayscale image

Source

pub fnas_mut_luma8(&mut self) ->Option<&mutGrayImage>

Return a mutable reference to an 8bit Grayscale image

Source

pub fnas_luma_alpha8(&self) ->Option<&GrayAlphaImage>

Return a reference to an 8bit Grayscale image with an alpha channel

Source

pub fnas_mut_luma_alpha8(&mut self) ->Option<&mutGrayAlphaImage>

Return a mutable reference to an 8bit Grayscale image with an alpha channel

Source

pub fnas_rgb16(&self) ->Option<&ImageBuffer<Rgb<u16>,Vec<u16>>>

Return a reference to an 16bit RGB image

Source

pub fnas_mut_rgb16(&mut self) ->Option<&mutImageBuffer<Rgb<u16>,Vec<u16>>>

Return a mutable reference to an 16bit RGB image

Source

pub fnas_rgba16(&self) ->Option<&ImageBuffer<Rgba<u16>,Vec<u16>>>

Return a reference to an 16bit RGBA image

Source

pub fnas_mut_rgba16(&mut self) ->Option<&mutImageBuffer<Rgba<u16>,Vec<u16>>>

Return a mutable reference to an 16bit RGBA image

Source

pub fnas_rgb32f(&self) ->Option<&Rgb32FImage>

Return a reference to an 32bit RGB image

Source

pub fnas_mut_rgb32f(&mut self) ->Option<&mutRgb32FImage>

Return a mutable reference to an 32bit RGB image

Source

pub fnas_rgba32f(&self) ->Option<&Rgba32FImage>

Return a reference to an 32bit RGBA image

Source

pub fnas_mut_rgba32f(&mut self) ->Option<&mutRgba32FImage>

Return a mutable reference to an 32bit RGBA image

Source

pub fnas_luma16(&self) ->Option<&ImageBuffer<Luma<u16>,Vec<u16>>>

Return a reference to an 16bit Grayscale image

Source

pub fnas_mut_luma16(&mut self) ->Option<&mutImageBuffer<Luma<u16>,Vec<u16>>>

Return a mutable reference to an 16bit Grayscale image

Source

pub fnas_luma_alpha16(&self) ->Option<&ImageBuffer<LumaA<u16>,Vec<u16>>>

Return a reference to an 16bit Grayscale image with an alpha channel

Source

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

Source

pub fnas_flat_samples_u8(&self) ->Option<FlatSamples<&[u8]>>

Return a view on the raw sample buffer for 8 bit per channel images.

Source

pub fnas_flat_samples_u16(&self) ->Option<FlatSamples<&[u16]>>

Return a view on the raw sample buffer for 16 bit per channel images.

Source

pub fnas_flat_samples_f32(&self) ->Option<FlatSamples<&[f32]>>

Return a view on the raw sample buffer for 32bit per channel images.

Source

pub fnas_bytes(&self) -> &[u8]

Return this image’s pixels as a native endian byte slice.

Source

pub fninto_bytes(self) ->Vec<u8>

Return this image’s pixels as a byte vector. If theImageBuffercontainer isVec<u8>, this operation is free. Otherwise, a copyis returned.

Source

pub fncolor(&self) ->ColorType

Return this image’s color type.

Source

pub fnwidth(&self) ->u32

Returns the width of the underlying image

Source

pub fnheight(&self) ->u32

Returns the height of the underlying image

Source

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.

Source

pub fninvert(&mut self)

Invert the colors of this image.This method operates inplace.

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fnfast_blur(&self, sigma:f32) ->DynamicImage

Performs a fast blur on this image.sigma is the standard deviation of the(approximated) Gaussian

Source

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

Source

pub fnfilter3x3(&self, kernel: &[f32]) ->DynamicImage

Filters this image with the specified 3x3 kernel.

Source

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.

Source

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.

Source

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)

Source

pub fnflipv(&self) ->DynamicImage

Flip this image vertically

Useapply_orientation if you want to flip the image in-place instead.

Source

pub fnfliph(&self) ->DynamicImage

Flip this image horizontally

Useapply_orientation if you want to flip the image in-place.

Source

pub fnrotate90(&self) ->DynamicImage

Rotate this image 90 degrees clockwise.

Source

pub fnrotate180(&self) ->DynamicImage

Rotate this image 180 degrees.

Useapply_orientation if you want to rotate the image in-place.

Source

pub fnrotate270(&self) ->DynamicImage

Rotate this image 270 degrees clockwise.

Source

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.

Source

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.

Source

pub fnwrite_with_encoder(&self, encoder: implImageEncoder) ->ImageResult<()>

Encode this image with the provided encoder.

Source

pub fnsave<Q>(&self, path: Q) ->ImageResult<()>
where Q:AsRef<Path>,

Saves the buffer to a file at the path specified.

The image format is derived from the file extension.

Source

pub fnsave_with_format<Q>( &self, path: Q, format:ImageFormat,) ->ImageResult<()>
where Q:AsRef<Path>,

Saves the buffer to a file at the specified path inthe specified format.

Seesave_buffer_with_format forsupported types.

Trait Implementations§

Source§

implClone forDynamicImage

Source§

fnclone(&self) -> Self

Returns a copy of the value.Read more
Source§

fnclone_from(&mut self, source: &Self)

Performs copy-assignment fromsource.Read more
Source§

implDebug forDynamicImage

Source§

fnfmt(&self, f: &mutFormatter<'_>) ->Result

Formats the value using the given formatter.Read more
Source§

implDefault forDynamicImage

Source§

fndefault() -> Self

Returns the “default value” for a type.Read more
Source§

implFrom<DynamicImage> forImageBuffer<Luma<u16>,Vec<u16>>

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forGrayImage

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forImageBuffer<LumaA<u16>,Vec<u16>>

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forGrayAlphaImage

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forImageBuffer<Rgb<u16>,Vec<u16>>

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forRgbImage

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forRgba32FImage

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forImageBuffer<Rgba<u16>,Vec<u16>>

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<DynamicImage> forRgbaImage

Source§

fnfrom(value:DynamicImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Luma<f32>,Vec<f32>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<Luma<f32>,Vec<f32>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Luma<u16>,Vec<u16>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<Luma<u16>,Vec<u16>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Luma<u8>,Vec<u8>>> forDynamicImage

Source§

fnfrom(image:GrayImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<LumaA<f32>,Vec<f32>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<LumaA<f32>,Vec<f32>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<LumaA<u16>,Vec<u16>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<LumaA<u16>,Vec<u16>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<LumaA<u8>,Vec<u8>>> forDynamicImage

Source§

fnfrom(image:GrayAlphaImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgb<f32>,Vec<f32>>> forDynamicImage

Source§

fnfrom(image:Rgb32FImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgb<u16>,Vec<u16>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<Rgb<u16>,Vec<u16>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgb<u8>,Vec<u8>>> forDynamicImage

Source§

fnfrom(image:RgbImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgba<f32>,Vec<f32>>> forDynamicImage

Source§

fnfrom(image:Rgba32FImage) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgba<u16>,Vec<u16>>> forDynamicImage

Source§

fnfrom(image:ImageBuffer<Rgba<u16>,Vec<u16>>) -> Self

Converts to this type from the input type.
Source§

implFrom<ImageBuffer<Rgba<u8>,Vec<u8>>> forDynamicImage

Source§

fnfrom(image:RgbaImage) -> Self

Converts to this type from the input type.
Source§

implGenericImage forDynamicImage

Source§

fnget_pixel_mut(&mut self, _:u32, _:u32) -> &mutRgba<u8>

👎Deprecated since 0.24.0: Useget_pixel andput_pixel instead.

Do not use is function: It is unimplemented!

Source§

fnput_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)

Put a pixel at location (x, y). Indexed from top left.Read more
Source§

fnblend_pixel(&mut self, x:u32, y:u32, pixel:Rgba<u8>)

👎Deprecated since 0.24.0: Use iteratorpixels_mut to blend the pixels directly
Put a pixel at location (x, y), taking into account alpha channels
Source§

unsafe fnunsafe_put_pixel(&mut self, x:u32, y:u32, pixel: Self::Pixel)

Puts a pixel at location (x, y). Indexed from top left.Read more
Source§

fncopy_from<O>(&mut self, other:&O, x:u32, y:u32) ->ImageResult<()>
where O:GenericImageView<Pixel = Self::Pixel>,

Copies all of the pixels from another image into this image.Read more
Source§

fncopy_within(&mut self, source:Rect, x:u32, y:u32) ->bool

Copies all of the pixels from one part of this image to another part of this image.Read more
Source§

fnsub_image( &mut self, x:u32, y:u32, width:u32, height:u32,) ->SubImage<&mut Self>
where Self:Sized,

Returns a mutable subimage that is a view into this image.If you want an immutable subimage instead, useGenericImageView::viewThe coordinates set the position of the top left corner of theSubImage.
Source§

implGenericImageView forDynamicImage

Source§

typePixel =Rgba<u8>

The type of pixel.
Source§

fndimensions(&self) -> (u32,u32)

The width and height of this image.
Source§

fnget_pixel(&self, x:u32, y:u32) ->Rgba<u8>

Returns the pixel located at (x, y). Indexed from top left.Read more
Source§

fnwidth(&self) ->u32

The width of this image.
Source§

fnheight(&self) ->u32

The height of this image.
Source§

fnin_bounds(&self, x:u32, y:u32) ->bool

Returns true if this x, y coordinate is contained inside the image.
Source§

unsafe fnunsafe_get_pixel(&self, x:u32, y:u32) -> Self::Pixel

Returns the pixel located at (x, y). Indexed from top left.Read more
Source§

fnpixels(&self) ->Pixels<'_, Self>
where Self:Sized,

Returns an Iterator over the pixels of this image.The iterator yields the coordinates of each pixelalong with their value
Source§

fnview(&self, x:u32, y:u32, width:u32, height:u32) ->SubImage<&Self>
where Self:Sized,

Returns a subimage that is an immutable view into this image.You can useGenericImage::sub_image if you need a mutable view instead.The coordinates set the position of the top left corner of the view.
Source§

implPartialEq forDynamicImage

Source§

fneq(&self, other: &DynamicImage) ->bool

Tests forself andother values to be equal, and is used by==.
1.0.0 ·Source§

fnne(&self, other:&Rhs) ->bool

Tests for!=. The default implementation is almost always sufficient,and should not be overridden without very good reason.
Source§

implStructuralPartialEq forDynamicImage

Auto Trait Implementations§

§

implFreeze forDynamicImage

§

implRefUnwindSafe forDynamicImage

§

implSend forDynamicImage

§

implSync forDynamicImage

§

implUnpin forDynamicImage

§

implUnwindSafe forDynamicImage

Blanket Implementations§

Source§

impl<T>Any for T
where T: 'static + ?Sized,

Source§

fntype_id(&self) ->TypeId

Gets theTypeId ofself.Read more
Source§

impl<T>Borrow<T> for T
where T: ?Sized,

Source§

fnborrow(&self) ->&T

Immutably borrows from an owned value.Read more
Source§

impl<T>BorrowMut<T> for T
where T: ?Sized,

Source§

fnborrow_mut(&mut self) ->&mut T

Mutably borrows from an owned value.Read more
Source§

impl<T>CloneToUninit for T
where T:Clone,

Source§

unsafe fnclone_to_uninit(&self, dest:*mutu8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment fromself todest.Read more
Source§

impl<T>From<T> for T

Source§

fnfrom(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U>Into<U> for T
where U:From<T>,

Source§

fninto(self) -> U

CallsU::from(self).

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

Source§

impl<T>IntoEither for T

Source§

fninto_either(self, into_left:bool) ->Either<Self, Self>

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left istrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

fninto_either_with<F>(self, into_left: F) ->Either<Self, Self>
where F:FnOnce(&Self) ->bool,

Convertsself into aLeft variant ofEither<Self, Self>ifinto_left(&self) returnstrue.Convertsself into aRight variant ofEither<Self, Self>otherwise.Read more
Source§

impl<T>Pointable for T

Source§

constALIGN:usize

The alignment of pointer.
Source§

typeInit = T

The type for initializers.
Source§

unsafe fninit(init: <T asPointable>::Init) ->usize

Initializes a with the given initializer.Read more
Source§

unsafe fnderef<'a>(ptr:usize) ->&'a T

Dereferences the given pointer.Read more
Source§

unsafe fnderef_mut<'a>(ptr:usize) ->&'a mut T

Mutably dereferences the given pointer.Read more
Source§

unsafe fndrop(ptr:usize)

Drops the object pointed to by the given pointer.Read more
Source§

impl<R, P>ReadPrimitive<R> for P
where R:Read +ReadEndian<P>, P:Default,

Source§

fnread_from_little_endian(read:&mut R) ->Result<Self,Error>

Read this value from the supplied reader. Same asReadEndian::read_from_little_endian().
Source§

fnread_from_big_endian(read:&mut R) ->Result<Self,Error>

Read this value from the supplied reader. Same asReadEndian::read_from_big_endian().
Source§

fnread_from_native_endian(read:&mut R) ->Result<Self,Error>

Read this value from the supplied reader. Same asReadEndian::read_from_native_endian().
Source§

impl<T>ToOwned for T
where T:Clone,

Source§

typeOwned = T

The resulting type after obtaining ownership.
Source§

fnto_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning.Read more
Source§

fnclone_into(&self, target:&mut T)

Uses borrowed data to replace owned data, usually by cloning.Read more
Source§

impl<T, U>TryFrom<U> for T
where U:Into<T>,

Source§

typeError =Infallible

The type returned in the event of a conversion error.
Source§

fntry_from(value: U) ->Result<T, <T asTryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U>TryInto<U> for T
where U:TryFrom<T>,

Source§

typeError = <U asTryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fntry_into(self) ->Result<U, <U asTryFrom<T>>::Error>

Performs the conversion.

[8]ページ先頭

©2009-2025 Movatter.jp