nodeliveeffect.h

Go to the documentation of this file.
00001 // $Id: nodeliveeffect.h 1688 2006-08-10 12:05:20Z gerry $
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 
00099 #ifndef NODELIVEFX_H
00100 #define NODELIVEFX_H
00101 
00102 //#include "ink.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00103 #include "nodepostpro.h"
00104 //#include "cxfrech.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00105 //#include "biasgain.h" - in camtypes.h [AUTOMATICALLY REMOVED]
00106 
00107 // Define this if you want to pick up the development of the Feather Effect
00108 #define FEATHER_EFFECT
00109 //#include "opliveeffects.h"
00110 
00111 PORTNOTE("other","Define dummy IXMLDOMDocumentPtr")
00112 #ifdef EXCLUDE_FROM_XARALX
00113 typedef void           *IXMLDOMDocumentPtr;
00114 #endif
00115 
00116 class CCAttrMap;
00117 class BitmapTranspFillAttribute;
00118 
00119 /***********************************************************************************************
00120 
00121 >   class LiveEffectRecordHandler : public CamelotRecordHandler
00122 
00123     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00124     Created:    27/09/2004
00125     Purpose:    Handles the reading of live effects records
00126     SeeAlso:    -
00127 
00128 ***********************************************************************************************/
00129 
00130 class LiveEffectRecordHandler : public CamelotRecordHandler
00131 {
00132     // Give my name in memory dumps
00133     CC_DECLARE_DYNAMIC(LiveEffectRecordHandler);
00134 
00135 public:
00136     LiveEffectRecordHandler() : CamelotRecordHandler() {}
00137     ~LiveEffectRecordHandler() {}
00138 
00139     virtual UINT32* GetTagList();
00140     virtual BOOL    HandleRecord(CXaraFileRecord* pCXaraFileRecord);
00141     virtual BOOL    IsStreamed(UINT32 Tag);
00142     virtual BOOL    HandleStreamedRecord(CXaraFile* pCXFile, UINT32 Tag, UINT32 Size, UINT32 RecordNumber);
00143 
00144 #ifdef XAR_TREE_DIALOG
00145     virtual void    GetRecordDescriptionText(CXaraFileRecord* pRecord, StringBase* pStr);
00146 #endif
00147 };
00148 
00149 
00150 
00151 
00152 /***********************************************************************************************
00153 
00154 >   class NodeBitmapEffect : public NodeEffect
00155 
00156     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00157     Created:    07/09/2004
00158     Purpose:    Bitmap effects nodes are type of Post-Processors. They process the bitmap
00159                 output of their child nodes.
00160 
00161 ***********************************************************************************************/
00162 
00163 class NodeBitmapEffect : public NodeEffect
00164 {
00165 // Give my name out in memory dumps
00166 CC_DECLARE_DYNCREATE(NodeBitmapEffect);
00167 
00168 friend class LiveEffectRecordHandler;
00169 
00170 public:
00171     static BOOL Init();
00172 
00173 // Prefs
00174 public:
00175     // Default resolution of live effect bitmaps in pixels per inch
00176     static UINT32 DefaultLivePixelsPerInch;
00177     static UINT32 DefaultLockedPixelsPerInch;
00178     static UINT32 GroupPixelsPerInch;
00179     static UINT32 ShadowPixelsPerInch;
00180     static BOOL DefaultLocked;
00181 
00182 public:
00183     NodeBitmapEffect();
00184     ~NodeBitmapEffect();
00185 
00186     NodeBitmapEffect(Node* ContextNode,
00187                 AttachNodeDirection Direction,
00188                 BOOL Locked = FALSE,
00189                 BOOL Mangled = FALSE,
00190                 BOOL Marked = FALSE,
00191                 BOOL Selected = FALSE
00192               );
00193 
00194 // Overrides
00195 public:
00196     virtual BOOL                IsBitmapEffect() const {return TRUE;}
00197     virtual DocRect             GetBlobBoundingRect();
00198     virtual NodeRenderableInk*  GetInkNodeFromController() const {return FindFirstChildInk();}
00199     virtual void                Render(RenderRegion* pRender);
00200     virtual BOOL                DoBecomeA(BecomeA* pBecomeA);
00201     virtual BOOL                CanBecomeA(BecomeA* pBecomeA);
00202     virtual BOOL                HasCachedDirectBitmap();
00203 //  virtual BOOL                WriteBeginChildRecordsWeb(BaseCamelotFilter* pFilter);
00204 //  virtual BOOL                WriteBeginChildRecordsNative(BaseCamelotFilter* pFilter);
00205     virtual BOOL                WriteBoundsRecord(BaseCamelotFilter* pFilter);
00206     virtual BOOL                WillWriteBounds(BaseCamelotFilter* pFilter) { return(TRUE); }
00207 
00208 // Specialist functions for this class
00209 public:
00210     virtual void                RenderAfterSubtree(RenderRegion* pRender);
00211     virtual BOOL                GetOriginalBitmap(LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect);
00212     virtual void                SetOriginalBitmap(LPBITMAPINFO lpInfo, LPBYTE lpBits, DocRect rect);
00213     virtual BOOL                GetProcessedBitmap(BOOL bDirect, LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect) {return FALSE;}
00214     virtual DocRect             SetProcessedBitmap( LPBITMAPINFO lpInfo,
00215                                                     LPBYTE lpBits,
00216                                                     DocRect rect,
00217                                                     INT32 width,
00218                                                     INT32 height,
00219                                                     double xOffset,
00220                                                     double yOffset,
00221                                                     double dPixelWidth = 0,
00222                                                     Matrix* pmatTransform = NULL)
00223                                                     {return DocRect(0,0,0,0);}
00224     virtual IXMLDOMDocumentPtr  GetEditList();
00225     virtual void                SetEditList(IXMLDOMDocumentPtr pNewEditsDoc);
00226     virtual BOOL                SetDefaultEditList();
00227     virtual BOOL                IsLockedEffect() {return FALSE;}
00228     virtual BOOL                HasChanged() const {return m_bHasChangedRecently;}
00229     virtual BOOL                SetChanged(BOOL bNewFlag = TRUE) {m_bHasChangedRecently = bNewFlag; return TRUE;}
00230     virtual BOOL                CompareState(NodeEffect* pPPNode);
00231     virtual BOOL                ProcessBitmap(RenderRegion* pRender,
00232                                               CBitmapCache* pBitmapCache,
00233                                               LPBITMAPINFO pBMPInfo,
00234                                               LPBYTE pBMPBits,
00235                                               DocRect BMPRect,
00236                                               LPBITMAPINFO& pOutputInfo,
00237                                               LPBYTE& pOutputBits,
00238                                               double* pXOffset,
00239                                               double* pYOffset);
00240     virtual String_64&          GetDisplayName() {return m_strDisplayName;}
00241     virtual void                SetDisplayName(String_64& strDisplayName) {m_strDisplayName = strDisplayName;}
00242     virtual KernelBitmap*       GetKernelBitmap(DocCoord* pCoords, BOOL bRetainCached = FALSE) {return NULL;}
00243     virtual double              GetPixelsPerInch();
00244     virtual double              GetPixelsPerInchValue() const {return m_dPixelsPerInch;}
00245     virtual void                SetPixelsPerInch(double dPixelsPerInch);
00246     virtual BOOL                CanGenerateBitmap();
00247     virtual BOOL                GetChildDirectBitmap(RenderRegion* pRender,
00248                                                     LPBITMAPINFO* plpInfo = NULL,
00249                                                     LPBYTE* plpBits = NULL,
00250                                                     DocRect* pRect = NULL,
00251                                                     Matrix* pMat = NULL,
00252                                                     double* pdRes = NULL
00253                                                     );
00254     virtual BOOL                CanSupplyDirectBitmap() {return TRUE;}
00255     virtual BOOL                GetDirectBitmap(RenderRegion* pRender, LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect, Matrix* pMat, double* pdRes);
00256     virtual BOOL                RenderDirectBitmapState(RenderRegion* pRender);
00257     virtual BOOL                EnableDirectCapture();
00258 
00259 protected:
00260     virtual double              GetPixelWidth() {return 72000.0 / GetPixelsPerInch();}
00261     virtual DocRect             AdjustPixelOffsets(DocRect inRect, INT32 width, INT32 height, double xOffset, double yOffset, double dPixelWidth = 0);
00262     virtual BOOL                FindCachedEffect(CBitmapCache* pBitmapCache);
00263     virtual BOOL                RenderCachedEffect(CBitmapCache* pBitmapCache, RenderRegion* pRenderRegion, BOOL bIgnoreCapture = FALSE);
00264     virtual BOOL                GetQuickRender() {return Operation::GetQuickRender(this);}
00265     virtual BOOL                CanGetChildDirectBitmap();
00266 
00267 protected:
00268     IXMLDOMDocumentPtr          m_pEditsDoc;                // The parameter list for XPE processing
00269         StringVar               m_vstrEdits;                // Hold xml string in memory while we don't have an XMl document class
00270     double                      m_dPixelsPerInch;           // effect resolution of this effect
00271     BOOL                        m_bHasChangedRecently;      // TRUE if this effect has been changed by XaraPhotoEditorHost::UpdateEdit
00272     String_64                   m_strDisplayName;           // The display name of this effect (for use when we can't find it by ID)
00273     DocRect                     m_rectDirectBitmap;         // The "cached" bitmap rect in DirectBitmap space
00274 
00275 };
00276 
00277 
00278 
00279 
00280 /***********************************************************************************************
00281 
00282 >   class NodeLiveEffect : public NodeBitmapEffect
00283 
00284     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00285     Created:    07/09/2004
00286     Purpose:    Bitmap effects nodes are type of Post-Processors. They process the bitmap
00287                 output of their child nodes.
00288                 They are "Live" in that as soon as their children change they re-process
00289                 the output.
00290 
00291 ***********************************************************************************************/
00292 
00293 class NodeLiveEffect : public NodeBitmapEffect
00294 {
00295 // Give my name out in memory dumps
00296 CC_DECLARE_DYNCREATE(NodeLiveEffect);
00297 
00298 friend class LiveEffectRecordHandler;
00299 
00300 public:
00301     NodeLiveEffect();
00302     ~NodeLiveEffect();
00303 
00304     NodeLiveEffect(Node* ContextNode,
00305                 AttachNodeDirection Direction,
00306                 BOOL Locked = FALSE,
00307                 BOOL Mangled = FALSE,
00308                 BOOL Marked = FALSE,
00309                 BOOL Selected = FALSE
00310               );
00311 
00312 // Overrides
00313 public:
00314     virtual SubtreeRenderState  RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00315     virtual String              Describe(BOOL Plural, BOOL Verbose);
00316     virtual Node*               SimpleCopy();  
00317     virtual UINT32              GetNodeSize() const;
00318     virtual void                PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00319     virtual DocRect             GetBoundingRect(BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE);
00320     virtual void                Transform(TransformBase& Trans);
00321     virtual BOOL                ReleaseCached(BOOL bAndParents = TRUE,
00322                                               BOOL bAndChildren = TRUE,
00323                                               BOOL bSelf = TRUE,
00324                                               BOOL bAndDerived = TRUE);
00325     virtual BOOL                WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00326     virtual BOOL                WritePreChildrenNative(BaseCamelotFilter* pFilter);
00327     virtual NodeRenderableInk*  FindNodeAtPointHelper(const Spread* pSpread, const DocCoord dcPoint);
00328     virtual BOOL                CanSelectAsCompoundParent() {return FALSE;}                 // FALSE if normal effect
00329     virtual BOOL                PromoteHitTestOnChildrenToMe() const {return FALSE;}        // FALSE if normal effect
00330     virtual BOOL                ShouldITransformWithChildren() const {return TRUE;}
00331     virtual BOOL                AllowSelectInside() const {return TRUE;}                    // TRUE if normal effect
00332 
00333 // Specialist functions for this class
00334 public:
00335     virtual BOOL                GetProcessedBitmap(BOOL bDirect, LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect);
00336     virtual DocRect             SetProcessedBitmap( LPBITMAPINFO lpInfo,
00337                                                     LPBYTE lpBits,
00338                                                     DocRect rect,
00339                                                     INT32 width,
00340                                                     INT32 height,
00341                                                     double xOffset,
00342                                                     double yOffset,
00343                                                     double dPixelWidth = 0,
00344                                                     Matrix* pmatTransform = NULL);
00345     virtual BOOL                IsLockedEffect() {return FALSE;}
00346     virtual KernelBitmap*       GetKernelBitmap(DocCoord* pCoords, BOOL bRetainCached = FALSE);
00347     void                        RemoveBitmapFromCache();
00348 
00349 protected:
00350     virtual BOOL                WriteLiveEffect(BaseCamelotFilter* pFilter);
00351 
00352 protected:
00353     void                        CopyNodeContents(NodeLiveEffect* pCopyOfNode);
00354 
00355 private:
00356     DocRect                     m_rectEstimatedBounds;      // Hold on to known bounds of processed bitmap even when we don't have a processed bitmap
00357     MILLIPOINT                  m_lMaxBorder;
00358 };
00359 
00360 
00361 
00362 
00363 /***********************************************************************************************
00364 
00365 >   class NodeLockedEffect : public NodeBitmapEffect
00366 
00367     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00368     Created:    07/09/2004
00369     Purpose:    Bitmap effects nodes are type of Post-Processors. They process the bitmap
00370                 output of their child nodes.
00371                 They are "Locked" in that they capture the output once then ignore changes
00372                 to their children (because they cannot reproduce the processing).
00373 
00374 ***********************************************************************************************/
00375 
00376 class NodeLockedEffect : public NodeBitmapEffect
00377 {
00378 // Give my name out in memory dumps
00379 CC_DECLARE_DYNCREATE(NodeLockedEffect);
00380 
00381 friend class LiveEffectRecordHandler;
00382 
00383 public:
00384     NodeLockedEffect();
00385     ~NodeLockedEffect();
00386 
00387     NodeLockedEffect(Node* ContextNode,
00388                 AttachNodeDirection Direction,
00389                 BOOL Locked = FALSE,
00390                 BOOL Mangled = FALSE,
00391                 BOOL Marked = FALSE,
00392                 BOOL Selected = FALSE
00393               );
00394 
00395 // Overrides
00396 public:
00397     virtual SubtreeRenderState  RenderSubtree(RenderRegion* pRender, Node** ppNextNode = NULL, BOOL bClip = TRUE);
00398     virtual String              Describe(BOOL Plural, BOOL Verbose);
00399     virtual Node*               SimpleCopy();  
00400     virtual UINT32              GetNodeSize() const;
00401     virtual void                PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00402     virtual DocRect             GetBoundingRect(BOOL DontUseAttrs=FALSE, BOOL HitTest=FALSE);
00403     virtual void                Transform(TransformBase& Trans);
00404     virtual BOOL                WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00405     virtual BOOL                WritePreChildrenNative(BaseCamelotFilter* pFilter);
00406     virtual BOOL                CanSelectAsCompoundParent() {return TRUE;}              // FALSE if normal effect
00407     virtual BOOL                PromoteHitTestOnChildrenToMe() const {return TRUE;}     // FALSE if normal effect
00408     virtual BOOL                AllowSelectInside() const {return FALSE;}               // TRUE if normal effect
00409     virtual void                RenderObjectBlobs(RenderRegion* pRender);
00410     virtual void                RenderTinyBlobs(RenderRegion* pRender);
00411     virtual void                Render(RenderRegion* pRender);
00412     virtual KernelBitmap*       EnumerateBitmaps(UINT32 Count);
00413     virtual NodeRenderableInk*  GetInkNodeFromController() const;
00414     virtual void                UnlinkNodeFromTree(BaseDocument* pOwnerDoc = NULL);
00415     virtual BOOL                CanSupplyDirectBitmap() {return HasCachedDirectBitmap();}   // Only supply DirectBitmap if applied to DirectBitmap
00416 
00417 protected:
00418     virtual BOOL                RenderCachedEffect(CBitmapCache* pBitmapCache, RenderRegion* pRender, BOOL bIgnoreCapture = FALSE);
00419 
00420 // Specialist functions for this class
00421 public:
00422     virtual BOOL                GetProcessedBitmap(BOOL bDirect, LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect);
00423     virtual DocRect             SetProcessedBitmap( LPBITMAPINFO lpInfo,
00424                                                     LPBYTE lpBits,
00425                                                     DocRect rect,
00426                                                     INT32 width,
00427                                                     INT32 height,
00428                                                     double xOffset,
00429                                                     double yOffset,
00430                                                     double dPixelWidth = 0,
00431                                                     Matrix* pmatTransform = NULL);
00432     virtual BOOL                IsLockedEffect() {return TRUE;}
00433     virtual BOOL                CanBeUnlocked() const {return !m_bIsDestructive;}
00434     virtual void                SetLockPermanence(BOOL bDestructive) {m_bIsDestructive = bDestructive;}
00435 
00436     virtual KernelBitmap*       GetKernelBitmap(DocCoord* pCoords, BOOL bRetainCached = FALSE);
00437 
00438 protected:
00439     virtual BOOL                WriteLockedEffect(BaseCamelotFilter* pFilter);
00440 
00441 protected:
00442     void                        CopyNodeContents(NodeLockedEffect* pCopyOfNode);
00443 
00444 private:
00445     KernelBitmapRef             m_BitmapRef;                // Use a KernelBitmap to store a 
00446     DocCoord                    m_PGram[3];                 // Parallelogram
00447     BOOL                        m_bIsDestructive;           // Is this one permanently locked?
00448 };
00449 
00450 
00451 
00452 /***********************************************************************************************
00453 
00454 >   class NodeFeatherEffect : public NodeLiveEffect
00455 
00456     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00457     Created:    24/11/2004
00458     Purpose:    Feather effects are specialised types of LiveEffect
00459 
00460 ***********************************************************************************************/
00461 
00462 #ifdef FEATHER_EFFECT
00463 class NodeFeatherEffect : public NodeLiveEffect
00464 {
00465 // Give my name out in memory dumps
00466 CC_DECLARE_DYNCREATE(NodeFeatherEffect);
00467 
00468 friend class LiveEffectRecordHandler;
00469 friend class OpLiveEffect;
00470 
00471 static BOOL ProcessBitmap(LPBITMAPINFO pBMPInfo,
00472                           LPBYTE pBMPBits,
00473                           double dPixBlurDiameter,
00474                           CProfileBiasGain profileFeather);
00475 
00476 public:
00477     NodeFeatherEffect();
00478     ~NodeFeatherEffect();
00479 
00480     NodeFeatherEffect(Node* ContextNode,
00481                 AttachNodeDirection Direction,
00482                 BOOL Locked = FALSE,
00483                 BOOL Mangled = FALSE,
00484                 BOOL Marked = FALSE,
00485                 BOOL Selected = FALSE
00486               );
00487 
00488 // Overrides
00489 public:
00490     virtual String              Describe(BOOL Plural, BOOL Verbose);
00491     virtual Node*               SimpleCopy();  
00492     virtual UINT32              GetNodeSize() const;
00493     virtual void                PolyCopyNodeContents(NodeRenderable* pNodeCopy);
00494     virtual BOOL                WritePreChildrenWeb(BaseCamelotFilter* pFilter);
00495     virtual BOOL                WritePreChildrenNative(BaseCamelotFilter* pFilter);
00496     virtual BOOL                ProcessBitmap(RenderRegion* pRender,
00497                                               CBitmapCache* pBitmapCache,
00498                                               LPBITMAPINFO pBMPInfo,
00499                                               LPBYTE pBMPBits,
00500                                               DocRect BMPRect,
00501                                               LPBITMAPINFO& pOutputInfo,
00502                                               LPBYTE& pOutputBits,
00503                                               double* pXOffset,
00504                                               double* pYOffset);
00505     virtual BOOL                FindCachedEffect(CBitmapCache* pBitmapCache);
00506     virtual BOOL                RenderCachedEffect(CBitmapCache* pBitmapCache, RenderRegion* pRenderRegion, BOOL bIgnoreCapture = FALSE);
00507     virtual BOOL                CompareState(NodeEffect* pPPNode);
00508     virtual BOOL                IsFeatherEffect() {return TRUE;}
00509     virtual BOOL                CanSupplyDirectBitmap() {return FALSE;}
00510     virtual BOOL                EnableDirectCapture() {return FALSE;}
00511 //  virtual BOOL                GetDirectBitmap(RenderRegion* pRender, LPBITMAPINFO* plpInfo, LPBYTE* plpBits, DocRect* pRect, Matrix* pMat, double* pdRes);
00512 
00513 // Specialist functions for this class
00514 public:
00515     virtual void                SetFeatherSize(MILLIPOINT newFeatherSize) {m_FeatherSize = newFeatherSize;}
00516     virtual MILLIPOINT          GetFeatherSize() const {return m_FeatherSize;}
00517     virtual void                SetProfile(CProfileBiasGain newProfile) {m_Profile = newProfile;}
00518     virtual CProfileBiasGain    GetProfile() const {return m_Profile;}
00519 
00520 protected:
00521     virtual BOOL                WriteFeatherEffect(BaseCamelotFilter* pFilter);
00522     BOOL                        CreateBitmapTranspFill(KernelBitmap* pFeather,
00523                                                         DocCoord* pCoords,
00524                                                         BitmapTranspFillAttribute* BmpTranspFill);
00525     void                        CopyNodeContents(NodeFeatherEffect* pCopyOfNode);
00526     virtual BOOL                GetQuickRender();
00527 
00528 private:
00529     CProfileBiasGain            m_Profile;
00530     MILLIPOINT                  m_FeatherSize;
00531 };
00532 #endif
00533 
00534 
00535 /***********************************************************************************************
00536 
00537 >   class ProcessBitmapPipeline : public CCObject
00538 
00539     Author:     Phil_Martin (Xara Group Ltd) <camelotdev@xara.com>
00540     Created:    28/04/2005
00541     Purpose:    Holds the state of a bitmap during processing and implements functions to push
00542                 the bitmap through the processing pipeline.
00543 
00544 ***********************************************************************************************/
00545 
00546 #ifdef FEATHER_EFFECT
00547 class ProcessBitmapState : public CCObject
00548 {
00549 public:
00550     // Default constructor
00551     ProcessBitmapState()
00552     {
00553         m_lpInfo = NULL;
00554         m_lpBits = NULL;
00555         m_XOffset = 0;
00556         m_YOffset = 0;
00557         m_XPelsPerMeter = 0;
00558         m_YPelsPerMeter = 0;
00559         m_bTemp = TRUE;
00560         m_bOK = FALSE;
00561     }
00562 
00563     // Build constructor
00564     ProcessBitmapState(LPBITMAPINFO lpInitialInfo,
00565                         LPBYTE lpInitialBits,
00566                         double InitialXOffset = 0,
00567                         double InitialYOffset = 0,
00568                         BOOL bInitialTempState = FALSE);
00569     // Copy constructor
00570     ProcessBitmapState(const ProcessBitmapState& copystate);
00571     // assignment operator
00572     ProcessBitmapState& operator=(const ProcessBitmapState& rhsstate);
00573 
00574     // Destructor
00575     ~ProcessBitmapState()
00576     {
00577     };
00578 
00579 // Methods
00580 public:
00581     ProcessBitmapState  Create8BPPMask();
00582     ProcessBitmapState  Contour8BPP(double dContourWidth);
00583     ProcessBitmapState  Blur8BPP(double dBlurWidth);
00584     ProcessBitmapState  Expand8BPP(INT32 nPixels, BYTE fill);
00585     ProcessBitmapState  AddMaskTo(LPBITMAPINFO lpDeepInfo, LPBYTE lpDeepBits);
00586 
00587     void                GetPixelOffsets(double* pXOffset, double* pYOffset) const {*pXOffset = m_XOffset; *pYOffset = m_YOffset;}
00588     void                GetBitmap(LPBITMAPINFO& pOutputInfo, LPBYTE& pOutputBits, BOOL bTemp = FALSE);
00589     BOOL                IsOK() const {return m_bOK;}
00590     void                DeInit();
00591 
00592 #ifdef DEBUG
00593     void                AttachToDoc(String_256 strName);
00594 #endif
00595 
00596 // Implementation
00597 protected:
00598     void                InitPipelineSettings(ProcessBitmapState* const prevstate);
00599     UINT32              GetWidth() const {return m_lpInfo->bmiHeader.biWidth;}
00600     UINT32              GetHeight() const {return m_lpInfo->bmiHeader.biHeight;}
00601     UINT32              GetDepth() const {return m_lpInfo->bmiHeader.biBitCount;}
00602     UINT32              GetXPelsPerMeter() const {return m_XPelsPerMeter==0 ? m_lpInfo->bmiHeader.biXPelsPerMeter : m_XPelsPerMeter;}
00603     UINT32              GetYPelsPerMeter() const {return m_YPelsPerMeter==0 ? m_lpInfo->bmiHeader.biYPelsPerMeter : m_YPelsPerMeter;}
00604     void                SetPelsPerMeter(UINT32 x, UINT32 y);
00605     BOOL                AllocDIB(UINT32 Width, UINT32 Height, UINT32 Depth);
00606 
00607 // Members
00608 private:
00609     LPBITMAPINFO        m_lpInfo;               // Pointer to bitmap info for this pipeline state
00610     LPBYTE              m_lpBits;               // Pointer to bitmap data
00611     double              m_XOffset;              // XOffset from original bottom left corner to bottom left of this state
00612     double              m_YOffset;              // YOffset...
00613     BOOL                m_bTemp;                // TRUE if this bitmap can be deleted when another state is assigned to this one
00614     BOOL                m_bOK;                  // TRUE if processing was successful in this state
00615     UINT32              m_XPelsPerMeter;        // Transport pels per meter through the pipeline when no bitmap is allocated
00616     UINT32              m_YPelsPerMeter;        // ...
00617 
00618 };
00619 #endif
00620 
00621 
00622 #endif  // NODELIVEFX_H

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