00001 // $Id: bevfill.h 751 2006-03-31 15:43:49Z alex $ 00003 // The bevelling fill profile class 00004 /* @@tag:xara-cn@@ DO NOT MODIFY THIS LINE 00005 ================================XARAHEADERSTART=========================== 00006 00007 Xara LX, a vector drawing and manipulation program. 00008 Copyright (C) 1993-2006 Xara Group Ltd. 00009 Copyright on certain contributions may be held in joint with their 00010 respective authors. See AUTHORS file for details. 00011 00012 LICENSE TO USE AND MODIFY SOFTWARE 00013 ---------------------------------- 00014 00015 This file is part of Xara LX. 00016 00017 Xara LX is free software; you can redistribute it and/or modify it 00018 under the terms of the GNU General Public License version 2 as published 00019 by the Free Software Foundation. 00020 00021 Xara LX and its component source files are distributed in the hope 00022 that it will be useful, but WITHOUT ANY WARRANTY; without even the 00023 implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. 00024 See the GNU General Public License for more details. 00025 00026 You should have received a copy of the GNU General Public License along 00027 with Xara LX (see the file GPL in the root directory of the 00028 distribution); if not, write to the Free Software Foundation, Inc., 51 00029 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA 00030 00031 00032 ADDITIONAL RIGHTS 00033 ----------------- 00034 00035 Conditional upon your continuing compliance with the GNU General Public 00036 License described above, Xara Group Ltd grants to you certain additional 00037 rights. 00038 00039 The additional rights are to use, modify, and distribute the software 00040 together with the wxWidgets library, the wxXtra library, and the "CDraw" 00041 library and any other such library that any version of Xara LX relased 00042 by Xara Group Ltd requires in order to compile and execute, including 00043 the static linking of that library to XaraLX. In the case of the 00044 "CDraw" library, you may satisfy obligation under the GNU General Public 00045 License to provide source code by providing a binary copy of the library 00046 concerned and a copy of the license accompanying it. 00047 00048 Nothing in this section restricts any of the rights you have under 00049 the GNU General Public License. 00050 00051 00052 SCOPE OF LICENSE 00053 ---------------- 00054 00055 This license applies to this program (XaraLX) and its constituent source 00056 files only, and does not necessarily apply to other Xara products which may 00057 in part share the same code base, and are subject to their own licensing 00058 terms. 00059 00060 This license does not apply to files in the wxXtra directory, which 00061 are built into a separate library, and are subject to the wxWindows 00062 license contained within that directory in the file "WXXTRA-LICENSE". 00063 00064 This license does not apply to the binary libraries (if any) within 00065 the "libs" directory, which are subject to a separate license contained 00066 within that directory in the file "LIBS-LICENSE". 00067 00068 00069 ARRANGEMENTS FOR CONTRIBUTION OF MODIFICATIONS 00070 ---------------------------------------------- 00071 00072 Subject to the terms of the GNU Public License (see above), you are 00073 free to do whatever you like with your modifications. However, you may 00074 (at your option) wish contribute them to Xara's source tree. You can 00075 find details of how to do this at: 00076 http://www.xaraxtreme.org/developers/ 00077 00078 Prior to contributing your modifications, you will need to complete our 00079 contributor agreement. This can be found at: 00080 http://www.xaraxtreme.org/developers/contribute/ 00081 00082 Please note that Xara will not accept modifications which modify any of 00083 the text between the start and end of this header (marked 00084 XARAHEADERSTART and XARAHEADEREND). 00085 00086 00087 MARKS 00088 ----- 00089 00090 Xara, Xara LX, Xara X, Xara X/Xtreme, Xara Xtreme, the Xtreme and Xara 00091 designs are registered or unregistered trademarks, design-marks, and/or 00092 service marks of Xara Group Ltd. All rights in these marks are reserved. 00093 00094 00095 Xara Group Ltd, Gaddesden Place, Hemel Hempstead, HP2 6EX, UK. 00096 http://www.xara.com/ 00097 00098 =================================XARAHEADEREND============================ 00099 */ 00100 00101 #ifndef _BEVFILL_H 00102 #define _BEVFILL_H 00103 00104 /****************************************************************************************** 00105 00106 > class CBevelFill : public SimpleCCObject 00107 00108 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00109 Created: 23/10/98 00110 00111 Purpose: Abstract base class for all fill types 00112 00113 SeeAlso: CBeveler 00114 00115 ******************************************************************************************/ 00116 00117 class CBevelFill : public CCObject 00118 { 00119 CC_DECLARE_DYNAMIC(CBevelFill); 00120 00121 00122 public: 00123 // Pos is between 0 (i.e. on the bevel path) and 1 (i.e. on the inner/outer path) 00124 virtual COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast) = 0; 00125 00126 // ensures that the value is in the range 1 to 254 to make 00127 // sure it can be cast as a BYTE 00128 void EnsureValueRange(double *value); 00129 } ; 00130 00131 /****************************************************************************************** 00132 00133 > class CBevelFillFlat : public CBevelFill 00134 00135 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00136 Created: 23/10/98 00137 00138 Purpose: Do a flat fill 00139 00140 SeeAlso: CBeveler 00141 00142 ******************************************************************************************/ 00143 00144 class CBevelFillFlat : public CBevelFill 00145 { 00146 CC_DECLARE_DYNAMIC(CBevelFillFlat); 00147 00148 00149 public: 00150 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00151 } ; 00152 00153 00154 /****************************************************************************************** 00155 00156 > class CBevelFillRound : public CBevelFill 00157 00158 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00159 Created: 23/10/98 00160 00161 Purpose: Do a rounded fill 00162 00163 SeeAlso: CBeveler 00164 00165 ******************************************************************************************/ 00166 00167 class CBevelFillRound : public CBevelFill 00168 { 00169 CC_DECLARE_DYNAMIC(CBevelFillRound); 00170 00171 public: 00172 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00173 } ; 00174 00175 00176 /****************************************************************************************** 00177 00178 > class CBevelFillSquare : public CBevelFill 00179 00180 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00181 Created: 23/10/98 00182 00183 Purpose: Do a rounded fill 00184 00185 SeeAlso: CBeveler 00186 00187 ******************************************************************************************/ 00188 00189 class CBevelFillSquare : public CBevelFill 00190 { 00191 CC_DECLARE_DYNAMIC(CBevelFillSquare); 00192 00193 public: 00194 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00195 } ; 00196 00197 /****************************************************************************************** 00198 00199 > class CBevelFillFrame : public CBevelFill 00200 00201 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00202 Created: 23/10/98 00203 00204 Purpose: Do a rounded fill 00205 00206 SeeAlso: CBeveler 00207 00208 ******************************************************************************************/ 00209 00210 class CBevelFillFrame : public CBevelFill 00211 { 00212 CC_DECLARE_DYNAMIC(CBevelFillFrame); 00213 00214 public: 00215 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00216 } ; 00217 00218 /****************************************************************************************** 00219 00220 > class CBevelFillSmooth : public CBevelFill 00221 00222 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00223 Created: 23/10/98 00224 00225 Purpose: Do a smoothed fill 00226 00227 SeeAlso: CBeveler 00228 00229 ******************************************************************************************/ 00230 00231 class CBevelFillSmooth : public CBevelFill 00232 { 00233 CC_DECLARE_DYNAMIC(CBevelFillSmooth); 00234 00235 public: 00236 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00237 } ; 00238 00239 /****************************************************************************************** 00240 00241 > class CBevelFillPoint : public CBevelFill 00242 00243 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00244 Created: 1/2/99 00245 00246 Purpose: Do a pointy fill 00247 00248 SeeAlso: CBeveler 00249 00250 ******************************************************************************************/ 00251 00252 class CBevelFillPoint : public CBevelFill 00253 { 00254 CC_DECLARE_DYNAMIC(CBevelFillPoint); 00255 00256 public: 00257 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00258 } ; 00259 00260 /****************************************************************************************** 00261 00262 > class CBevelFillRuffle : public CBevelFill 00263 00264 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00265 Created: 23/10/98 00266 00267 Purpose: Do a ruffle fill 00268 00269 SeeAlso: CBeveler 00270 00271 ******************************************************************************************/ 00272 00273 class CBevelFillRuffle : public CBevelFill 00274 { 00275 CC_DECLARE_DYNAMIC(CBevelFillRuffle); 00276 00277 public: 00278 COLORREF CalcPixelValue(BYTE value, double Pos, INT32 Contrast); 00279 } ; 00280 00281 /****************************************************************************************** 00282 00283 > class CBevelFills : public SimpleCCObject 00284 00285 Author: David_McClarnon (Xara Group Ltd) <camelotdev@xara.com> 00286 Created: 23/10/98 00287 00288 Purpose: Encapsulates all the bevel filling stuff 00289 00290 SeeAlso: CBeveler 00291 00292 ******************************************************************************************/ 00293 00294 class CBevelFills : public CCObject 00295 { 00296 CC_DECLARE_DYNAMIC(CBevelFills); 00297 00298 public: 00299 CBevelFills(); 00300 ~CBevelFills(); 00301 00302 COLORREF CalcPixelValue(BYTE value, INT32 bevType, double Pos, INT32 Contrast); 00303 private: 00304 CBevelFill **m_pBevFills; 00305 00306 // set up the above 00307 BOOL SetUpFills(); 00308 00309 INT32 m_NumFills; 00310 } ; 00311 00312 00313 00314 00315 00316 #endif