~ubuntu-branches/ubuntu/precise/koffice/precise

« back to all changes in this revision

Viewing changes to krita/plugins/colorsfilters/formrgbsliders.ui.h

  • Committer: Bazaar Package Importer
  • Author(s): Jonathan Riddell
  • Date: 2006-04-20 21:38:53 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20060420213853-j5lxluqvymxt2zny
Tags: 1:1.5.0-0ubuntu2
UbuntuĀ uploadĀ 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
/****************************************************************************
2
 
** ui.h extension file, included from the uic-generated form implementation.
3
 
**
4
 
** If you wish to add, delete or rename functions or slots use
5
 
** Qt Designer which will update this file, preserving your code. Create an
6
 
** init() function in place of a constructor, and a destroy() function in
7
 
** place of a destructor.
8
 
*****************************************************************************/
9
 
 
10
 
#define round(x) (int(float(x) + 0.5))
11
 
 
12
 
void FormRGBSliders::slotRedValueChanged( int v )
13
 
{
14
 
    textRedValue->setText(QString().setNum( round(10*(((float)v) / precision))/10 ));
15
 
}
16
 
 
17
 
 
18
 
void FormRGBSliders::slotBlueValueChanged( int v )
19
 
{
20
 
  textBlueValue->setText(QString().setNum( round(10*(((float)v) / precision))/10 ));
21
 
}
22
 
 
23
 
 
24
 
void FormRGBSliders::slotGreenValueChanged( int v )
25
 
{
26
 
  textGreenValue->setText(QString().setNum( round(10*(((float)v) / precision))/10 ));
27
 
}
28
 
 
29
 
 
30
 
void FormRGBSliders::setMaxValue( int eV )
31
 
{
32
 
    sliderGreen->setMaxValue(eV);
33
 
    sliderRed->setMaxValue(eV);
34
 
    sliderBlue->setMaxValue(eV);
35
 
}
36
 
 
37
 
 
38
 
void FormRGBSliders::setMinValue( int eV )
39
 
{
40
 
    sliderGreen->setMinValue(eV);
41
 
    sliderRed->setMinValue(eV);
42
 
    sliderBlue->setMinValue(eV);
43
 
}
44
 
 
45
 
 
46
 
void FormRGBSliders::setPrecision( int eP )
47
 
{
48
 
    if( eP <= 0) return;
49
 
    precision = eP;
50
 
}
51
 
 
52
 
 
53
 
float FormRGBSliders::getGreenValue()
54
 
{
55
 
    return  sliderGreen->value()  / precision;
56
 
}
57
 
 
58
 
 
59
 
float FormRGBSliders::getBlueValue()
60
 
{
61
 
    return  sliderBlue->value()  / precision;
62
 
}
63
 
 
64
 
 
65
 
float FormRGBSliders::getRedValue()
66
 
{
67
 
    return  sliderRed->value()  / precision;
68
 
}
69
 
 
70
 
 
71
 
void FormRGBSliders::init()
72
 
{
73
 
    precision = 1;
74
 
}
75
 
 
76
 
 
77
 
void FormRGBSliders::setInitValue( int v )
78
 
{
79
 
    sliderRed->setValue(v * precision);
80
 
    sliderGreen->setValue(v * precision);
81
 
    sliderBlue->setValue(v * precision);
82
 
}
83
 
 
84
 
 
85
 
void FormRGBSliders::recalculTickInterval()
86
 
{
87
 
    int tickInterval = ( sliderBlue->maxValue() - sliderBlue->minValue() ) / 20;
88
 
    sliderRed->setTickInterval( tickInterval );
89
 
    sliderGreen->setTickInterval( tickInterval );
90
 
    sliderBlue->setTickInterval( tickInterval );
91
 
}