You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
A `DynamicImage` is an enumeration over all supported `ImageBuffer<P>` types.
72
-
Its exact image type is determined at runtime. It is the type returned when
73
-
opening an image. For convenience `DynamicImage` reimplements all image
74
-
processing functions.
82
+
83
+
A `DynamicImage` is an enumeration over all supported `ImageBuffer<P>` types. Its
84
+
type of pixels is determined at runtime within a set of basic types of layouts
85
+
and channels. This type is returned when opening an image. For convenience
86
+
`DynamicImage` reimplements all image processing functions.
75
87
76
88
### The [`GenericImageView`](https://docs.rs/image/*/image/trait.GenericImageView.html) and [`GenericImage`](https://docs.rs/image/*/image/trait.GenericImage.html) Traits
77
89
78
90
Traits that provide methods for inspecting (`GenericImageView`) and manipulating (`GenericImage`) images, parameterised over the image's pixel type.
A view into another image, delimited by the coordinates of a rectangle.
82
95
The coordinates given set the position of the top left corner of the rectangle.
83
96
This is used to perform image processing functions on a subregion of an image.
84
97
85
-
86
-
## The [`ImageDecoder`](https://docs.rs/image/*/image/trait.ImageDecoder.html) and [`ImageDecoderRect`](https://docs.rs/image/*/image/trait.ImageDecoderRect.html) Traits
87
-
88
-
All image format decoders implement the `ImageDecoder` trait which provide
89
-
basic methods for getting image metadata and decoding images. Some formats
90
-
additionally provide `ImageDecoderRect` implementations which allow for
91
-
decoding only part of an image at once.
92
-
93
-
The most important methods for decoders are...
94
-
+**dimensions**: Return a tuple containing the width and height of the image.
95
-
+**color_type**: Return the color type of the image data produced by this decoder.
96
-
+**read_image**: Decode the entire image into a slice of bytes.
97
-
98
-
## Pixels
99
-
100
-
`image` provides the following pixel types:
101
-
+**Rgb**: RGB pixel
102
-
+**Rgba**: RGB with alpha (RGBA pixel)
103
-
+**Luma**: Grayscale pixel
104
-
+**LumaA**: Grayscale with alpha
105
-
106
-
All pixels are parameterised by their component type.
107
-
108
98
## Image Processing Functions
109
99
110
100
These are the functions defined in the [`imageops`](https://docs.rs/image/latest/image/imageops/index.html) module. All functions operate on types that implement the [`GenericImage`](https://docs.rs/image/latest/image/trait.GenericImage.html) trait.
@@ -129,6 +119,7 @@ Note that some of the functions are very slow in debug mode. Make sure to use re
129
119
For more options, see the [`imageproc`](https://crates.io/crates/imageproc) crate.
130
120
131
121
## Examples
122
+
132
123
### Opening and Saving Images
133
124
134
125
`image` provides the [`open`](https://docs.rs/image/latest/image/fn.open.html) function for opening images from a path. The image
The decoder module provides global hooks to register format detection patterns
147
+
and as well as other decoder implementations.
148
+
155
149
### Generating Fractals
156
150
157
151
```rust,no_run
@@ -205,7 +199,7 @@ Example output:
205
199
If the high level interface is not needed because the image was obtained by other means, `image` provides the function [`save_buffer`](https://docs.rs/image/latest/image/fn.save_buffer.html) to save a buffer to a file.
206
200
207
201
```rust,no_run
208
-
let buffer: &[u8] = unimplemented!(); // Generate the image data
202
+
let buffer: &[u8] = todo!("your turn, generate data");
0 commit comments