Subversion Repositories Scribus

Rev

Rev 6125 | Rev 6795 | Go to most recent revision | Details | Compare with Previous | Last modification | View Log | RSS feed

Rev Author Line No. Line
6125 cbradney 1
/*
2
For general Scribus (>=1.3.2) copyright and licensing information please refer
3
to the COPYING file provided with the program. Following this notice may exist
4
a copyright and/or license notice that predates the release of Scribus 1.3.2
5
for which a new license (GPL+exception) is in place.
6
*/
7
#ifndef COLORUTIL_H
8
#define COLORUTIL_H
9
 
10
#include <qcolor.h>
11
#include <qimage.h>
12
#include <qpixmap.h>
13
#include <qstring.h>
14
 
15
#include "fpointarray.h"
16
#include "sccolor.h"
17
#include "scribusapi.h"
18
 
19
class ScribusDoc;
20
 
21
QColor SCRIBUS_API SetColor(ScribusDoc *currentDoc, QString color, int shad);
22
QPixmap SCRIBUS_API *getSmallPixmap(QColor rgb);
23
QPixmap SCRIBUS_API *getWidePixmap(QColor rgb);
24
/*! \brief Create a cool all-infos pixmaps for the specified color.
25
\param col Scribus color
26
\retval QPixmap image with various icons depending on the col properties.
27
*/
28
QPixmap SCRIBUS_API *getFancyPixmap(ScColor col);
29
/*! \brief Put toPaint pixmap into target at the x, y place.
30
There is handled the alpha channel/transparency too. In the beginning
31
is the target pixmap filled with all_transparent mask. In the case of
32
the painting of tiPaint into x, y place, there is this pixmap enabled
33
in alpha mask too.
34
\param toPaint a pixmap to be painted into target
35
\param target a base pixmap. Some kind of painter.
36
\param x coordinate
37
\param y coordinate
38
*/
39
void SCRIBUS_API paintAlert(QPixmap &toPaint, QPixmap &target, int x = 0, int y = 0, bool useMask = true);
40
QImage SCRIBUS_API ProofImage(QImage *Im, ScribusDoc* doc);
41
 
42
/*! \brief Convert a color in RGB space to HSV space (Hue, Saturation, Value).
43
 * \param red the red component (modified in place).
44
 * \param green the green component (modified in place).
45
 * \param blue the blue component (modified in place).
46
 */
47
unsigned char SCRIBUS_API INT_MULT ( unsigned char a, unsigned char b );
48
/*! \brief Convert a color in HSV space to RGB space.
49
 * \param hue the hue component (modified in place).
50
 * \param saturation the saturation component (modified in place).
51
 * \param value the value component (modified in place).
52
 */
53
void SCRIBUS_API RGBTOHSV ( uchar& red, uchar& green, uchar& blue );
54
/*! \brief Convert a color in RGB space to HLS space (Hue, Lightness, Saturation).
55
 * \param red the red component (modified in place).
56
 * \param green the green component (modified in place).
57
 * \param blue the blue component (modified in place).
58
 */
59
void SCRIBUS_API HSVTORGB ( uchar& hue, uchar& saturation, uchar& value );
60
void SCRIBUS_API RGBTOHLS ( uchar& red, uchar& green, uchar& blue );
61
/*! \brief Implement the HLS "double hex-cone".
62
 * \param n1 lightness fraction (?)
63
 * \param n2 saturation fraction (?)
64
 * \param hue hue "angle".
65
 * \return HLS value.
66
 */
67
int SCRIBUS_API HLSVALUE ( double n1, double n2, double hue );
68
/*! \brief Convert a color in HLS space to RGB space.
69
 * \param hue the hue component (modified in place).
70
 * \param lightness the lightness component (modified in place).
71
 * \param saturation the saturation component (modified in place).
72
 */
73
void SCRIBUS_API HLSTORGB ( uchar& hue, uchar& lightness, uchar& saturation );
74
 
6193 fschmid 75
double SCRIBUS_API getCurveYValue(FPointArray &curve, double x, bool linear = false);
6125 cbradney 76
 
77
#endif