![]() |
Mapper
0.9.0
API documentation
|
The MapColor class provides colors which may be used by symbols (and objects). More...
#include <map_color.h>
Public Types | |
enum | SpecialPriorities { CoveringRed = -1005, CoveringWhite = -1000, Registration = -900, Undefined = -500, Reserved = -1 } |
SpecialProperties provides identifiers for (pseudo-)colors serving particular purposes in the program. More... | |
enum | ColorMethod { UndefinedMethod = 0, CustomColor = 1, SpotColor = 2, CmykColor = 4, RgbColor = 8, Knockout = 16 } |
ColorMethod provides identifiers for methods on how to determine a particular realization of a color. More... | |
Public Member Functions | |
MapColor () | |
Constructs a black CMYK map color of undefined priority. More... | |
MapColor (int priority) | |
Constructs a black CMYK map color with the given priority. More... | |
MapColor (const QString &name, int priority) | |
Constructs a black CMYK map color with the given name and priority. More... | |
MapColor * | duplicate () const |
Returns a copy of the color. More... | |
operator const QColor & () const | |
Returns a QColor representation (reference) of the map color. More... | |
operator QRgb () const | |
Converts the current RGB values to a QRgb. More... | |
const QString & | getName () const |
Returns the color's name for the mapping context. More... | |
void | setName (const QString &name) |
Sets the color's name for the mapping context. More... | |
int | getPriority () const |
Returns the color's priority. More... | |
void | setPriority (int priority) |
Sets the color's priority. More... | |
float | getOpacity () const |
void | setOpacity (float opacity) |
ColorMethod | getSpotColorMethod () const |
Returns how the spot color is to be created. More... | |
const QString & | getSpotColorName () const |
Returns the name for the single spot color or a label for the spot color composition which realizes this map color. More... | |
void | setSpotColorName (const QString &spot_color_id) |
Sets the name of a single spot color which realizes this map color, and sets the spot color method to SpotColor. More... | |
double | getScreenFrequency () const |
Returns the spot color halftone screen frequency in lines per inch. More... | |
void | setScreenFrequency (double value) |
Sets the spot color halftone screen frequency in lines per inch. More... | |
double | getScreenAngle () const |
Returns the spot color halftone screen angle in lines per inch. More... | |
void | setScreenAngle (double value) |
Sets the spot color halftone screen angle in lines per inch. More... | |
void | setSpotColorComposition (const SpotColorComponents &components) |
Sets the given components (i.e. More... | |
const SpotColorComponents & | getComponents () const |
Returns the components of the spot color realization of this color. More... | |
bool | removeSpotColorComponent (const MapColor *color) |
Removes a component color. More... | |
void | setKnockout (bool flag) |
Sets the value of knockout flag for spot color printing. More... | |
bool | getKnockout () const |
Returns the value of the knockout flag. More... | |
ColorMethod | getCmykColorMethod () const |
Returns how the CMYK color value is determined. More... | |
const MapColorCmyk & | getCmyk () const |
Returns the map color's CMYK values. More... | |
void | setCmyk (const MapColorCmyk &cmyk) |
Sets the CMYK values, and sets the CMYK color method to CustomColor. More... | |
void | setCmykFromSpotColors () |
Determines the CMYK values from the spot color composition, and sets the CMYK color method to SpotColor. More... | |
void | setCmykFromRgb () |
Determines the CMYK from the current RGB value, and sets the CMYK color method to RgbColor. More... | |
ColorMethod | getRgbColorMethod () const |
Returns how the RGB color value is determined. More... | |
const MapColorRgb & | getRgb () const |
Returns the map color's RGB values. More... | |
void | setRgb (const MapColorRgb &rgb) |
Sets the RGB values, and sets the RGB color method to CustomColor. More... | |
void | setRgbFromSpotColors () |
Determines the RGB values from the spot color composition, and sets the RGB color method to SpotColor. More... | |
void | setRgbFromCmyk () |
Determines the RGB from the current CMYK value, and sets the RGB color method to CmykColor. More... | |
bool | isBlack () const |
Returns true if this color is black. More... | |
bool | isWhite () const |
Returns true if this color is white. More... | |
bool | equals (const MapColor &other, bool compare_priority) const |
Compares this color and another. More... | |
bool | comparePriority (const MapColor &other) const |
Returns true if this color's priority is less than the other's. More... | |
bool | componentsEqual (const MapColor &other, bool compare_priority) const |
Compares this color's components and another. More... | |
Static Public Member Functions | |
static bool | equal (const MapColor *color, const MapColor *other) |
Compares two colors given by pointers. More... | |
Protected Member Functions | |
void | updateCompositionName () |
Determines the composition name from the components. More... | |
void | updateCalculatedColors () |
Updates all calculated color values. More... | |
MapColorCmyk | cmykFromSpotColors () const |
Returns a CMYK color determined from the cmyk color of the spot color components. More... | |
MapColorRgb | rgbFromSpotColors () const |
Returns a RGB color determined from the cmyk color of the spot color components. More... | |
Protected Attributes | |
QString | name |
int | priority |
MapColorCmyk | cmyk |
MapColorRgb | rgb |
float | opacity |
QColor | q_color |
char | spot_color_method |
char | cmyk_color_method |
char | rgb_color_method |
char | flags |
QString | spot_color_name |
double | screen_frequency = -1 |
Halftone screen frequency in lines per inch. More... | |
double | screen_angle = 0 |
Halftone screen angle in degrees. More... | |
SpotColorComponents | components |
The MapColor class provides colors which may be used by symbols (and objects).
Apart from the mere color, it specifies how to output the color to different type of devices and optionally how the color was composed from other colors.
SpecialProperties provides identifiers for (pseudo-)colors serving particular purposes in the program.
OpenOrienteering::MapColor::MapColor | ( | ) |
Constructs a black CMYK map color of undefined priority.
OpenOrienteering::MapColor::MapColor | ( | int | priority | ) |
Constructs a black CMYK map color with the given priority.
OpenOrienteering::MapColor::MapColor | ( | const QString & | name, |
int | priority | ||
) |
Constructs a black CMYK map color with the given name and priority.
|
protected |
Returns a CMYK color determined from the cmyk color of the spot color components.
Returns true if this color's priority is less than the other's.
bool OpenOrienteering::MapColor::componentsEqual | ( | const MapColor & | other, |
bool | compare_priority | ||
) | const |
Compares this color's components and another.
MapColor * OpenOrienteering::MapColor::duplicate | ( | ) | const |
Returns a copy of the color.
|
inlinestatic |
Compares two colors given by pointers.
Returns true if the colors are equal or if both pointers are nullptr.
Compares this color and another.
|
inline |
Returns the map color's CMYK values.
|
inline |
Returns how the CMYK color value is determined.
Returns CustomColor (for custom CMYK values, e.g. for named spot colors), SpotColor (for values determined from evaluation the spot color composition), or RgbColor (for values directly derived from the current RGB values).
|
inline |
Returns the components of the spot color realization of this color.
Returns an empty list if the spot color method is not CustomColor.
bool OpenOrienteering::MapColor::getKnockout | ( | ) | const |
Returns the value of the knockout flag.
|
inline |
Returns the color's name for the mapping context.
|
inline |
|
inline |
Returns the color's priority.
|
inline |
Returns the map color's RGB values.
|
inline |
Returns how the RGB color value is determined.
Returns CustomColor (for custom RGB values), SpotColor (for values determined from evaluation the spot color composition), or CmykColor (for values directly derived from the current CMYK value).
|
inline |
Returns the spot color halftone screen angle in lines per inch.
This value is undefined for spot color methods other than SpotColor.
|
inline |
Returns the spot color halftone screen frequency in lines per inch.
This value is undefined for spot color methods other than SpotColor.
|
inline |
Returns how the spot color is to be created.
Returns UndefinedMethod, SpotColor (for a full tone single color referenced by name), or CustomColor (for a color created from named colors using halftoning (screens) and overprint.
|
inline |
Returns the name for the single spot color or a label for the spot color composition which realizes this map color.
Returns an empty string for an UndefinedMethod.
bool OpenOrienteering::MapColor::isBlack | ( | ) | const |
Returns true if this color is black.
bool OpenOrienteering::MapColor::isWhite | ( | ) | const |
Returns true if this color is white.
|
inline |
Returns a QColor representation (reference) of the map color.
This color is based on the CMYK color unless the CMYK color method is RGB: In that case, the returned value is based on the RGB color.
|
inline |
Converts the current RGB values to a QRgb.
Removes a component color.
Returns true if components were removed. Returns false if the color was not part of the composition before.
|
protected |
Returns a RGB color determined from the cmyk color of the spot color components.
void OpenOrienteering::MapColor::setCmyk | ( | const MapColorCmyk & | cmyk | ) |
Sets the CMYK values, and sets the CMYK color method to CustomColor.
void OpenOrienteering::MapColor::setCmykFromRgb | ( | ) |
Determines the CMYK from the current RGB value, and sets the CMYK color method to RgbColor.
If the RGB color method is CmykColor, it is changed to CustomColor.
void OpenOrienteering::MapColor::setCmykFromSpotColors | ( | ) |
Determines the CMYK values from the spot color composition, and sets the CMYK color method to SpotColor.
The spot color method must be CustomColor. If the spot color composition is empty, the spot color method is changed to CustomColor, and the CMYK color method is changed to CustomColor.
void OpenOrienteering::MapColor::setKnockout | ( | bool | flag | ) |
Sets the value of knockout flag for spot color printing.
The color must have a spot color definition, or no change will be done.
|
inline |
Sets the color's name for the mapping context.
|
inline |
|
inline |
Sets the color's priority.
Normally you don't want to call this directly.
void OpenOrienteering::MapColor::setRgb | ( | const MapColorRgb & | rgb | ) |
Sets the RGB values, and sets the RGB color method to CustomColor.
void OpenOrienteering::MapColor::setRgbFromCmyk | ( | ) |
Determines the RGB from the current CMYK value, and sets the RGB color method to CmykColor.
If the CMYK color method is RgbColor, it is changed to CustomColor.
void OpenOrienteering::MapColor::setRgbFromSpotColors | ( | ) |
Determines the RGB values from the spot color composition, and sets the RGB color method to SpotColor.
The spot color method must be CustomColor. If the spot color composition is empty, the spot color method is changed to CustomColor, and the RGB color method is changed to CustomColor.
void OpenOrienteering::MapColor::setScreenAngle | ( | double | value | ) |
Sets the spot color halftone screen angle in lines per inch.
This function does nothing for spot color methods other than SpotColor.
void OpenOrienteering::MapColor::setScreenFrequency | ( | double | value | ) |
Sets the spot color halftone screen frequency in lines per inch.
A negative or zero value indicates that the halftone screen is undefined.
This function does nothing for spot color methods other than SpotColor.
void OpenOrienteering::MapColor::setSpotColorComposition | ( | const SpotColorComponents & | components | ) |
Sets the given components (i.e.
screens and/or overprint) for the color, and sets the spot color method to CustomColor.
void OpenOrienteering::MapColor::setSpotColorName | ( | const QString & | spot_color_id | ) |
Sets the name of a single spot color which realizes this map color, and sets the spot color method to SpotColor.
|
protected |
Updates all calculated color values.
If the spot color method is different from CustomColor, resets CMYK and RGB methods from SpotColor tp CustomColor.
|
protected |
Determines the composition name from the components.
Does nothing it the spot color method is not CustomColor.
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
|
protected |
Halftone screen angle in degrees.
|
protected |
Halftone screen frequency in lines per inch.
|
protected |
|
protected |