colplate.h

Go to the documentation of this file.
00001 // $Id: colplate.h 1282 2006-06-09 09:46:49Z alex $
00002 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE
00003 ================================XARAHEADERSTART===========================
00004  
00005                Xara LX, a vector drawing and manipulation program.
00006                     Copyright (C) 1993-2006 Xara Group Ltd.
00007        Copyright on certain contributions may be held in joint with their
00008               respective authors. See AUTHORS file for details.
00009 
00010 LICENSE TO USE AND MODIFY SOFTWARE
00011 ----------------------------------
00012 
00013 This file is part of Xara LX.
00014 
00015 Xara LX is free software; you can redistribute it and/or modify it
00016 under the terms of the GNU General Public License version 2 as published
00017 by the Free Software Foundation.
00018 
00019 Xara LX and its component source files are distributed in the hope
00020 that it will be useful, but WITHOUT ANY WARRANTY; without even the
00021 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
00022 See the GNU General Public License for more details.
00023 
00024 You should have received a copy of the GNU General Public License along
00025 with Xara LX (see the file GPL in the root directory of the
00026 distribution); if not, write to the Free Software Foundation, Inc., 51
00027 Franklin St, Fifth Floor, Boston, MA  02110-1301 USA
00028 
00029 
00030 ADDITIONAL RIGHTS
00031 -----------------
00032 
00033 Conditional upon your continuing compliance with the GNU General Public
00034 License described above, Xara Group Ltd grants to you certain additional
00035 rights. 
00036 
00037 The additional rights are to use, modify, and distribute the software
00038 together with the wxWidgets library, the wxXtra library, and the "CDraw"
00039 library and any other such library that any version of Xara LX relased
00040 by Xara Group Ltd requires in order to compile and execute, including
00041 the static linking of that library to XaraLX. In the case of the
00042 "CDraw" library, you may satisfy obligation under the GNU General Public
00043 License to provide source code by providing a binary copy of the library
00044 concerned and a copy of the license accompanying it.
00045 
00046 Nothing in this section restricts any of the rights you have under
00047 the GNU General Public License.
00048 
00049 
00050 SCOPE OF LICENSE
00051 ----------------
00052 
00053 This license applies to this program (XaraLX) and its constituent source
00054 files only, and does not necessarily apply to other Xara products which may
00055 in part share the same code base, and are subject to their own licensing
00056 terms.
00057 
00058 This license does not apply to files in the wxXtra directory, which
00059 are built into a separate library, and are subject to the wxWindows
00060 license contained within that directory in the file "WXXTRA-LICENSE".
00061 
00062 This license does not apply to the binary libraries (if any) within
00063 the "libs" directory, which are subject to a separate license contained
00064 within that directory in the file "LIBS-LICENSE".
00065 
00066 
00067 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS
00068 ----------------------------------------------
00069 
00070 Subject to the terms of the GNU Public License (see above), you are
00071 free to do whatever you like with your modifications. However, you may
00072 (at your option) wish contribute them to Xara's source tree. You can
00073 find details of how to do this at:
00074   http://www.xaraxtreme.org/developers/
00075 
00076 Prior to contributing your modifications, you will need to complete our
00077 contributor agreement. This can be found at:
00078   http://www.xaraxtreme.org/developers/contribute/
00079 
00080 Please note that Xara will not accept modifications which modify any of
00081 the text between the start and end of this header (marked
00082 XARAHEADERSTART and XARAHEADEREND).
00083 
00084 
00085 MARKS
00086 -----
00087 
00088 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara
00089 designs are registered or unregistered trademarks, design-marks, and/or
00090 service marks of Xara Group Ltd. All rights in these marks are reserved.
00091 
00092 
00093       Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK.
00094                         http://www.xara.com/
00095 
00096 =================================XARAHEADEREND============================
00097  */
00098 // colplate.h - Definitions for colour separations in ColourContexts
00099 
00100 
00101 #ifndef INC_COLPLATE
00102 #define INC_COLPLATE
00103 
00104 //#include "doccolor.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 //#include "listitem.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 
00107 class IndexedColour;
00108 
00109 
00110 typedef enum
00111 {
00112     COLOURPLATE_NONE,           // No colour plate (normal rendering operation)
00113 
00114     COLOURPLATE_COMPOSITE,      // Composite print-preview (colour matching)
00115 
00116     COLOURPLATE_CYAN,           // Process colour separation plates
00117     COLOURPLATE_MAGENTA,
00118     COLOURPLATE_YELLOW,
00119     COLOURPLATE_KEY,
00120 
00121     COLOURPLATE_SPOT            // Spot colour separation plate
00122 } ColourPlateType;
00123 
00124 
00125 
00126 /********************************************************************************************
00127 
00128 >   typedef enum ScreenType
00129 
00130     Author:     Mike_Kenny (Xara Group Ltd) <camelotdev@xara.com>
00131     Created:    11/6/95
00132     Purpose:    enumeration of the screen types we support inside a plate
00133 
00134 ********************************************************************************************/
00135 
00136 typedef enum ScreenType
00137 {
00138     SCRTYPE_NONE,
00139     SCRTYPE_SPOT1,
00140     SCRTYPE_SPOT2,
00141     SCRTYPE_TRIPLESPOT1,
00142     SCRTYPE_TRIPLESPOT2,
00143     SCRTYPE_ELLIPTICAL,
00144     SCRTYPE_LINE,
00145     SCRTYPE_CROSSHATCH,
00146     SCRTYPE_MEZZOTINT,
00147     SCRTYPE_SQUARE,
00148     SCRTYPE_DITHER
00149 };
00150 
00151 
00152 /********************************************************************************************
00153  
00154 >   class ColourPlate : public ListItem
00155 
00156     Author:     Jason_Williams (Xara Group Ltd) <camelotdev@xara.com>
00157     Date:       20/12/95
00158 
00159     Purpose:    The ColourPlate class is used as a descriptor defining how a colour context
00160                 should separate/filter a colour as it is converted.
00161 
00162                 The ColourPlate indicates what type of separation plate is required, e.g
00163                 none, cyan, or spot. In the case of a spot plate, the ColourPlate also
00164                 retains a pointer to the spot colour for which a plate is required.
00165 
00166                 A flag is available, Negate, which controls if a normal or "photographic
00167                 negative" plate is required.
00168 
00169     Notes:      You can't change a colour plate "on the fly", as you must attach a new 
00170                 one to a colour context in order to make caching of colours work
00171                 correctly. Thus, to change the plate, you must build a new one.
00172 
00173     SeeAlso:    ColourContext::SetColourPlate
00174 
00175  ********************************************************************************************/
00176 
00177 class ColourPlate : public ListItem
00178 {
00179     CC_DECLARE_DYNCREATE(ColourPlate);
00180 
00181 public:     // Construction/destruction
00182     ColourPlate();
00183     virtual ~ColourPlate();
00184 
00185     ColourPlate(ColourPlateType TheType, BOOL MonochromePlate = FALSE, BOOL NegatePlate = FALSE);
00186     ColourPlate(IndexedColour *SpotColour, BOOL MonochromePlate = FALSE, BOOL NegatePlate = FALSE);
00187 
00188     ColourPlate(const ColourPlate &Other);
00189     ColourPlate &operator=(const ColourPlate &Other);
00190 
00191 
00192 public:     // Special user-interface functions
00193     void GetDescription(StringBase *Description);
00194             // Gets a description of this colour plate (e.g. "Cyan", "Gold (Spot)")
00195 
00196     void GetDisplayColour(DocColour *Colour);
00197             // Gets a display colour to be used when showing a colour patch display
00198             // for this plate.
00199 
00200 
00201 public:     // Retrieving current settings
00202     BOOL IsDisabled(void)               { return(Disabled); };
00203             // Returns TRUE if this plate is temporarily disabled
00204 
00205     ColourPlateType GetType(void)       { return(Type); };
00206             // Gets the colour plate type that this object represents
00207 
00208     IndexedColour  *GetSpotColour(void)     // Gets the spot colour (if any) which this spot plate contains
00209     {
00210         return(Spot.FindParentIndexedColour()); 
00211     };
00212     
00213     BOOL IsMonochrome(void)             { return(Monochrome); };
00214             // Returns TRUE if this plate should contain only monochromatic values
00215     
00216     BOOL IsNegative(void)               { return(Negate); };
00217             // Returns TRUE if this plate is a photographic negative
00218 
00219     double GetScreenAngle(void)         { return(ScreenAngle); };
00220             // Returns the screen angle (0..360 degrees)
00221 
00222     double GetScreenFrequency(void)     { return(ScreenFrequency); };
00223             // Returns the screen frequency
00224 
00225     ScreenType GetScreenFunction(void)  { return(ScreenFunction); };
00226             // Returns the screen function
00227     
00228     BOOL ActiveScreening(void)          { return(ActiveScreens); };
00229             // Returns TRUE if this plate uses screening
00230 
00231     BOOL Overprints(void)               { return(Overprint); };
00232             // Returns TRUE if graphics (non-text) objects should overprint
00233 
00234 
00235 public:     // Changing current settings - use as infrequently as possible
00236     void SetDisabled(BOOL IsDisabled = TRUE);
00237             // Disables/enables the output of this plate. This has 2 uses:
00238             // 1. Stops the plate being printed by the main print loop
00239             // 2. If the plate is rendered, can be used as a temporary flag to stop
00240             //    colour separation and correction during output.
00241 
00242     void SetPlateInfo(ColourContext *Parent, ColourPlateType TheType,
00243                         BOOL MonochromePlate = FALSE, BOOL NegatePlate = FALSE);
00244 
00245     void SetPlateInfo(ColourContext *Parent, IndexedColour *SpotColour,
00246                         BOOL MonochromePlate = FALSE, BOOL NegatePlate = FALSE);
00247 
00248     void SetType(ColourContext *Parent, ColourPlateType TheType, IndexedColour *SpotColour = NULL);
00249             // Set this plate to be of a particular type
00250 
00251     void SetScreenInfo(double Angle, double Frequency);
00252             // Sets screen angle/frequency for this plate
00253     
00254     void SetScreenFunction(ScreenType func);
00255             // Sets screen type for this plate
00256 
00257     void SetActiveScreening(BOOL On = TRUE);
00258             // Turns on screen usage for this plate
00259 
00260     void SetOverprint(BOOL On = TRUE);
00261             // Enable/Disable overprint for this plate
00262 
00263     void SetMonochrome(ColourContext *Parent, BOOL On = TRUE);
00264             // Force all output to be monochrome (print) or plate-coloured (preview)
00265 
00266     void SetNegative(ColourContext *Parent, BOOL On = TRUE);
00267             // Force all output to be photographically negated (or normal)
00268 
00269     void ResetScreenToDefaults(INT32 DeviceDPI = 1200, INT32 DefaultFrequency = 60);
00270             // Makes this colour plate reset to recommended screen angle settings for
00271             // the current printer resolution (dpi) and screen frequency (lpi)
00272 
00273 
00274 protected:  // Internal helper functions
00275     void InitObject(ColourPlateType NewType);
00276             // Sets a new Type for this plate, and initisalises all other member variables
00277             // to sensible default values for the given plate type.
00278 
00279 
00280 protected:  // Internal data
00281     BOOL Disabled;                  // TRUE if this ColourPlate is disabled (used to temporarily turn
00282                                     // off colour separation for specific colours like UI/EOR DocColours)
00283 
00284     ColourPlateType Type;           // The type of separation/plate desired
00285 
00286 
00287     DocColour Spot;                 // References the spot colour (spot plates only)
00288 
00289     double ScreenAngle;             // The screen angle for this plate
00290     double ScreenFrequency;         // The screen frequency for this plate
00291 
00292     BOOL Overprint;                 // TRUE if this plate should overprint, FALSE if it should knock-out
00293     BOOL Monochrome;                // TRUE if the plate should contain only monochromatic shades
00294                                     // (if FALSE, e.g. a Cyan separation will be shades of Cyan)
00295     BOOL Negate;                    // TRUE if the plate should be a negative image
00296     BOOL ActiveScreens;             // TRUE if the screening is active
00297 
00298     ScreenType  ScreenFunction;     // The screen function to use (Spot1/Spot2 etc)
00299 };
00300 
00301 #endif          // INC_COLPLATE
00302 
00303 

Generated on Sat Nov 10 03:44:53 2007 for Camelot by  doxygen 1.4.4