ARM NEON Compositor  master
Fast SIMD alpha overlay and blending for ARM
Functions
src/alpha-lib/src/overlay_alpha.cpp File Reference
#include <alpha-lib/overlay_alpha.h>
#include <alpha-lib/overlay_alpha.hpp>
#include "SIMD.h"
#include "rescale.hpp"
#include <cassert>
#include <cstddef>
#include <cstring>
+ Include dependency graph for src/alpha-lib/src/overlay_alpha.cpp:

Go to the source code of this file.

Functions

template<RescaleType rescale_type>
static void overlay_alpha_1 (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img)
 Overlay a single pixel of a foreground image with an alpha channel over one pixel of a background image. More...
 
template<RescaleType rescale_type>
static void overlay_alpha_8 (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img)
 Overlay 8 pixels of a foreground image with an alpha channel over 8 pixels of a background image. More...
 
template<RescaleType rescale_type>
void overlay_alpha_fast (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 Fast function to overlay two images of the same size, where the number of pixels is a multiple of 8. More...
 
template void overlay_alpha_fast< RescaleType::Div255_Round > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 
template void overlay_alpha_fast< RescaleType::Div255_Round_Approx > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 
template void overlay_alpha_fast< RescaleType::Div255_Floor > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 
template void overlay_alpha_fast< RescaleType::Div256_Round > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 
template void overlay_alpha_fast< RescaleType::Div256_Floor > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t n)
 
template<RescaleType rescale_type>
void overlay_alpha_stride (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 Overlay a smaller image with an alpha channel over a larger background image. More...
 
template void overlay_alpha_stride< RescaleType::Div255_Round > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 
template void overlay_alpha_stride< RescaleType::Div255_Round_Approx > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 
template void overlay_alpha_stride< RescaleType::Div255_Floor > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 
template void overlay_alpha_stride< RescaleType::Div256_Round > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 
template void overlay_alpha_stride< RescaleType::Div256_Floor > (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 
void overlay_alpha_stride_div255_round (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 C wrapper for overlay_alpha_stride(). More...
 
void overlay_alpha_stride_div255_round_approx (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 C wrapper for overlay_alpha_stride(). More...
 
void overlay_alpha_stride_div255_floor (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 C wrapper for overlay_alpha_stride(). More...
 
void overlay_alpha_stride_div256_round (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 C wrapper for overlay_alpha_stride(). More...
 
void overlay_alpha_stride_div256_floor (const uint8_t *bg_img, const uint8_t *fg_img, uint8_t *out_img, size_t bg_full_cols, size_t fg_rows, size_t fg_cols, size_t fg_full_cols)
 C wrapper for overlay_alpha_stride(). More...
 

Function Documentation

◆ overlay_alpha_1()

static void overlay_alpha_1 ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img 
)
inlinestatic

Overlay a single pixel of a foreground image with an alpha channel over one pixel of a background image.

This is used as the "readable" documentation version of the code, for the fallback version without NEON intrinsics, and for images with dimensions that are not an multiple of the vector size.

Definition at line 20 of file src/alpha-lib/src/overlay_alpha.cpp.

◆ overlay_alpha_8()

static void overlay_alpha_8 ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img 
)
static

Overlay 8 pixels of a foreground image with an alpha channel over 8 pixels of a background image.

Definition at line 51 of file src/alpha-lib/src/overlay_alpha.cpp.

◆ overlay_alpha_fast< RescaleType::Div255_Round >()

template void overlay_alpha_fast< RescaleType::Div255_Round > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  n 
)

◆ overlay_alpha_fast< RescaleType::Div255_Round_Approx >()

template void overlay_alpha_fast< RescaleType::Div255_Round_Approx > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  n 
)

◆ overlay_alpha_fast< RescaleType::Div255_Floor >()

template void overlay_alpha_fast< RescaleType::Div255_Floor > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  n 
)

◆ overlay_alpha_fast< RescaleType::Div256_Round >()

template void overlay_alpha_fast< RescaleType::Div256_Round > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  n 
)

◆ overlay_alpha_fast< RescaleType::Div256_Floor >()

template void overlay_alpha_fast< RescaleType::Div256_Floor > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  n 
)

◆ overlay_alpha_stride< RescaleType::Div255_Round >()

template void overlay_alpha_stride< RescaleType::Div255_Round > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  bg_full_cols,
size_t  fg_rows,
size_t  fg_cols,
size_t  fg_full_cols 
)

◆ overlay_alpha_stride< RescaleType::Div255_Round_Approx >()

template void overlay_alpha_stride< RescaleType::Div255_Round_Approx > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  bg_full_cols,
size_t  fg_rows,
size_t  fg_cols,
size_t  fg_full_cols 
)

◆ overlay_alpha_stride< RescaleType::Div255_Floor >()

template void overlay_alpha_stride< RescaleType::Div255_Floor > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  bg_full_cols,
size_t  fg_rows,
size_t  fg_cols,
size_t  fg_full_cols 
)

◆ overlay_alpha_stride< RescaleType::Div256_Round >()

template void overlay_alpha_stride< RescaleType::Div256_Round > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  bg_full_cols,
size_t  fg_rows,
size_t  fg_cols,
size_t  fg_full_cols 
)

◆ overlay_alpha_stride< RescaleType::Div256_Floor >()

template void overlay_alpha_stride< RescaleType::Div256_Floor > ( const uint8_t *  bg_img,
const uint8_t *  fg_img,
uint8_t *  out_img,
size_t  bg_full_cols,
size_t  fg_rows,
size_t  fg_cols,
size_t  fg_full_cols 
)