#include "bcbutton.h"
#include "bccapture.h"
+#include "bccolors.h"
#include "bcdisplayinfo.h"
#include "colorpicker.h"
#include "condition.h"
#include "language.h"
#include "mutex.h"
#include "mwindow.h"
-#include "cicolors.h"
+#include "bccolors.h"
#include "vframe.h"
#include <string.h>
#include <unistd.h>
-#undef MSGQUAL
-#define MSGQUAL "colorpicker"
-
#define PALETTE_DATA "palette.dat"
-ColorThread::ColorThread(int do_alpha, const char *title)
+ColorPicker::ColorPicker(int do_alpha, const char *title)
: BC_DialogThread()
{
this->title = title;
this->alpha = 255;
}
-ColorThread::~ColorThread()
+ColorPicker::~ColorPicker()
{
close_window();
}
-void ColorThread::start_window(int output, int alpha, int do_okcancel)
+void ColorPicker::start_window(int output, int alpha, int do_okcancel)
{
if( running() ) {
ColorWindow *gui = (ColorWindow *)get_gui();
if( gui ) {
- gui->lock_window("ColorThread::start_window");
+ gui->lock_window("ColorPicker::start_window");
gui->raise_window(1);
gui->unlock_window();
}
start();
}
-BC_Window* ColorThread::new_gui()
+BC_Window* ColorPicker::new_gui()
{
char window_title[BCTEXTLEN];
strcpy(window_title, _(PROGRAM_NAME ": "));
return gui;
}
-void ColorThread::update_gui(int output, int alpha)
+void ColorPicker::update_gui(int output, int alpha)
{
ColorWindow *gui = (ColorWindow *)get_gui();
if( !gui ) return;
gui->unlock_window();
}
-int ColorThread::handle_new_color(int output, int alpha)
+int ColorPicker::handle_new_color(int output, int alpha)
{
- printf("ColorThread::handle_new_color undefined.\n");
+ printf("ColorPicker::handle_new_color undefined.\n");
return 0;
}
-ColorWindow::ColorWindow(ColorThread *thread, int x, int y, int w, int h, const char *title)
+ColorWindow::ColorWindow(ColorPicker *thread, int x, int y, int w, int h, const char *title)
: BC_Window(title, x, y, w, h, w, h, 0, 0, 1)
{
this->thread = thread;
void ColorWindow::get_screen_sample()
{
int cx, cy;
- get_abs_cursor_xy(cx, cy);
+ get_abs_cursor(cx, cy);
BC_Capture capture_bitmap(1, 1, 0);
VFrame vframe(1,1,BC_RGB888);
capture_bitmap.capture_frame(&vframe, cx,cy);
void PaletteWheelValue::create_objects()
{
- frame = new VFrame(0, -1, get_w(), get_h(), BC_RGB888, -1);
+ frame = new VFrame(get_w(), get_h(), BC_RGB888);
draw(window->hsv.h, window->hsv.s, window->hsv.v);
flash();
}
void ColorWindow::update_rgb(float r, float g, float b)
{
{ float y, u, v;
- YUV::rgb_to_yuv_f(r, g, b, y, u, v);
+ YUV::yuv.rgb_to_yuv_f(r, g, b, y, u, v);
u += 0.5; v += 0.5;
bclamp(y, 0, 1); yuv.y = y;
bclamp(u, 0, 1); yuv.u = u;
{
u -= 0.5; v -= 0.5;
{ float r, g, b;
- YUV::yuv_to_rgb_f(r, g, b, y, u, v);
+ YUV::yuv.yuv_to_rgb_f(r, g, b, y, u, v);
bclamp(r, 0, 1); rgb.r = r;
bclamp(g, 0, 1); rgb.g = g;
bclamp(b, 0, 1); rgb.b = b;
bclamp(g, 0, 1); rgb.g = g;
bclamp(b, 0, 1); rgb.b = b;
float y, u, v;
- YUV::rgb_to_yuv_f(r, g, b, y, u, v);
+ YUV::yuv.rgb_to_yuv_f(r, g, b, y, u, v);
u += 0.5; v += 0.5;
bclamp(y, 0, 1); yuv.y = y;
bclamp(u, 0, 1); yuv.u = u;