- for( int i=0; i<3; ++i )
- delete vframes[i];
-}
-
-void SketcherCurveColor::set_color(int color)
-{
- this->color = color;
- int r = (color>>16) & 0xff;
- int g = (color>>8) & 0xff;
- int b = (color>>0) & 0xff;
- for( int i=0; i<3; ++i ) {
- VFrame *vframe = vframes[i];
- int ww = vframe->get_w(), hh = vframe->get_h();
- uint8_t **rows = vframe->get_rows();
- int rr = r, gg = g, bb = b;
- switch( i ) {
- case BUTTON_UP:
- break;
- case BUTTON_UPHI:
- if( (rr+=48) > 0xff ) rr = 0xff;
- if( (gg+=48) > 0xff ) gg = 0xff;
- if( (bb+=48) > 0xff ) bb = 0xff;
- break;
- case BUTTON_DOWNHI:
- if( (rr-=48) < 0x00 ) rr = 0x00;
- if( (gg-=48) < 0x00 ) gg = 0x00;
- if( (bb-=48) < 0x00 ) bb = 0x00;
- break;
- }
- for( int y=0; y<hh; ++y ) {
- uint8_t *rp = rows[y];
- for( int x=0; x<ww; ++x ) {
- *rp++ = rr; *rp++ = gg; *rp++ = bb;
- }
- }
- }
- set_images(vframes);
-}
-
-void SketcherCurveColor::update_gui(int color)
-{
- set_color(color);
- draw_face();
-}
-
-int SketcherCurveColor::handle_event()
-{
- gui->start_color_thread(this);
- return 1;
-}
-
-SketcherCurveColorPicker::SketcherCurveColorPicker(SketcherWindow *gui, SketcherCurveColor *color_button)
- : ColorPicker(1, _("Color"))
-{
- this->gui = gui;
- this->color_button = color_button;
- this->color = CV_COLOR;
- color_update = new SketcherCurveColorThread(this);
-}
-
-SketcherCurveColorPicker::~SketcherCurveColorPicker()
-{
- delete color_update;