Comments (2)
ImageView
is a generic struct that doesn't own the image data. It owns only vector of slices with an image rows.
Method ImageView::new()
takes Vec<&[P]>
, where P
is generic parameter and must be one of pixel types are provided by fast_image_resize
(U8, U8x2,... U8x4,... U16x4, ... F32).
Also you can create ImageView
instance from following slice types:
&[u8]
with help of method ImageView::from_buffer()
let buffer: &[u8] = ...;
let img_view: ImageView<F32> = ImageView::from_buffer(width, height, buffer).unwrap();
&[F32]
with help of method ImageView::from_pixels()
let f32_pixels: &[F32] = ...;
let img_view = ImageView::from_pixels(width, height, f32_pixels).unwrap();
Result of all of these methods will be ImageView<F32>
.
If you want to get a struct that owns an image data, then you may use Image
struct as a simple implementation of such type of container.
let empty_image = Image::new(width, height, PixelType::F32);
...
let image_data: Vec<u8> = ...;
let image = Image::from_vec_u8(width, height, image_data, PixelType::F32).unwrap();
from fast_image_resize.
Thank you very much for the detailed explanation. I will give this a try! I appreciate you taking the time to explain this to me.
from fast_image_resize.
Related Issues (19)
- Add other PixelTypes HOT 8
- Wasm32 support HOT 3
- how does the speed compare with opencv? HOT 14
- resize_with_pad HOT 5
- Bad unsafe is caught by latest rust nightly (rustc 1.70.0-nightly (2eaeb1eee 2023-04-05)) HOT 5
- Crop source slice length does not match destination slice length HOT 3
- Allow passing an immutable slice to Image::from_slice_u8 HOT 2
- num-traits error HOT 2
- Preparation of a large number of images in a loop HOT 6
- no gaussian kernel HOT 7
- Equivalent to OpenCV cv2.INTER_AREA? HOT 2
- wrong image color HOT 10
- Floating point exception during convolutional downscale (Lanczos) HOT 4
- Downscaling in linear color space? HOT 5
- valgrind memcheck detects reads of unitialized memory memory HOT 3
- ImageView::from_buffer returns an error if the provided buffer larger than the minimum required size HOT 1
- LumaA pixels HOT 3
- [BUG] Return zero if the size of the input is equal to the output HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fast_image_resize.