#include <colplate.h>
Inheritance diagram for ColourPlate:
Public Member Functions | |
ColourPlate () | |
Construct ColourPlate descriptions. | |
virtual | ~ColourPlate () |
Er... damn. It was on the tip of my tongue... | |
ColourPlate (ColourPlateType TheType, BOOL MonochromePlate=FALSE, BOOL NegatePlate=FALSE) | |
ColourPlate (IndexedColour *SpotColour, BOOL MonochromePlate=FALSE, BOOL NegatePlate=FALSE) | |
ColourPlate (const ColourPlate &Other) | |
ColourPlate & | operator= (const ColourPlate &Other) |
ColourPlate assignment operator. | |
void | GetDescription (StringBase *Description) |
To retrieve a textual description of this colour plate (e.g. "Cyan" "Gold (Spot)"). | |
void | GetDisplayColour (DocColour *Colour) |
To retrieve a suitable user-interface display colour for this plate. For a spot plate, this is simply the spot colour itself. For the process plates, a suitable colour will be returned. | |
BOOL | IsDisabled (void) |
ColourPlateType | GetType (void) |
IndexedColour * | GetSpotColour (void) |
BOOL | IsMonochrome (void) |
BOOL | IsNegative (void) |
double | GetScreenAngle (void) |
double | GetScreenFrequency (void) |
ScreenType | GetScreenFunction (void) |
BOOL | ActiveScreening (void) |
BOOL | Overprints (void) |
void | SetDisabled (BOOL IsDisabled=TRUE) |
Internally, some colour conversions need to turn of colour separations. (e.g. user-interface colours such as dialogue greys and EOR colours). | |
void | SetPlateInfo (ColourContext *Parent, ColourPlateType TheType, BOOL MonochromePlate=FALSE, BOOL NegatePlate=FALSE) |
Change this ColourPlate description. | |
void | SetPlateInfo (ColourContext *Parent, IndexedColour *SpotColour, BOOL MonochromePlate=FALSE, BOOL NegatePlate=FALSE) |
void | SetType (ColourContext *Parent, ColourPlateType TheType, IndexedColour *SpotColour=NULL) |
Change this ColourPlate description. | |
void | SetScreenInfo (double Angle, double Frequency) |
Set new screen angle/frequency settings. | |
void | SetScreenFunction (ScreenType func) |
Set a new screen function in this plate. | |
void | SetActiveScreening (BOOL On=TRUE) |
This function indicates whether the screen function, angle and frequency described in this plate should be used when rendering to EPS devices. | |
void | SetOverprint (BOOL On=TRUE) |
Sets this plate to overprint or knock-out. | |
void | SetMonochrome (ColourContext *Parent, BOOL On=TRUE) |
Change this ColourPlate description. | |
void | SetNegative (ColourContext *Parent, BOOL On=TRUE) |
Change this ColourPlate description. | |
void | ResetScreenToDefaults (INT32 DeviceDPI=1200, INT32 DefaultFrequency=60) |
Resets this ColourPlate's screen angle to the recommended angle for its current Screen frequency (lpi) and the current output device resolution. | |
Protected Member Functions | |
void | InitObject (ColourPlateType NewType) |
Sets this colour plate to the given type, and then initialises ALL member variables to suitable defautls for that type. | |
Protected Attributes | |
BOOL | Disabled |
ColourPlateType | Type |
DocColour | Spot |
double | ScreenAngle |
double | ScreenFrequency |
BOOL | Overprint |
BOOL | Monochrome |
BOOL | Negate |
BOOL | ActiveScreens |
ScreenType | ScreenFunction |
Private Member Functions | |
CC_DECLARE_DYNCREATE (ColourPlate) |
A flag is available, Negate, which controls if a normal or "photographic negative" plate is required.
Notes: You can't change a colour plate "on the fly", as you must attach a new one to a colour context in order to make caching of colours work correctly. Thus, to change the plate, you must build a new one.
Definition at line 177 of file colplate.h.
|
Construct ColourPlate descriptions.
Monochrome - if TRUE, all output on the plate will be monochromatic (greyscale). If FALSE then the plate may contain colour (i.e. a Cyan plate can be output in greyscales (e.g. for printer output) or in shades of cyan (e.g. for screen)) Negate - if TRUE, all output will be negated to give a photographic negative of the plate. if FALSE, the output will be left alone. Other - Another ColourPlate you want to copy Notes: The default constructor makes a simple COLOURPLATE_NONE plate
Definition at line 207 of file colplate.cpp. 00208 { 00209 InitObject(COLOURPLATE_NONE); 00210 }
|
|
Er... damn. It was on the tip of my tongue...
Definition at line 300 of file colplate.cpp.
|
|
Definition at line 214 of file colplate.cpp. 00215 { 00216 ERROR3IF(TheType == COLOURPLATE_SPOT, "Spot plates must be constructed with the Spot Colour constructor"); 00217 00218 InitObject(TheType); 00219 00220 // And override the defaults with the supplied settings 00221 Monochrome = MonochromePlate; 00222 Negate = NegatePlate; 00223 }
|
|
Definition at line 227 of file colplate.cpp. 00228 { 00229 ERROR3IF(SpotColour == NULL, "Spot plates must include a valid Spot Colour!"); 00230 00231 InitObject(COLOURPLATE_SPOT); 00232 00233 // And override the defaults with the supplied settings 00234 Monochrome = MonochromePlate; 00235 Negate = NegatePlate; 00236 00237 Spot.MakeRefToIndexedColour(SpotColour); 00238 }
|
|
Definition at line 242 of file colplate.cpp. 00243 { 00244 Disabled = Other.Disabled; 00245 Type = Other.Type; 00246 Overprint = Other.Overprint; 00247 Monochrome = Other.Monochrome; 00248 Negate = Other.Negate; 00249 ActiveScreens = Other.ActiveScreens; 00250 Spot = Other.Spot; 00251 00252 ScreenAngle = Other.ScreenAngle; 00253 ScreenFrequency = Other.ScreenFrequency; 00254 ScreenFunction = Other.ScreenFunction; 00255 }
|
|
Definition at line 228 of file colplate.h. 00228 { return(ActiveScreens); };
|
|
|
|
To retrieve a textual description of this colour plate (e.g. "Cyan" "Gold (Spot)").
Definition at line 322 of file colplate.cpp. 00323 { 00324 ERROR3IF(Description == NULL, "Illegal NULL param"); 00325 *Description = TEXT(""); 00326 00327 switch(GetType()) 00328 { 00329 case COLOURPLATE_CYAN: 00330 Description->MakeMsg(_R(IDS_COLOURPLATE_CYAN)); 00331 break; 00332 00333 case COLOURPLATE_MAGENTA: 00334 Description->MakeMsg(_R(IDS_COLOURPLATE_MAGENTA)); 00335 break; 00336 00337 case COLOURPLATE_YELLOW: 00338 Description->MakeMsg(_R(IDS_COLOURPLATE_YELLOW)); 00339 break; 00340 00341 case COLOURPLATE_KEY: 00342 Description->MakeMsg(_R(IDS_COLOURPLATE_BLACK)); 00343 break; 00344 00345 case COLOURPLATE_SPOT: 00346 { 00347 IndexedColour *Col = GetSpotColour(); 00348 ERROR3IF(Col == NULL, "NULL Spot colour in spot plate"); 00349 00350 Description->MakeMsg(_R(IDS_COLOURPLATE_SPOT), (TCHAR *) *(Col->GetName()) ); 00351 } 00352 break; 00353 default: 00354 break; 00355 } 00356 }
|
|
To retrieve a suitable user-interface display colour for this plate. For a spot plate, this is simply the spot colour itself. For the process plates, a suitable colour will be returned.
Definition at line 375 of file colplate.cpp. 00376 { 00377 ERROR3IF(Colour == NULL, "Illegal NULL param"); 00378 00379 PColourCMYK CMYKDef; 00380 CMYKDef.Cyan = CMYKDef.Magenta = CMYKDef.Yellow = CMYKDef.Key = 0; 00381 00382 switch(GetType()) 00383 { 00384 case COLOURPLATE_CYAN: CMYKDef.Cyan = 255; break; 00385 case COLOURPLATE_MAGENTA: CMYKDef.Magenta = 255; break; 00386 case COLOURPLATE_YELLOW: CMYKDef.Yellow = 255; break; 00387 case COLOURPLATE_KEY: CMYKDef.Key = 255; break; 00388 00389 case COLOURPLATE_SPOT: 00390 { 00391 IndexedColour *Col = GetSpotColour(); 00392 ERROR3IF(Col == NULL, "NULL Spot colour in spot plate"); 00393 00394 Colour->MakeRefToIndexedColour(Col); 00395 return; // Return immediately 00396 } 00397 break; 00398 00399 default: 00400 // Just leave it alone, which will return the default value - white 00401 break; 00402 } 00403 00404 // If we've dropped through this far, then set the CMYK value we've 00405 // filled in, and return 00406 Colour->SetCMYKValue(&CMYKDef); 00407 }
|
|
Definition at line 219 of file colplate.h. 00219 { return(ScreenAngle); };
|
|
Definition at line 222 of file colplate.h. 00222 { return(ScreenFrequency); };
|
|
Definition at line 225 of file colplate.h. 00225 { return(ScreenFunction); };
|
|
Definition at line 208 of file colplate.h. 00209 { 00210 return(Spot.FindParentIndexedColour()); 00211 };
|
|
Definition at line 205 of file colplate.h. 00205 { return(Type); };
|
|
Sets this colour plate to the given type, and then initialises ALL member variables to suitable defautls for that type.
Notes: Does not check the validity of the arguments (i.e. if you ask for COLOURPLATE_SPOT, does not check that the SpotColour is set up) Definition at line 138 of file colplate.cpp. 00139 { 00140 Disabled = FALSE; 00141 00142 Type = NewType; 00143 00144 Overprint = FALSE; 00145 Monochrome = TRUE; 00146 Negate = FALSE; 00147 ActiveScreens = FALSE; 00148 00149 ScreenFunction = SCRTYPE_NONE; // represents no setscreen command output 00150 00151 // And set up a suitable default for screen angle/frequency 00152 // Use the selected document's printer resolution and LPI defaults 00153 INT32 DPI = 1200; // Defaults in case of catastrophy 00154 INT32 LPI = 60; 00155 00156 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00157 TypesetInfo *TPInfo = TypesetInfo::FindTypesetInfoForDoc(); 00158 if (TPInfo != NULL) 00159 { 00160 DPI = TPInfo->GetPrintResolution(); 00161 LPI = (INT32) floor(TPInfo->GetDefaultScreenFrequency()); 00162 } 00163 #endif 00164 00165 ResetScreenToDefaults(DPI, LPI); 00166 }
|
|
Definition at line 202 of file colplate.h. 00202 { return(Disabled); };
|
|
Definition at line 213 of file colplate.h. 00213 { return(Monochrome); };
|
|
Definition at line 216 of file colplate.h. 00216 { return(Negate); };
|
|
ColourPlate assignment operator.
Definition at line 270 of file colplate.cpp. 00271 { 00272 Disabled = Other.Disabled; 00273 Type = Other.Type; 00274 Overprint = Other.Overprint; 00275 Monochrome = Other.Monochrome; 00276 Negate = Other.Negate; 00277 ActiveScreens = Other.ActiveScreens; 00278 Spot = Other.Spot; 00279 00280 ScreenAngle = Other.ScreenAngle; 00281 ScreenFrequency = Other.ScreenFrequency; 00282 ScreenFunction = Other.ScreenFunction; 00283 00284 return(*this); 00285 }
|
|
Definition at line 231 of file colplate.h. 00231 { return(Overprint); };
|
|
Resets this ColourPlate's screen angle to the recommended angle for its current Screen frequency (lpi) and the current output device resolution.
Definition at line 751 of file colplate.cpp. 00752 { 00753 #if !defined(EXCLUDE_FROM_RALPH) && !defined(EXCLUDE_FROM_XARALX) 00754 // Ask the XaraCMS for recommended angles for the current typesetter settings 00755 CMSScreenAngles RecAngles; 00756 XaraCMS* lpCMSMan = GetApplication()->GetCMSManager(); 00757 00758 // Set suitable defaults in case of a problem 00759 RecAngles.cyanfreq = RecAngles.magentafreq = 00760 RecAngles.yellowfreq = RecAngles.keyfreq = DefaultFrequency; 00761 00762 RecAngles.cyanangle = 105.0; 00763 RecAngles.magentaangle = 75.0; 00764 RecAngles.yellowangle = 90.0; 00765 RecAngles.keyangle = 45.0; 00766 00767 if (lpCMSMan != NULL) 00768 lpCMSMan->GetRecommendedAngles(DeviceDPI, DefaultFrequency, &RecAngles); 00769 00770 // Now set a suitable default screen angle for the type of plate 00771 switch(Type) 00772 { 00773 case COLOURPLATE_CYAN: 00774 ScreenAngle = RecAngles.cyanangle; 00775 ScreenFrequency = RecAngles.cyanfreq; 00776 break; 00777 00778 case COLOURPLATE_MAGENTA: 00779 ScreenAngle = RecAngles.magentaangle; 00780 ScreenFrequency = RecAngles.magentafreq; 00781 break; 00782 00783 case COLOURPLATE_YELLOW: 00784 ScreenAngle = RecAngles.yellowangle; 00785 ScreenFrequency = RecAngles.yellowfreq; 00786 break; 00787 00788 case COLOURPLATE_KEY: 00789 ScreenAngle = RecAngles.keyangle; 00790 ScreenFrequency = RecAngles.keyfreq; 00791 break; 00792 00793 default: 00794 ScreenAngle = 45.0; 00795 ScreenFrequency = (double) DefaultFrequency; 00796 break; 00797 } 00798 #endif 00799 }
|
|
This function indicates whether the screen function, angle and frequency described in this plate should be used when rendering to EPS devices.
Definition at line 708 of file colplate.cpp. 00709 { 00710 ActiveScreens = On; 00711 }
|
|
Internally, some colour conversions need to turn of colour separations. (e.g. user-interface colours such as dialogue greys and EOR colours).
Notes: ColourPlates always default to being Enabled.
Definition at line 433 of file colplate.cpp. 00434 { 00435 Disabled = IsDisabled; 00436 }
|
|
Change this ColourPlate description.
Notes: Every time the plate changes, the attached ColourContext must chnage its handle in order to "flush" all cached colours. After 65536 such flushes, it is possible for contexts to start using duplicate handles, so it is preferable that changes are made to plates as infrequently as possible.
Definition at line 643 of file colplate.cpp. 00644 { 00645 if (Monochrome != On) 00646 { 00647 Monochrome = On; 00648 if (Parent != NULL) 00649 Parent->ColourPlateHasChanged(); 00650 } 00651 }
|
|
Change this ColourPlate description.
Notes: Every time the plate changes, the attached ColourContext must chnage its handle in order to "flush" all cached colours. After 65536 such flushes, it is possible for contexts to start using duplicate handles, so it is preferable that changes are made to plates as infrequently as possible.
Definition at line 680 of file colplate.cpp. 00681 { 00682 if (Negate != On) 00683 { 00684 Negate = On; 00685 if (Parent != NULL) 00686 Parent->ColourPlateHasChanged(); 00687 } 00688 }
|
|
Sets this plate to overprint or knock-out.
Definition at line 610 of file colplate.cpp. 00611 { 00612 Overprint = On; 00613 }
|
|
Definition at line 501 of file colplate.cpp. 00503 { 00504 ERROR3IF(SpotColour == NULL, "Spot plates must include a valid Spot Colour!"); 00505 00506 InitObject(COLOURPLATE_SPOT); 00507 00508 Monochrome = MonochromePlate; 00509 Negate = NegatePlate; 00510 00511 Spot.MakeRefToIndexedColour(SpotColour); 00512 00513 if (Parent != NULL) 00514 Parent->ColourPlateHasChanged(); 00515 }
|
|
Change this ColourPlate description.
SpotColour - Indicates that this is a spot plate, and which colour is to be treated as the spot colour for output. Only this colour and its descendants will be output on the plate. Monochrome - if TRUE, all output on the plate will be monochromatic (greyscale). If FALSE then the plate may contain colour (i.e. a Cyan plate can be output in greyscales (e.g. for printer output) or in shades of cyan (e.g. for screen)) Negate - if TRUE, all output will be negated to give a photographic negative of the plate. if FALSE, the output will be left alone. Notes: Every time the plate changes, the attached ColourContext must chnage its handle in order to "flush" all cached colours. After 65536 such flushes, it is possible for contexts to start using duplicate handles, so it is preferable that changes are made to plates as infrequently as possible. ALL ColourPlate settings will be reset when you call this function, i.e. disabled plates will be re-enabled, new default screen angle/frequency values filled in, overprint disabled, etc.
Definition at line 484 of file colplate.cpp. 00486 { 00487 ERROR3IF(TheType == COLOURPLATE_SPOT, "Spot plates must be constructed with the Spot Colour constructor"); 00488 00489 InitObject(TheType); 00490 00491 Monochrome = MonochromePlate; 00492 Negate = NegatePlate; 00493 00494 Spot = DocColour(COLOUR_BLACK); 00495 00496 if (Parent != NULL) 00497 Parent->ColourPlateHasChanged(); 00498 }
|
|
Set a new screen function in this plate.
Definition at line 725 of file colplate.cpp. 00726 { 00727 ScreenFunction = func; 00728 }
|
|
Set new screen angle/frequency settings.
Definition at line 586 of file colplate.cpp. 00587 { 00588 ERROR3IF(Angle < 0.0 || Angle >= 360.0, "Illegal screen angle"); 00589 ScreenAngle = Angle; 00590 00591 ERROR3IF(Frequency < 1.0 || Frequency > 1000.0, "Silly screen frequency"); 00592 ScreenFrequency = Frequency; 00593 }
|
|
Change this ColourPlate description.
SpotColour - NULL, or points to the colour which is to be treated as the spot colour for output. Only this colour and its descendants will be output on the plate. TheType must be COLOURPLATE_SPOT if this is non-NULL. Notes: Every time the plate changes, the attached ColourContext must chnage its handle in order to "flush" all cached colours. After 65536 such flushes, it is possible for contexts to start using duplicate handles, so it is preferable that changes are made to plates as infrequently as possible.
Definition at line 550 of file colplate.cpp. 00551 { 00552 ERROR3IF(TheType == COLOURPLATE_SPOT && SpotColour == NULL, 00553 "Spot plates must include a valid Spot Colour!"); 00554 00555 if (Type != COLOURPLATE_SPOT || Spot.FindParentIndexedColour() != SpotColour) 00556 { 00557 InitObject(TheType); 00558 00559 if (SpotColour != NULL) 00560 Spot.MakeRefToIndexedColour(SpotColour); 00561 00562 if (Parent != NULL) 00563 Parent->ColourPlateHasChanged(); 00564 } 00565 }
|
|
Definition at line 296 of file colplate.h. |
|
Definition at line 281 of file colplate.h. |
|
Definition at line 293 of file colplate.h. |
|
Definition at line 295 of file colplate.h. |
|
Definition at line 292 of file colplate.h. |
|
Definition at line 289 of file colplate.h. |
|
Definition at line 290 of file colplate.h. |
|
Definition at line 298 of file colplate.h. |
|
Definition at line 287 of file colplate.h. |
|
Definition at line 284 of file colplate.h. |