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
keywidget.cpp File Reference
#include <cmath>
#include <QGraphicsDropShadowEffect>
#include <QGraphicsPixmapItem>
#include <QGraphicsScene>
#include <QPainter>
#include "keywidget.h"
#include "keyaction.h"
#include "kbbind.h"
+ Include dependency graph for keywidget.cpp:

Go to the source code of this file.

Functions

QRgb monoRgb (float r, float g, float b)
 

Variables

static const int KEY_SIZE = 12
 
static QImage * m65Overlay = 0
 
static QImage * sabOverlay = 0
 
static QImage * scimOverlay = 0
 
static QImage * harpOverlay = 0
 
static QImage * glaiveOverlay = 0
 

Function Documentation

QRgb monoRgb ( float  r,
float  g,
float  b 
)

Definition at line 284 of file kblight.cpp.

References lToS(), and sToL().

Referenced by KbLight::base(), KbLight::frameUpdate(), and KeyWidget::paintEvent().

284  {
285  // It's important to use a linear colorspace for this, otherwise the colors will appear inconsistent
286  // Note that although we could use linear space for alpha blending or the animation blending functions, we don't.
287  // The reason for this is that photo manipulation programs don't do it either, so even though the result would technically be more correct,
288  // it would look wrong to most people.
289  r = sToL(r);
290  g = sToL(g);
291  b = sToL(b);
292  int value = round(lToS((r + g + b) / 3.f));
293  return qRgb(value, value, value);
294 }
static float sToL(float srgb)
Definition: kblight.cpp:270
static float lToS(float linear)
Definition: kblight.cpp:277

+ Here is the call graph for this function:

+ Here is the caller graph for this function:

Variable Documentation

QImage * glaiveOverlay = 0
static

Definition at line 12 of file keywidget.cpp.

Referenced by KeyWidget::paintEvent().

QImage * harpOverlay = 0
static

Definition at line 12 of file keywidget.cpp.

Referenced by KeyWidget::paintEvent().

const int KEY_SIZE = 12
static

Definition at line 10 of file keywidget.cpp.

Referenced by KeyWidget::drawInfo(), and KeyWidget::map().

QImage* m65Overlay = 0
static

Definition at line 12 of file keywidget.cpp.

Referenced by KeyWidget::paintEvent().

QImage * sabOverlay = 0
static

Definition at line 12 of file keywidget.cpp.

Referenced by KeyWidget::paintEvent().

QImage * scimOverlay = 0
static

Definition at line 12 of file keywidget.cpp.

Referenced by KeyWidget::paintEvent().