Beatmup
Kernels::ApplySepia< in_t, out_t > Class Template Reference

Application of sepia filter on CPU. More...

Static Public Member Functions

static void process (AbstractBitmap &input, AbstractBitmap &output, int x, int y, msize nPix)
 

Detailed Description

template<class in_t, class out_t>
class Kernels::ApplySepia< in_t, out_t >

Application of sepia filter on CPU.

Definition at line 30 of file sepia.cpp.

Member Function Documentation

◆ process()

template<class in_t , class out_t >
static void Kernels::ApplySepia< in_t, out_t >::process ( AbstractBitmap input,
AbstractBitmap output,
int  x,
int  y,
msize  nPix 
)
inlinestatic

Definition at line 32 of file sepia.cpp.

32  {
33  in_t in(input, x, y);
34  out_t out(output, x, y);
35  static const pixint3
36  R{ 100, 196, 48 },
37  G{ 89, 175, 43 },
38  B{ 69, 138, 33 };
39 
40  for (msize n = 0; n < nPix; n++) {
41  pixint4 P = (pixint4)in();
42  out.assign(
43  (P.r * R.r + P.g * R.g + P.b * R.b) / 255,
44  (P.r * G.r + P.g * G.g + P.b * G.b) / 255,
45  (P.r * B.r + P.g * B.g + P.b * B.b) / 255,
46  P.a
47  );
48  in++;
49  out++;
50  }
51  }
uint32_t msize
memory size
Definition: basic_types.h:30
const int B
Definition: bitmap_access.h:31
const int R
Definition: bitmap_access.h:31
const int G
Definition: bitmap_access.h:31
Trichromatic integer arithmetic.
4-channel integer arithmetic
jobject jlong jint jint y
jobject jlong jint x
JNIEnv jlong jint out
int n

The documentation for this class was generated from the following file: