85 Commits
Author SHA1 Message Date
Kirill Kuzminykh 24f006a404 Fixed the deprecation warning about ImageReader from the image crate. 2025-05-16 16:18:03 +03:00
Kirill Kuzminykh 6680de23c4 v4: Fixed dividing image by alpha channel for images with U16x2 pixels. 2025-05-16 12:25:01 +03:00
Kirill Kuzminykh a8e47c38b9 Fixed error in NEON implementation of MulDiv::multiply_alpha() and MulDiv::multiply_alpha_inplace() for U8x2 pixels (#49).
(cherry picked from commit f4e15602fe)
2025-04-07 01:36:55 +03:00
Kirill Kuzminykh db42291da9 Prepare to release. 2024-07-19 21:12:26 +03:00
Kirill Kuzminykh 49bad1bed0 Added new resize algorythm ResizeAlg::Interpolation (#32). 2024-07-18 23:33:17 +03:00
Kirill Kuzminykh f1bf0bb51a Added support for optimization with help of SSE4.1 and AVX2 to multiple and divide by alpha channel for the F32x4 pixel type (#30). 2024-07-01 23:43:59 +03:00
Kirill Kuzminykh 5e450afe04 Added basic support for the new pixel type PixelType::F32x4 (#30). 2024-06-18 23:20:13 +03:00
Kirill Kuzminykh 91c28d4539 Added basic support for the new pixel type PixelType::F32x3 (#30). 2024-06-18 02:10:49 +03:00
Kirill Kuzminykh ad2610b91e Added support for the new pixel type PixelType::F32x2 with optimizations for SSE4.1 and AVX2 (#30). 2024-06-18 01:16:32 +03:00
Kirill Kuzminykh f87f80e925 Fixed implementation of TypedCroppedImage, TypedCroppedImageMut, CroppedImage and CroppedImageMut. 2024-05-13 21:08:42 +03:00
Kirill Kuzminykh ee2ec47e3c - Renamed CroppedImage into TypedCroppedImage.
- Renamed `CroppedImageMut` into `TypedCroppedImageMut`.
2024-05-07 00:10:14 +03:00
Kirill Kuzminykh 568af7f889 - Renamed TypedImage into TypedImageRef.
- Renamed `TypedImageMut` into `TypedImage`.
2024-05-06 22:36:05 +03:00
Kirill Kuzminykh 7c90712891 - Added checking images size for equal to zero in MulDiv 2024-05-02 22:15:12 +03:00
Kirill Kuzminykh 2bc54792f2 - Added Gaussian filter for convolution algorithm.
- Added field `algorithm` into `ResizeOptions`.
- Argument `resize_alg` was removed from `Resizer::new()` method, use `options` argument of methods to resize instead.
2024-05-02 21:41:41 +03:00
Kirill Kuzminykh 8af42a2cf7 - Added ImageRef structure.
- Added example of code with differences between v3.x and v4.x.
2024-04-24 00:37:39 +03:00
Kirill Kuzminykh f6bf9bbaad Added Gaussian filter for convolution algorythm. 2024-04-21 21:50:39 +03:00
Kirill Kuzminykh 9b9766f146 Fixed dividing image by alpha channel. 2024-04-18 00:45:49 +03:00
Kirill Kuzminykh d90d235fb2 A lot of changes to replace ImageView and ImageViewMut structures on traits with the same names. 2024-04-10 23:38:46 +03:00
Kirill Kuzminykh 8223af2564 Fixed error with incorrect cropping of source image. 2024-02-15 21:04:44 +03:00
Kirill Kuzminykh 3ee194273a Fixed type of func argument of Filter::new() method. 2024-02-07 21:18:13 +03:00
Kirill Kuzminykh ed70607f2b **BREAKING**: Added a new variant of enum CropBoxError::WidthOrHeightLessOrEqualToZero. 2024-02-05 01:22:02 +03:00
Kirill Kuzminykh 19d526af74 - **BREAKING**: The type of the CropBox fields has been changed to f64. Now you can use
fractional size and position of crop box.
- **BREAKING**: The type of `centering` argument of `ImageView::set_crop_box_to_fit_dst_size()`
  and `DynamicImageView::set_crop_box_to_fit_dst_size()` methods has been changed to `Optional<(f64, f64)>`.
- **BREAKING**: The `crop_box` argument of `ImageViewMut::crop()` and `DynamicImageViewMut::crop()`
  methods has been replaced with separate `left`, `top`, `width` and `height` arguments.
2024-02-04 22:51:35 +03:00
Kirill Kuzminykh f6d843891d Added Custom variant for FilterType enum and corresponding Filter structure. 2023-12-30 13:55:41 +03:00
Kirill Kuzminykh c195c4ff43 - Significantly improved (4.5 times on x86_64) speed of vertical convolution pass implemented
in native Rust for `U8`, `U8x2`, `U8x3` and `U8x4` images.
- Changed order of convolution passes for `U8`, `U8x2`, `U8x3` and `U8x4` images.
  Now the vertical pass is the first and the horizontal pass is the second.
- **BREAKING**: Changed internal data type for `U8x4` structure. Not it is `[u8; 4]` instead of `u32`.
2023-12-14 22:45:26 +03:00
Kirill Kuzminykh 63f6b517ab Added feature only_u8x4 that can be used to experiment with the crate's code. 2023-12-05 21:55:45 +03:00
Kirill Kuzminykh fd071fd0cc - Added method DynamicImageViewMut::crop() to create cropped version of ImageViewMut.
- Added method `ImageViewMut::crop()` to create cropped version of `ImageViewMut`.
2023-03-24 23:40:25 +03:00
Kirill Kuzminykh 999c684fce Slightly improved speed of Convolution implementation for U8x2 images and Wasm32 SIMD128 instructions. 2023-02-21 00:09:21 +03:00
Kirill Kuzminykh 76a87bc305 - CpuExtension::Wasm32 renamed into CpuExtension::Simd128.
- Optimized MulDiv implementation for Wasm32 SIMD128.
2023-01-29 00:43:25 +04:00
Colin 14e0a15d40 All tests working. 2023-01-23 16:46:54 -05:00
Colin d5055fee0b alpha u8x4 passing 2023-01-23 16:46:42 -05:00
Colin a71337a5c1 Alpha u8x2 working. 2023-01-23 16:46:42 -05:00
Colin a8e33d213c Resize Complete 2023-01-23 16:46:42 -05:00
Colin 9b15dcbc71 U8 complete. 2023-01-23 16:46:42 -05:00
Colin f0979ec3b9 Working vertical u16 2023-01-23 16:46:42 -05:00
Colin 11fbe03a8f Wasm simd for u16x1. 2023-01-23 16:46:38 -05:00
Kirill Kuzminykh 5c8477b344 - Improved speed of MulDiv implementation for U16x2 images.
- Added optimisation for processing `U16x2` images by `MulDiv` with helps of `NEON SIMD` instructions.
2022-12-11 17:28:26 +04:00
Kirill Kuzminykh b6e36cbd86 Excluded possibility of unnecessary operations during resize of cropped image by convolution algorithm. 2022-12-06 00:51:48 +04:00
Kirill Kuzminykh 057c0bcf75 Fixed tests. 2022-11-11 23:15:06 +04:00
Kirill Kuzminykh e1afd34c9c Added optimisation for processing U8x2 images by MulDiv with helps of NEON SIMD instructions. 2022-11-11 23:11:38 +04:00
Kirill Kuzminykh 55ee4f1ec8 Improved optimisation of MulDiv with helps of NEON SIMD for U8x4 pixels. 2022-11-10 00:48:22 +04:00
Kirill Kuzminykh f2ef3d1b04 Fixed error in implementation of MulDiv::divide_alpha() and MulDiv::divide_alpha_inplace() for U16x4 pixels with optimisation with helps of SSE4.1 and AVX2. 2022-11-09 03:22:13 +04:00
Kirill Kuzminykh 4ecb03336c Added optimisation for processing U16x4 images by MulDiv with helps of NEON SIMD instructions. 2022-11-08 00:33:08 +04:00
Kirill Kuzminykh d65ddab704 Added support of optimisation with helps of NEON SIMD for convolution of U16x4 images. 2022-11-02 23:43:22 +04:00
Kirill Kuzminykh 6c89f4fbae - Internals of PixelComponentMapper changed to use heap to store its data.
- Fixed couple tests.
2022-10-29 02:13:55 +04:00
Kirill Kuzminykh 2f88f9df16 - Added method CpuExtensions::is_supported(&self).
- Refactored tests.
- Fixed GitHub Actions for run check and test the crate.
2022-10-29 01:14:08 +04:00
Kirill Kuzminykh 7b5a1238ca Static variables SRGB_MAPPER and GAMMA22_MAPPER replaced by functions to create these mappers. 2022-10-28 20:59:41 +04:00
Kirill Kuzminykh ff2837d704 - Added support of optimisation with help of NEON SIMD for convolution of U8x4 images.
- Added optimisation for processing `U8x4` images by `MulDiv` with helps of `NEON SIMD` instructions.
2022-10-19 00:25:14 +04:00
Kirill Kuzminykh e3b64bf7b1 - Trait Pixel renamed into PixelExt and changed.
- All pixel types (`U8`, `U8x2`, ...) replaced by type aliases for new generic structure `Pixel`. Use method `new()` to create instance of one pixel.
- Added module `color` for working with colorspace and gamma.
2022-10-07 20:39:21 +04:00
Kirill Kuzminykh 39f7841030 - Breaking changes:
- Struct `ImageView` replaced by enum `DynamicImageView`.
  - Struct `ImageViewMut` replaced by enum `DynamicImageViewMut`.
  - Trait `Pixel` changed:
    - Associated type `ComponentsCount` renamed into `CountOfComponents`.
    - Associated type `ComponentCountOfValues` renamed into `CountOfComponentValues`.
    - Associated method `components_count` renamed into `count_of_components`.
    - Associated method `component_count_of_values` renamed into `count_of_component_values`.
- Added generic structs `ImageView` and `ImageViewMut`.
- Added module `color` for working with colorspace and gamma.
- Added functions `change_type_of_pixel_components` and
  `change_type_of_pixel_components_dyn` to change type of pixel's
  components in whole image.
- Added generic trait `IntoPixelComponent<Out: PixelComponent>`.

### Example application

- Added option `--high_precision` to use `u16` as pixel components
  for intermediate image representation.
- Added converting of source image into linear colorspace before it will be resized.
  Destination image will be returned into original colorspace before it will be saved.
2022-09-14 00:07:03 +03:00
Kirill Kuzminykh c454c3b990 Added functions for converting image colorspace. 2022-08-31 22:38:27 +03:00