#include "utils_simd.hpp"Go to the source code of this file.
Macros | |
| #define | SIMD_SSE2 0 |
| #define | SIMD_NEON 0 |
Functions | |
| std::size_t | mask_surface_simd (surface &surf, const surface &mask, bool &empty) |
| Modifies the alpha channel of the surface pixels based on the mask. More... | |
| std::size_t | apply_surface_opacity_simd (surface &surf, const uint8_t alpha_mod) |
| Applies an alpha modification to the whole surface using SIMD. More... | |
| std::size_t | adjust_surface_color_simd (surface &surf, const int r, const int g, const int b) |
| Adjusts the color channels of a surface using saturated SIMD arithmetic. More... | |
| std::size_t | flip_image_simd (surface &surf) |
| Flips each row of pixels (horizontal mirror) using SIMD. More... | |
| #define SIMD_NEON 0 |
Definition at line 44 of file utils_simd.cpp.
| #define SIMD_SSE2 0 |
Definition at line 43 of file utils_simd.cpp.
| std::size_t adjust_surface_color_simd | ( | surface & | surf, |
| int | r, | ||
| int | g, | ||
| int | b | ||
| ) |
Adjusts the color channels of a surface using saturated SIMD arithmetic.
| surf | The surface to modify. |
| r,g,b | Amounts to add (positive) or subtract (negative) per channel. Clamped to [-255, 255]. |
Definition at line 337 of file utils_simd.cpp.
References surface::area(), b, g, surface_locker< T >::pixels(), simd::SIMD_THRESHOLD, and surf.
Referenced by adjust_surface_color().
| std::size_t apply_surface_opacity_simd | ( | surface & | surf, |
| uint8_t | alpha_mod | ||
| ) |
Applies an alpha modification to the whole surface using SIMD.
| surf | The surface to modify. |
| alpha_mod | The 0-255 modifier to multiply the existing alpha by. |
Definition at line 320 of file utils_simd.cpp.
References surface::area(), surface_locker< T >::pixels(), simd::SIMD_THRESHOLD, and surf.
Referenced by apply_surface_opacity().
| std::size_t flip_image_simd | ( | surface & | surf | ) |
Flips each row of pixels (horizontal mirror) using SIMD.
| surf | The surface to modify. |
Definition at line 354 of file utils_simd.cpp.
References surface::area(), surface_locker< T >::pixels(), simd::SIMD_THRESHOLD, and surf.
Referenced by flip_surface().
Modifies the alpha channel of the surface pixels based on the mask.
| surf | The surface to modify. |
| mask | The mask surface to read alpha values from. |
| empty | Output: set to false if any resulting pixel is non-transparent. Should be initialised to true by the caller. |
Definition at line 302 of file utils_simd.cpp.
References surface::area(), surface_locker< T >::pixels(), simd::SIMD_THRESHOLD, and surf.
Referenced by mask_surface().