#include <smmintrin.h>
#include <stdint.h>
Go to the source code of this file.
|
| void | motionBlurSSE4 (uint32_t *frame, uint32_t *previous, uint16_t blend, size_t size) |
| | Blend the previous frame into the current one (motion blur).
|
| void | fadeToSSE4 (uint32_t *frame, size_t size, uint32_t color, uint16_t factor) |
| | Fade the frame towards a solid color.
|
| void | darken4SSE4 (uint32_t *p0, uint32_t *p1, uint32_t *p2, uint32_t *p3, uint16_t factor) |
| | Scale 4 scattered pixels by a common factor.
|
| void | vignetteSSE4 (uint32_t *frame, size_t width, size_t height, int inner_radius, int outer_radius) |
| | Apply a circular vignette (darkened corners).
|
| void | gammaSSE4 (uint32_t *frame, size_t width, size_t height, float ks[3]) |
| | Apply a per-channel smoothstep tone curve.
|
◆ darken4SSE4()
| void darken4SSE4 |
( |
uint32_t * | p0, |
|
|
uint32_t * | p1, |
|
|
uint32_t * | p2, |
|
|
uint32_t * | p3, |
|
|
uint16_t | factor ) |
|
inline |
Scale 4 scattered pixels by a common factor.
- Parameters
-
| factor | Q8 darkening factor (0 .. 256 = black .. unchanged) |
◆ fadeToSSE4()
| void fadeToSSE4 |
( |
uint32_t * | frame, |
|
|
size_t | size, |
|
|
uint32_t | color, |
|
|
uint16_t | factor ) |
|
inline |
Fade the frame towards a solid color.
- Parameters
-
| frame | frame to fade, in place |
| size | number of pixels (the trailing size % 4 pixels are untouched) |
| color | packed ARGB target color |
| factor | Q8 fade amount (0 .. 256 = no change .. full color) |
◆ gammaSSE4()
| void gammaSSE4 |
( |
uint32_t * | frame, |
|
|
size_t | width, |
|
|
size_t | height, |
|
|
float | ks[3] ) |
|
inline |
Apply a per-channel smoothstep tone curve.
- Parameters
-
| ks | per-channel gains {kr, kg, kb} (1.0 = full smoothstep) |
◆ motionBlurSSE4()
| void motionBlurSSE4 |
( |
uint32_t * | frame, |
|
|
uint32_t * | previous, |
|
|
uint16_t | blend, |
|
|
size_t | size ) |
|
inline |
Blend the previous frame into the current one (motion blur).
DIE ENGINE Depth Integration Engine / A modern ray-caster (c) Fred's Lab 2024-2026 Frédéric Meslin / info@.nosp@m.fred.nosp@m.slab..nosp@m.net SPDX-License-Identifier: MIT If used commercially, contributions, donations are highly appreciated.
postfx functions
- Parameters
-
| frame | current frame, receives the blended result |
| previous | previous frame, overwritten with the blended result |
| blend | Q8 blend factor (0 .. 256 = no blur .. full previous frame) |
| size | number of pixels (the trailing size % 4 pixels are untouched) |
◆ vignetteSSE4()
| void vignetteSSE4 |
( |
uint32_t * | frame, |
|
|
size_t | width, |
|
|
size_t | height, |
|
|
int | inner_radius, |
|
|
int | outer_radius ) |
|
inline |
Apply a circular vignette (darkened corners).
- Parameters
-
| inner_radius | radius where the darkening starts, in pixels |
| outer_radius | radius where the frame turns black, in pixels |