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


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 | |||
| ) |
| QString SCRIBUS_API colorSpaceText | ( | int | cs | ) |
return the translated colorspace name
Definition at line 586 of file util_color.cpp.
References CommonStrings::trCMYK, CommonStrings::trDuotone, CommonStrings::trGrayscale, CommonStrings::trRGB, and CommonStrings::trUnknownCS.
Referenced by PageItem_ImageFrame::createInfoGroup(), PicSearch::createPreview(), FDialogPreview::GenPreview(), PicStatus::imageSelected(), and PageItem_ImageFrame::infoDescription().
| double SCRIBUS_API getCurveYValue | ( | FPointArray & | curve, | |
| double | x, | |||
| bool | linear = false | |||
| ) |
Definition at line 479 of file util_color.cpp.
References p, FPointArray::point(), FPointArray::size(), FPoint::x(), and FPoint::y().
Referenced by ScImage::doGraduate(), ScImage::duotone(), KCurve::getCurveValue(), ScImgDataLoader_PSD::LoadPSDResources(), ScImage::quadtone(), and ScImage::tritone().
| QPixmap SCRIBUS_API* getFancyPixmap | ( | const ScColor & | col, | |
| ScribusDoc * | doc | |||
| ) |
Definition at line 222 of file util_color.cpp.
References code64(), colorModelCMYK, ScColor::getColorModel(), ScColor::getRawRGBColor(), getSmallPixmap(), ScColorEngine::isOutOfGamut(), ScColor::isRegistrationColor(), ScColor::isSpotColor(), loadIcon(), and paintAlert().
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.
Definition at line 162 of file util_color.cpp.
References p.
Referenced by getFancyPixmap().
| QPixmap SCRIBUS_API* getWidePixmap | ( | QColor | rgb | ) |
Definition at line 183 of file util_color.cpp.
Referenced by SMLineStyle::rebuildList(), SMLineStyleWidget::updateLineList(), and SMLineStyle::updateSList().
| 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().
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().
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.
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 LumD | ( | double | red, | |
| double | green, | |||
| double | blue | |||
| ) |
| 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 | |||
| ) |
Definition at line 122 of file util_color.cpp.
References ScribusDoc::HasCMS, ScribusDoc::SoftProofing, ScribusDoc::stdProofImg, and ScribusDoc::stdTransImg.
Referenced by ColorChart::drawPalette().
Definition at line 397 of file util_color.cpp.
Referenced by ScImgDataLoader_TIFF::blendOntoTarget(), ScPainter::endLayer(), ScImgDataLoader_TIFF::loadLayerChannels(), and ScImgDataLoader_PSD::loadLayerChannels().
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 | |||
| ) |
Definition at line 151 of file util_color.cpp.
References ScColorEngine::getShadeColorProof(), and ScribusDoc::PageColors.
Referenced by Scribus13Format::loadFile(), Scribus134Format::loadFile(), Scribus12Format::loadFile(), Scribus13Format::loadPage(), Scribus134Format::loadPage(), Scribus12Format::loadPage(), ScriXmlDoc::ReadElem(), and Serializer::updateGradientColors().
Definition at line 551 of file util_color.cpp.
References clipColor(), and Lum().
Referenced by ScPainter::endLayer().
