Scribus Developer Documentation - API
logo-pen

Scribus Developer Documentation - API

util_color.h File Reference

#include <QColor>
#include <QImage>
#include <QPixmap>
#include <QString>
#include "fpointarray.h"
#include "sccolor.h"
#include "scribusapi.h"

Include dependency graph for util_color.h:

This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Functions

QColor SCRIBUS_API SetColor (ScribusDoc *currentDoc, QString color, int shad)
QPixmap SCRIBUS_API * getSmallPixmap (QColor rgb)
 Create a cool all-infos pixmaps for the specified color.
QPixmap SCRIBUS_API * getWidePixmap (QColor rgb)
QPixmap SCRIBUS_API * getFancyPixmap (const ScColor &col, ScribusDoc *doc)
void SCRIBUS_API paintAlert (QPixmap &toPaint, QPixmap &target, int x=0, int y=0, bool useMask=true)
 Put toPaint pixmap into target at the x, y place. There is handled the alpha channel/transparency too. In the beginning is the target pixmap filled with all_transparent mask. In the case of the painting of tiPaint into x, y place, there is this pixmap enabled in alpha mask too.
QImage SCRIBUS_API ProofImage (QImage *Im, ScribusDoc *doc)
void SCRIBUS_API handleOldColorShade (ScribusDoc *doc, QString &colName, int &shade)
 Associate a color shade to a document color according to pre-1.3.4cvs rgb shade calculation method, creating new document color if necessary.
QColor SCRIBUS_API getOldColorShade (const QColor &color, int shade)
 Compute color shade of a rgb color using pre-1.3.4 method.
QColor SCRIBUS_API getOldColorShade (uchar red, uchar green, uchar blue, int shade)
 Compute color shade of a rgb color using pre-1.3.4 method.
unsigned char SCRIBUS_API INT_MULT (unsigned char a, unsigned char b)
 Convert a color in RGB space to HSV space (Hue, Saturation, Value).
void SCRIBUS_API RGBTOHSV (uchar &red, uchar &green, uchar &blue)
 Convert a color in HSV space to RGB space.
void SCRIBUS_API HSVTORGB (uchar &hue, uchar &saturation, uchar &value)
 Convert a color in RGB space to HLS space (Hue, Lightness, Saturation).
void SCRIBUS_API RGBTOHLS (uchar &red, uchar &green, uchar &blue)
double SCRIBUS_API HLSVALUE (double n1, double n2, double hue)
 Implement the HLS "double hex-cone".
void SCRIBUS_API HLSTORGB (uchar &hue, uchar &lightness, uchar &saturation)
 Convert a color in HLS space to RGB space.
double SCRIBUS_API getCurveYValue (FPointArray &curve, double x, bool linear=false)
double SCRIBUS_API Lum (uchar red, uchar green, uchar blue)
double SCRIBUS_API LumD (double red, double green, double blue)
void SCRIBUS_API setLum (uchar &red, uchar &green, uchar &blue, double lum)
void SCRIBUS_API clipColor (double &red, double &green, double &blue)
QString SCRIBUS_API colorSpaceText (int cs)
 return the translated colorspace name


Function Documentation

void SCRIBUS_API clipColor ( double &  red,
double &  green,
double &  blue 
)

Definition at line 567 of file util_color.cpp.

References LumD().

Referenced by setLum().

QString SCRIBUS_API colorSpaceText ( int  cs  ) 

double SCRIBUS_API getCurveYValue ( FPointArray curve,
double  x,
bool  linear = false 
)

QPixmap SCRIBUS_API* getFancyPixmap ( const ScColor col,
ScribusDoc doc 
)

QColor SCRIBUS_API getOldColorShade ( uchar  red,
uchar  green,
uchar  blue,
int  shade 
)

Compute color shade of a rgb color using pre-1.3.4 method.

Parameters:
red the red component.
green the green component.
blue the blue component.
shade shade value.

Definition at line 104 of file util_color.cpp.

QColor SCRIBUS_API getOldColorShade ( const QColor &  color,
int  shade 
)

Compute color shade of a rgb color using pre-1.3.4 method.

Parameters:
color the base color
shade shade value.

Definition at line 97 of file util_color.cpp.

References getOldColorShade().

Referenced by getOldColorShade(), and handleOldColorShade().

QPixmap SCRIBUS_API* getSmallPixmap ( QColor  rgb  ) 

Create a cool all-infos pixmaps for the specified color.

Parameters:
col Scribus color
Return values:
QPixmap image with various icons depending on the col properties.
QPixmaps are really slow with Qt/Mac 3.3.4. Really, *really*, slow. So we better cache them.

Definition at line 162 of file util_color.cpp.

References p.

Referenced by getFancyPixmap().

QPixmap SCRIBUS_API* getWidePixmap ( QColor  rgb  ) 

void SCRIBUS_API handleOldColorShade ( ScribusDoc doc,
QString &  colName,
int &  shade 
)

Associate a color shade to a document color according to pre-1.3.4cvs rgb shade calculation method, creating new document color if necessary.

Parameters:
doc the scribus document
colName the color name (modified in place)
shade the color level (modified in place)

Definition at line 58 of file util_color.cpp.

References colorModelRGB, ScColor::fromQColor(), ScColor::getColorModel(), getOldColorShade(), ScColor::getRGB(), CommonStrings::None, and ScribusDoc::PageColors.

Referenced by Scribus13Format::GetItemText(), Scribus12Format::GetItemText(), Scribus12Format::GetStyle(), Scribus13Format::loadFile(), Scribus12Format::loadFile(), Scribus13Format::loadPage(), Scribus12Format::loadPage(), Scribus13Format::PasteItem(), and Scribus13Format::readParagraphStyle().

void SCRIBUS_API HLSTORGB ( uchar hue,
uchar lightness,
uchar saturation 
)

Convert a color in HLS space to RGB space.

Parameters:
hue the hue component (modified in place).
lightness the lightness component (modified in place).
saturation the saturation component (modified in place).

Definition at line 456 of file util_color.cpp.

References HLSVALUE().

Referenced by ScImgDataLoader_TIFF::blendOntoTarget(), ScPainter::endLayer(), ScImgDataLoader_TIFF::loadLayerChannels(), and ScImgDataLoader_PSD::loadLayerChannels().

double SCRIBUS_API HLSVALUE ( double  n1,
double  n2,
double  hue 
)

Implement the HLS "double hex-cone".

Parameters:
n1 lightness fraction (?)
n2 saturation fraction (?)
hue hue "angle".
Returns:
HLS value.

Definition at line 441 of file util_color.cpp.

Referenced by HLSTORGB().

void SCRIBUS_API HSVTORGB ( uchar hue,
uchar saturation,
uchar value 
)

Convert a color in RGB space to HLS space (Hue, Lightness, Saturation).

Parameters:
red the red component (modified in place).
green the green component (modified in place).
blue the blue component (modified in place).

Definition at line 342 of file util_color.cpp.

References int(), and p.

Referenced by ScImgDataLoader_TIFF::blendOntoTarget(), ScImgDataLoader_TIFF::loadLayerChannels(), ScImgDataLoader_PSD::loadLayerChannels(), and ScImgDataLoader_PSD::LoadPSDResources().

unsigned char SCRIBUS_API INT_MULT ( unsigned char  a,
unsigned char  b 
)

Convert a color in RGB space to HSV space (Hue, Saturation, Value).

Parameters:
red the red component (modified in place).
green the green component (modified in place).
blue the blue component (modified in place).

Definition at line 290 of file util_color.cpp.

Referenced by ScImgDataLoader_TIFF::blendOntoTarget(), ScPainter::endLayer(), ScImgDataLoader_TIFF::loadLayerChannels(), and ScImgDataLoader_PSD::loadLayerChannels().

double SCRIBUS_API Lum ( uchar  red,
uchar  green,
uchar  blue 
)

Definition at line 541 of file util_color.cpp.

Referenced by ScPainter::endLayer(), and setLum().

double SCRIBUS_API LumD ( double  red,
double  green,
double  blue 
)

Definition at line 546 of file util_color.cpp.

Referenced by clipColor().

void SCRIBUS_API paintAlert ( QPixmap &  toPaint,
QPixmap &  target,
int  x = 0,
int  y = 0,
bool  useMask = true 
)

Put toPaint pixmap into target at the x, y place. There is handled the alpha channel/transparency too. In the beginning is the target pixmap filled with all_transparent mask. In the case of the painting of tiPaint into x, y place, there is this pixmap enabled in alpha mask too.

Parameters:
toPaint a pixmap to be painted into target
target a base pixmap. Some kind of painter.
x coordinate
y coordinate

Definition at line 264 of file util_color.cpp.

References p.

Referenced by CMYKChoose::CMYKChoose(), getFancyPixmap(), ColorFancyItemDelegate::redraw(), CMYKChoose::SelFromSwatch(), CMYKChoose::SelModel(), CMYKChoose::setColor(), and CMYKChoose::setColor2().

QImage SCRIBUS_API ProofImage ( QImage *  Im,
ScribusDoc doc 
)

void SCRIBUS_API RGBTOHLS ( uchar red,
uchar green,
uchar blue 
)

void SCRIBUS_API RGBTOHSV ( uchar red,
uchar green,
uchar blue 
)

Convert a color in HSV space to RGB space.

Parameters:
hue the hue component (modified in place).
saturation the saturation component (modified in place).
value the value component (modified in place).

Definition at line 296 of file util_color.cpp.

Referenced by ScImgDataLoader_TIFF::blendOntoTarget(), ScImgDataLoader_TIFF::loadLayerChannels(), and ScImgDataLoader_PSD::loadLayerChannels().

QColor SCRIBUS_API SetColor ( ScribusDoc currentDoc,
QString  color,
int  shad 
)

void SCRIBUS_API setLum ( uchar red,
uchar green,
uchar blue,
double  lum 
)

Definition at line 551 of file util_color.cpp.

References clipColor(), and Lum().

Referenced by ScPainter::endLayer().

Created with personalized Doxygen. This is documentation for GPL software Scribus - Open Source Desktop Publishing.