45 static const bool env_disables_simd = std::getenv(
"WESNOTH_NO_SIMD") !=
nullptr;
46 if(env_disables_simd) {
bool is_enabled()
Checks if SIMD hardware acceleration is allowed/enabeled.
constexpr std::size_t SIMD_THRESHOLD
Minimum number of pixels required to trigger SIMD optimizations.
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.
std::size_t flip_image_simd(surface &surf)
Flips each row of pixels (horizontal mirror) using SIMD.
std::size_t apply_surface_opacity_simd(surface &surf, uint8_t alpha_mod)
Applies an alpha modification to the whole surface using SIMD.
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.