From bbb94cb64f2434b51e62a3a136a7d703c8c76e91 Mon Sep 17 00:00:00 2001 From: "[CST] Focus" Date: Wed, 10 Jul 2013 19:32:04 +0400 Subject: [PATCH] gui/widget/colorchooser.cpp: add getColor() member Origin commit data ------------------ Branch: ni/coolstream Commit: https://github.com/neutrino-images/ni-neutrino/commit/1f02a0d49e6f807536ce26be169b4b98fc5f2887 Author: [CST] Focus Date: 2013-07-10 (Wed, 10 Jul 2013) ------------------ No further description and justification available within origin commit message! ------------------ This commit was generated by Migit --- src/gui/widget/colorchooser.cpp | 13 +++++++------ src/gui/widget/colorchooser.h | 1 + 2 files changed, 8 insertions(+), 6 deletions(-) diff --git a/src/gui/widget/colorchooser.cpp b/src/gui/widget/colorchooser.cpp index 075155a9d..d23fff11f 100644 --- a/src/gui/widget/colorchooser.cpp +++ b/src/gui/widget/colorchooser.cpp @@ -98,15 +98,16 @@ CColorChooser::CColorChooser(const neutrino_locale_t Name, unsigned char *R, uns } void CColorChooser::setColor() +{ + frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, getColor()); +} + +fb_pixel_t CColorChooser::getColor() { int color = convertSetupColor2RGB(*(value[VALUE_R]), *(value[VALUE_G]), *(value[VALUE_B])); - int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0; + int tAlpha = (value[VALUE_ALPHA]) ? (convertSetupAlpha2Alpha(*(value[VALUE_ALPHA]))) : 0xFF; - if(!value[VALUE_ALPHA]) tAlpha = 0xFF; - - fb_pixel_t col = ((tAlpha << 24) & 0xFF000000) | color; - //((tAlpha << 24) & 0xFF000000) | ((color << 16) & 0x00FF0000) | (color & 0x0000FF00) | ((color >> 16) & 0xFF); - frameBuffer->paintBoxRel(x+offset+162,y+hheight+2+5, mheight*4-4 ,mheight*4-4-10, col); + return (((tAlpha << 24) & 0xFF000000) | color); } int CColorChooser::exec(CMenuTarget* parent, const std::string &) diff --git a/src/gui/widget/colorchooser.h b/src/gui/widget/colorchooser.h index 50bc61734..f2ff70c90 100644 --- a/src/gui/widget/colorchooser.h +++ b/src/gui/widget/colorchooser.h @@ -67,6 +67,7 @@ class CColorChooser : public CMenuTarget void hide(); int exec(CMenuTarget* parent, const std::string & actionKey); + fb_pixel_t getColor(void); };