ckb-next  v0.2.8 at branch master
ckb-next driver for corsair devices
 All Data Structures Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
kbanim.cpp File Reference
#include <cmath>
#include <QDateTime>
#include <QMetaEnum>
#include <QDebug>
#include "ckbsettings.h"
#include "kbanim.h"
+ Include dependency graph for kbanim.cpp:

Go to the source code of this file.

Typedefs

typedef float(* blendFunc )(float, float)
 

Functions

static float blendNormal (float bg, float fg)
 
static float blendAdd (float bg, float fg)
 
static float blendSubtract (float bg, float fg)
 
static float blendMultiply (float bg, float fg)
 
static float blendDivide (float bg, float fg)
 

Variables

static blendFunc functions [5] = { blendNormal, blendAdd, blendSubtract, blendMultiply, blendDivide }
 

Typedef Documentation

typedef float(* blendFunc)(float, float)

Definition at line 362 of file kbanim.cpp.

Function Documentation

static float blendAdd ( float  bg,
float  fg 
)
static

Definition at line 337 of file kbanim.cpp.

337  {
338  float res = bg + fg;
339  if(res > 1.f)
340  res = 1.f;
341  return res;
342 }
static float blendDivide ( float  bg,
float  fg 
)
static

Definition at line 355 of file kbanim.cpp.

355  {
356  float res = bg / fg;
357  if(res > 1.f)
358  res = 1.f;
359  return res;
360 }
static float blendMultiply ( float  bg,
float  fg 
)
static

Definition at line 351 of file kbanim.cpp.

351  {
352  return bg * fg;
353 }
static float blendNormal ( float  bg,
float  fg 
)
static

Definition at line 333 of file kbanim.cpp.

333  {
334  return fg;
335 }
static float blendSubtract ( float  bg,
float  fg 
)
static

Definition at line 344 of file kbanim.cpp.

344  {
345  float res = bg - fg;
346  if(res < 0.f)
347  res = 0.f;
348  return res;
349 }

Variable Documentation

Definition at line 363 of file kbanim.cpp.

Referenced by KbAnim::blend().