filters.h

Go to the documentation of this file.
00001 //-----------------------------------------------------------------------------
00002 // --------------------
00003 // File ....: Filters.h
00004 // --------------------
00005 // Author...: Gus Grubba
00006 // Date ....: September 1995
00007 //
00008 // History .: Sep, 07 1995 - Started
00009 //
00010 //-----------------------------------------------------------------------------
00011 #pragma once
00012 #include "FLTExport.h"
00013 #include "maxheap.h"
00014 #include "fltapi.h"
00015 #include "tvnode.h"
00016 #include "maxapi.h"
00017 #include "bitmap.h"
00018 
00019 //-- How long can a filter name be
00020 #define MAXFILTERNAME  MAX_PATH
00021 #define MAXRESOURCE    MAX_PATH
00022 
00023 //-----------------------------------------------------------------------------
00024 //-----------------------------------------------------------------------------
00025 //-- Frame Range
00026 //
00027    
00033 class FrameRange: public MaxHeapOperators {
00034 
00035       int start;
00036       int end;
00037       int current;
00038       
00039     public:
00040     
00041       FLTExport       FrameRange  ( ) {start = end = current  = 0;}
00042       FLTExport       ~FrameRange ( ) {};
00043 
00045       FLTExport int   First       ( ) {   return (start); }
00047       FLTExport int   Last        ( ) {   return (end); }
00049       FLTExport int   Count       ( ) {   return (end - start + 1); }
00051       FLTExport int   Current     ( ) {   return (current);   }
00053       FLTExport int   Elapsed     ( ) {   return (current -   start); }
00054 
00060       FLTExport void  SetFirst    ( int u ) { start = u; }
00066       FLTExport void  SetLast     ( int u ) { end = u; }
00072       FLTExport void  SetCurrent  ( int u ) { current = u; }
00073 
00074 
00075 };
00076 
00077 //-----------------------------------------------------------------------------
00078 //-----------------------------------------------------------------------------
00079 //--   Forward Reference
00080 
00081 class ImageFilter;
00082 class FilterManager;
00083 
00084 //-----------------------------------------------------------------------------
00085 //-----------------------------------------------------------------------------
00086 //-- Time Change Notification (R2)
00087 
00099 class TimeChange : public TimeChangeCallback {
00100    public:
00101       BOOL set;
00103       TimeChange () { set = FALSE; }
00104       ImageFilter *filter;
00110       void TimeChanged(TimeValue t);
00111 };
00112 
00113 //-----------------------------------------------------------------------------
00114 //-----------------------------------------------------------------------------
00115 //--   Filter Info
00116 //
00117    
00118 enum MaskType {
00119    MASK_R = 0,  
00120    MASK_G, 
00121    MASK_B, 
00122    MASK_A, 
00123    MASK_L, 
00124    MASK_Z, 
00125    MASK_MTL_ID,
00126    MASK_NODE_ID
00127 
00128 };
00129 
00130 #define NUMMASKFLAGS (MASK_NODE_ID - MASK_R) + 1
00131 
00163 class ImageFilterInfo: public MaxHeapOperators {
00164 
00165       //-- Name of the filter used internally for identitification.
00166 
00167       MCHAR            name[MAXFILTERNAME];
00168 
00169       //-- Filters may want to identify themselves by something more  
00170       //   specific than their names. Specially filters that give names
00171       //   to parameter sets. If "resource" below is not empty, it
00172       //   will be used to identify the filter in the Video Post Queue.
00173       //   This is saved along with everything else by the host (Max).
00174       //   If all the filter needs is a resource to identify a set of
00175       //   parameters, this will sufice.
00176 
00177       MCHAR            resource[MAXRESOURCE];
00178 
00179       //-- Plug-In Parameter Block ------------------------------------------
00180       //
00181       //    No direct access to clients. Use the  methods in the  filter class.
00182       //
00183 
00184       void             *pidata;
00185       DWORD            pisize;
00186 
00187       //-- New R2 Stuff
00188 
00189       MCHAR       *userlabel;    //-- Optional label given by user
00190       ITrackViewNode *node;         //-- TV Node (if any)
00191       Class_ID    nodeid;        //-- TV Node ID (if any);
00192 
00193       int            flttype;
00194 
00195    public:
00196 
00197       FLTExport        ImageFilterInfo                  ( );
00198       FLTExport       ~ImageFilterInfo                  ( );
00199 
00200       //-- Mask Information -------------------------------------------------
00201 
00202       BOOL                         maskenabled,evCopy;
00203       BOOL                         invertedmask;
00204       BitmapInfo                   mask;
00205       WORD                         maskflag;
00206       
00207       //-- This is a BitmapInfo that holds information about the current 
00208       //   Video Post main queue Image buffer. This can be used to get
00209       //   VP's (or target image) resolution, etc. To make an analogy, if
00210       //   this was a BitmapIO plug-in, this is the BitmapInfo given as
00211       //   the argument. This used primarilly at the time the filter
00212       //   receives the "Setup()" call as at render time, all this can be
00213       //   found in srcmap.
00214 
00215       BitmapInfo                   imgQueue;
00216 
00217       //-- Internal Helpers -------------------------------------------------
00218 
00219       FLTExport void              SetName         ( const MCHAR *n );
00236       FLTExport void              SetResource     ( const MCHAR *n );
00240       FLTExport const MCHAR      *Name           ( )   { return    (const MCHAR *)name;}
00242       FLTExport const MCHAR      *Resource       ( )   { return    (const MCHAR *)resource;}
00243       
00244       //-- Plug-In Parameter Block ------------------------------------------
00245       
00246       FLTExport void              *GetPiData      ( ) { return pidata; }
00247       FLTExport void              SetPiData       ( void    *ptr ) { pidata = ptr; }
00248       FLTExport DWORD            GetPiDataSize   ( )   { return    pisize; }
00249       FLTExport void              SetPiDataSize   ( DWORD s ) { pisize = s; }
00250       FLTExport void              ResetPiData     ( );
00251       FLTExport BOOL              AllocPiData     ( DWORD size  );
00252 
00257       FLTExport ImageFilterInfo &operator= (  ImageFilterInfo &from );
00258       
00259       //-- Load/Save
00260       
00261       FLTExport IOResult         Save            ( ISave *isave );
00262       FLTExport IOResult         Load            ( ILoad *iload, Interface *max );
00263       
00264       //-- Execution  Info ---------------------------------------------------
00265       //
00266       //    12/06/95 - GG
00267       //
00268       //    QueueRange defines    the entire Video Post Queue range. Execution
00269       //    is only the portion being rendered. This is, unless   the user    selects
00270       //    a "range", the same as QueueRange. FilterRange is where this  filter
00271       //    starts    and ends.
00272       //
00273       //    Video Post Queue
00274       //
00275       //              1         2         3         4         5
00276       //    0----|----|----|----|----|----|----|----|----|----|----|----|----|---- ...
00277       //
00278       //    Video Post spans from 0 to 49 (QueueRange) Start: 0  End: 49
00279       //
00280       //    qqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq
00281       //
00282       //    User executes a "range" from 10 to 30 (Execution Range) Start: 10 End: 30
00283       //
00284       //                  uuuuuuuuuuuuuuuuuuuuu
00285       //
00286       //    This filter appears in the queue from 5 to 35 (Filter Range) Start: 5 End: 35
00287       //
00288       //           fffffffffffffffffffffffffffffff        
00289 
00290       FrameRange                   QueueRange;              //-- Entire Video Post Queue
00291       FrameRange                   ExecutionRange;          //-- Segement being rendered
00292       FrameRange                   FilterRange;             //-- Filter Segment
00293       
00294       //----------------------------------------------------------------------
00295       //-- R2 Stuff Below ----------------------------------------------------
00296       //----------------------------------------------------------------------
00297    
00298       //-- Trackview Node Functions ------------------------------------------
00299 
00305       FLTExport ITrackViewNode   *Node ( )            { return node; }
00310       FLTExport void          SetNode (ITrackViewNode *n) { node = n;      }
00311 
00313       FLTExport Class_ID         NodeID      ( )            { return nodeid;}
00318       FLTExport void          SetNodeID   ( Class_ID id )   { nodeid = id;  }
00319 
00320       //-- Optional Label given by user while adding or editing a filter. This label
00321       //   replaces the filter's name in Video Post's tracks for easier identification.
00322 
00329       FLTExport MCHAR            *UserLabel     ( )         { return userlabel; }
00330 
00331       //-- Used by VP to update the label. Not to be used by filters.
00332 
00333       FLTExport void          SetUserLabel   ( MCHAR *l) { userlabel = l; }
00334 
00335       //-- Used to determine what type of filter this is at "Setup" time.
00336 
00337       #define  FLT_FILTER  0
00338       #define  FLT_LAYER   1
00339 
00350       FLTExport int           FilterType     ( )   { return flttype; }
00352       FLTExport void          SetFilterType  ( int type ) { flttype = type; }
00353 
00354 };
00355 
00356 //-----------------------------------------------------------------------------
00357 //-----------------------------------------------------------------------------
00358 //--   Filter Plug-Ins Handler
00359 //
00360    
00365 class FLT_FilterHandler: public MaxHeapOperators {
00366 
00367       //-- Name and Capabilities  ------------------------
00368       
00369       MCHAR         fltDescription[MAXFILTERNAME];    
00370       DWORD         fltCapability;
00371 
00372       //-- DLL    Handler ----------------------------------
00373       
00374       ClassDesc *cd;
00375       
00376    public:
00377 
00381       FLT_FilterHandler();
00382       
00389       FLTExport MCHAR           *Description        ( const MCHAR  *d = NULL  );
00390 
00395       FLTExport void             SetCD              ( ClassDesc *dll )    { cd = dll;}
00397       FLTExport ClassDesc       *GetCD              ( )                   { return    cd;}
00398 
00404       FLTExport void             SetCapabilities  ( DWORD cap )      { fltCapability |= cap;}
00406       FLTExport DWORD            GetCapabilities  ( )                { return    (fltCapability);}
00413       FLTExport BOOL             TestCapabilities ( DWORD cap )      { return    (fltCapability  & cap);}
00414 
00415 };
00416 
00417 //-----------------------------------------------------------------------------
00418 //--   Messages    sent back by various    (client)    methods
00419 
00435 #define    FLT_PROGRESS    WM_USER + 0x20   //!< wParam: Current lParam: Total
00436 
00438 #define  FLT_CHECKABORT WM_USER + 0x21      //!< wParam: 0 lParam: BOOL*
00439 
00450 #define  FLT_TEXTMSG    WM_USER + 0x22      //!< wParam: 0 lParam: LPCMSTR
00451 
00453 #define    FLT_TIMECHANGED WM_USER + 0x23   //!< wParam: 0 lParam: TimeValue t
00454 
00459 #define    FLT_UNDO     WM_USER + 0x24      //!< wParam: 0 lParam: 0
00460 
00461 
00462 //-----------------------------------------------------------------------------
00463 //-----------------------------------------------------------------------------
00464 //--   List of Filter  Plug-Ins
00465 //
00466    
00474 class FLT_FilterList: public   Tab<FLT_FilterHandler> {
00475 
00476       BOOL        listed;
00477        
00478    public:
00479 
00482       FLT_FilterList        ( )           { listed    = FALSE;    }
00483 
00491       BOOL        Listed    ( BOOL    f)  { listed    = f; return (listed);};
00494       BOOL        Listed    ( )           { return    (listed);};
00495 
00502       FLTExport int    FindFilter              ( const MCHAR *name );
00509       FLTExport DWORD  GetFilterCapabilities   ( const MCHAR *name );
00510 
00511       //-- This Creates   an  Instance    - Make sure to  "delete"    it  after   use.
00512 
00521       FLTExport ImageFilter *CreateFilterInstance(const MCHAR *d);
00522 
00523 };
00524 
00525 //-----------------------------------------------------------------------------
00526 //-- Undo Notification
00527 
00547 #pragma warning(push)
00548 #pragma warning(disable:4100)
00549 class UndoNotify : public TVNodeNotify {
00550    HWND hWnd;
00551 public:
00558    UndoNotify (HWND hwnd) {hWnd = hwnd;}
00559    RefResult NotifyRefChanged (Interval changeInt, RefTargetHandle hTarget, 
00560          PartID& partID,  RefMessage message) {
00561          SendMessage(hWnd,FLT_UNDO,0,0);
00562          InvalidateRect(hWnd,NULL,FALSE);
00563          return(REF_SUCCEED);
00564    }
00565 };
00566 #pragma warning(pop)
00567 //-----------------------------------------------------------------------------
00568 //-----------------------------------------------------------------------------
00575 #define IMGFLT_NONE              0      //!< None
00576 #define IMGFLT_MASK              (1<<0) //!< Supports Masking
00577 
00581 #define IMGFLT_CONTROL           (1<<1) //!< Plug-In has a Control Panel
00582 #define IMGFLT_FILTER            (1<<2) //!< Plug-In is a Filter
00583 
00584 #define IMGFLT_COMPOSITOR        (1<<3) //!< Plug-In is a Compositor
00585 
00586 #define IMGFLT_THREADED          (1<<4) //!< Thread aware plug-in
00587 
00588 
00589 //-- Class ID's for various DLL's
00590 
00591 #define NEGATIVECLASSID 0x4655434A
00592 #define ALPHACLASSID    0x655434A4
00593 #define ADDCLASSID      0x55434A46
00594 #define BLURCLASSID     0x5434A465
00595 #define CROSFADECLASSID 0x434A4655
00596 #define GLOWCLASSID     0x35A46554
00597 #define COOKIECLASSID   0x4A465543
00598 #define WIPECLASSID     0xA4655434
00599 #define FADECLASSID     0x4655434B
00600 #define PDALPHACLASSID  0x655434B4
00601 
00602 //-----------------------------------------------------------------------------
00603 //-----------------------------------------------------------------------------
00604 //--   Image   Filter Class
00605 //
00606 
00674 #pragma warning(push)
00675 #pragma warning(disable:4100)
00676 class ImageFilter: public MaxHeapOperators {
00677    
00678    protected:
00679 
00680       BOOL  interactive;
00681       HWND  vpSetuphWnd,vphWnd,dlghWnd;
00682 
00683       //-- Bitmap Pointers --------------------------------------------------
00684       //
00685       // All filters will have at least a pointer to "srcmap". This is VP's
00686       // (or any other process') main image pipeline.
00687       //
00688       // Composition filters will also receive a second [frgmap] bitmap
00689       // which should be composited above the main [srcmap] bitmap.
00690       //
00691       // If "mskmap" is not NULL, it will contain a pointer to a grayscale
00692       // image to be used as a mask for the process.
00693       //
00694       // 12/06/95 - GG
00695       //
00696       // The srcmap (Background) is the Video Post queue bitmap. Use its
00697       // methods to find out dimmensions (width, height, aspect ratio, etc.)
00698       // If the queue is using Alpha channel, it will be noted in the bitmap
00699       // flags (srcmap). The same is true for Z and G buffers. Again, simply
00700       // use the bitmap methods to access these.
00701       //
00702       
00703       Bitmap                      *srcmap;         //--   Source (Background)
00704       Bitmap                      *mskmap;         //--   Mask (Grayscale Masking)
00705       Bitmap                      *frgmap;         //--   Foreground (for layering/transitions)
00706       
00707       //-- Set    by  Host ----------------------------------
00708       
00709       ImageFilterInfo         *ifi;
00710       
00711    public:
00712    
00716       FLTExport   ImageFilter     ( );
00718       FLTExport virtual ~ImageFilter   ( );
00719       
00720       //-- Filter Info    ---------------------------------
00721       
00724       FLTExport virtual     const MCHAR    *Description      ( ) = 0; // ASCII description (i.e. "Convolution Filter")
00726       FLTExport virtual     const MCHAR    *AuthorName       ( ) = 0; // ASCII Author name
00729       FLTExport virtual     const MCHAR    *CopyrightMessage ( ) = 0; // ASCII Copyright message
00731       FLTExport virtual     UINT            Version          ( ) = 0; // Version number * 100 (i.e. v3.01 = 301)
00742       FLTExport virtual     DWORD           Capability       ( ) = 0; // Returns capability flags (see above)
00743 
00744       //-- Dialogs ----------------------------------------------------------
00745       //
00746       //    An About Box  is  mandatory. The  Control panel is optional and   its 
00747       //    existence should be flagged   by  the Capability  flag above.
00748       //
00749 
00756       FLTExport virtual     void            ShowAbout         ( HWND    hWnd ) =    0;
00769       FLTExport virtual     BOOL            ShowControl       ( HWND    hWnd ) {    return FALSE; }
00770 
00771       //-- Parameter  Setting (Host's Responsability) ----
00772 
00773       FLTExport virtual     void            SetSource         ( Bitmap *map )     {srcmap = map;}
00774       FLTExport virtual     void            SetForeground     ( Bitmap *map )     {frgmap = map;}
00775       FLTExport virtual     void            SetMask           ( Bitmap *map )     {mskmap = map;}
00776       FLTExport virtual     void            SetFilterInfo     ( ImageFilterInfo *i ) {ifi   = i;}
00777 
00778       //-- Execution  ------------------------------------
00779       //
00780       //    The   "hWnd" argument is a    window handler  to  which
00781       //    the   plug-in will be sending messages.
00782 
00817       FLTExport virtual     BOOL            Render            ( HWND    hWnd ) =    0;
00818 
00819       //-- Max    Interface ----------------------------------------------------
00820       //
00821       //    Some of Max's core functions exported through the Interface class.
00822       //
00823 
00827       FLTExport virtual  Interface *Max  ( );
00828 
00829       //-- Helpers --------------------------------------
00830 
00832       FLTExport virtual  int     Lerp    (int a, int b, int l);
00834       FLTExport virtual  int     Lerp    (int a, int b, float f);
00835       
00836       //-- Parameter  Block   Load and    Save ------------------------------------
00837       //
00838       //   The host will  call EvaluateConfigure() to determine the   buffer size
00839       //   required by the plug-in.
00840       //
00841       //   SaveConfigure() will be called so the  plug-in can transfer    its
00842       //   parameter block to the host ( ptr is a pre-allocated   buffer).
00843       //
00844       //   LoadConfigure() will be called so the  plug-in can load its    
00845       //   parameter block back.
00846       //   
00847       //   Memory management is performed by the  host using standard
00848       //   LocalAlloc() and   LocalFree().
00849       //   
00850       
00857       FLTExport virtual  DWORD   EvaluateConfigure  ( )           { return 0; }
00867       FLTExport virtual  BOOL    LoadConfigure      ( void *ptr ) { return (FALSE); }
00876       FLTExport virtual  BOOL    SaveConfigure      ( void *ptr ) { return (FALSE); }
00877 
00878       //-- Preview Facility -------------------------------------------------
00879       //
00880       //    This is used  by  plug-ins    that want to have   a preview bitmap while
00881       //    displaying its control dialogue.
00882       //
00883       //    The   flag controls how   much of the queue   to  run:
00884       //
00885       //    PREVIEW_BEFORE - The queue is run up  to  the event before the    filter
00886       //    calling it.
00887       //
00888       //    PREVIEW_UP ----- The queue is run up  to  the event (filter) calling
00889       //    this function.
00890       //
00891       //    PREVIEW_WHOLE -- The whole queue is run   including events after
00892       //    this filter.
00893       //
00894       //    The   given   frame   is  the Video Post  Queue   frame   number and not  Max's
00895       //    frame number.
00896       //
00897       //
00898       //    Parameters:
00899       //
00900       //    hWnd -    WIndow handle to send messages to. These are    the progress,
00901       //    check for abort, text messages    etc. If the plug in wants to support
00902       //    a cancel button   and progress bars   etc, it must handle these messages.
00903       //    It is Ok to send a    NULL window handle in which case    nothing is checked.
00904       //
00905       //    back -    Pointer to a Bitmap pointer. If the Bitmap pointer  is  NULL,   a
00906       //    new   bitmap is created   using   the given dimmensions. This pointer must be
00907       //    NULL the first time this  function    is  called as the bitmap    must be
00908       //    created by Video Post. Once   this function is called and a   bitmap is
00909       //    returned, it  is  ok  to  call it again using this map.   In  this case, Video
00910       //    Post will simply use it instead of creating a new one.    You must    delete
00911       //    the   bitmap when done.
00912       //
00913       //    fore -    For layer plug-ins, this points to the  foreground image.   This is
00914       //    only valid if flag    is  set to PREVIEW_BEFORE. In this case back will hold  
00915       //    Video Post main   queue   and fore    will have the foreground image to be 
00916       //    composited. This is usefull   if  you, a layer plug-in, want  to  collect the 
00917       //    images    and run a real  time preview. If flag is not PREVIEW_BEFORE,    fore
00918       //    will be a NULL pointer indicating there   is  no  bitmap.
00919       //
00920       //    frame - The desired frame. Make sure  you request a frame within  the
00921       //    range your plug-in    is  active.
00922       //
00923       //    width & height - Self explanatory.
00924       //
00925       //    flag -    Explained above.
00926       //
00927 
00928       #ifndef PREVIEW_BEFORE
00929       #define PREVIEW_BEFORE  1
00930       #define PREVIEW_UP      2
00931       #define PREVIEW_WHOLE   3
00932       #endif
00933 
01006       FLTExport virtual    BOOL CreatePreview  ( 
01007             HWND hWnd,                      //-- Window handle to send  messages    to
01008             Bitmap **back,                  //-- Pointer to Bitmap Pointer (Background)
01009             int frame,                      //-- Desired Frame
01010             int width,                      //-- Desired Width
01011             int height,                     //-- Desired Height
01012             float   aspect,                 //-- Desired Aspect Ratio
01013             Bitmap **fore   = NULL,         //-- Pointer to Bitmap Pointer (Foreground)
01014             DWORD   flag    = PREVIEW_UP );
01015 
01016       //----------------------------------------------------------------------
01017       //-- Channels Required
01018       //
01019       //    By setting this   flag,   the plug-in can request the host    to  generate
01020       //    the   given   channels. Prior to Rendering,   the host    will scan the
01021       //    plug-ins in the   chain   of  events and list all types of channels
01022       //    being requested. The plug-in, at the  time of the Render()    call,   
01023       //    will have access to these channels through    the channel interface
01024       //    described in  Bitmap.h    - BitmapStorage.
01025       //
01026       //    The   generation of these channels should not, normally,  be  a 
01027       //    default setting   for a   plug-in.    These   channels    are memory hungry   and
01028       //    if the    plug-in won't use   it, it should not   ask for it. Normally
01029       //    the   plug-in would ask   the user    which   channels    to  use and set only
01030       //    the   proper flags.
01031       //
01032       
01048       FLTExport virtual     DWORD   ChannelsRequired       ( ) {   return BMM_CHAN_NONE; }
01049       
01050 
01051       //----------------------------------------------------------------------
01052       //-- R2 Stuff Below ----------------------------------------------------
01053       //----------------------------------------------------------------------
01054    
01055       TimeChange  timeChange;
01056       UndoNotify* undonotify;
01057 
01058       FLTExport virtual HWND  DlgHandle         ( void ) { return dlghWnd; }
01059 
01060       //-- Filter Control Dialogue Interactivity -----------------------------
01061 
01086       FLTExport virtual void  MakeDlgInteractive   ( HWND hWnd );
01091       FLTExport virtual BOOL  IsInteractive     ( void ) { return interactive; }
01092 
01093       //-- Trackview Node Functions ------------------------------------------
01094 
01097       FLTExport virtual ITrackViewNode *CreateNode ( );
01100       FLTExport virtual ITrackViewNode *Node ( ) { return ifi->Node(); }
01101 
01102       //-- FilterUpdate() ----------------------------------------------------
01103       //
01104       // Whenever a filter instance is created or updated (i.e. the user went,
01105       // through the Filter Edit Control dialogue) this is call is issued to 
01106       // the filter. The filter may use it to create/update its node controls.
01107       //
01108       // See example in negative.cpp.
01109 
01116       FLTExport virtual void  FilterUpdate   ( ) { }
01117 
01118 };
01119 #pragma warning(pop)
01120 //-----------------------------------------------------------------------------
01121 //-----------------------------------------------------------------------------
01122 //--   Main Filter Manager Class
01123 //
01124 //
01125 
01126 class FilterManager: public MaxHeapOperators    {
01127    
01128       MCHAR                   name[MAXFILTERNAME];
01129       FLTInterface            *iface;
01130       ImageFilterInfo         *ifi;
01131       Interface               *max;
01132 
01133       //-- General Private    Methods
01134       
01135       BOOL                    SetupPlugIn                 ( HWND hWnd, WORD   item );
01136       void                    HandleMaskFile              ( HWND hWnd, WORD   item );
01137       
01138       //-- Image Filter   Private Methods
01139       
01140       int                     GetCurrentFilter            ( HWND hWnd, MCHAR *plugin  );
01141       void                    HandleFilterDialogState     ( HWND hWnd );
01142 
01143    public:
01144    
01145       FLTExport                   FilterManager           ( FLTInterface  *i);
01146       FLTExport                   FilterManager           ( FLTInterface  *i,const    MCHAR   *name);
01147       FLTExport                   ~FilterManager          ( );
01148       
01149       FLTExport FLTInterface  *iFace                      ( ) {   return iface;}
01150       
01151       void                        DoConstruct             ( FLTInterface  *i,const    MCHAR   *name);
01152       
01153       FLT_FilterList              fltList;
01154       FLTExport void              ListFilters             ( );
01155       
01156       FLTExport HINSTANCE         AppInst                 ( );
01157       FLTExport HWND              AppWnd                  ( );
01158       FLTExport DllDir            *AppDllDir              ( );
01159       FLTExport Interface         *Max                    ( ) {   return max; }
01160       
01161       //-- User Interface -------------------------------
01162 
01163       INT_PTR                 ImageFilterControl      ( HWND hWnd,UINT message,WPARAM wParam,LPARAM lParam );
01164       
01165       //-- This function will create a    mask bitmap based
01166       //    on the    given   ImageFilterInfo class.
01167       
01168       Bitmap                      *ProcessMask                    ( HWND hWnd, ImageFilterInfo    *ii );
01169       
01170       //-- This function will list all    available filter 
01171       //    plug-ins. The "item" argument defines an id 
01172       //    for   a combo box to  receive the list whithin 
01173       //    the   hWnd context. It returns the number of  
01174       //    filters found.
01175       
01176       FLTExport int               GetFilterList                   ( HWND hWnd, int item );
01177       FLTExport int               GetLayerList                    ( HWND hWnd, int item );
01178       
01179       //-- This runs  the show. Thew  window handle is used
01180       //    to send progress messages back. See above the
01181       //    discussion about messages. The    host should
01182       //    check keyboard and    cancel buttons  and return
01183       //    FALSE to a FLT_PROGRESS or FLT_CHECKABORT
01184       //    message telling   the Plug-In to  cancel.
01185       
01186       FLTExport BOOL              RenderFilter     ( HWND hWnd, 
01187                                           ImageFilterInfo *ii, 
01188                                           Bitmap *map,
01189                                           Bitmap *foreMap = NULL);
01190       
01191       //-- This will  bring   a full blown dialog giving  the
01192       //    user an interface to select   and define a plug-
01193       //    in filter. Returns    FALSE   if  the user    cancels.
01194       
01195       FLTExport BOOL              SelectImageFilter( HWND hWnd, ImageFilterInfo *ii    );
01196       
01197       //-- This will  fill out    the given combo box with a
01198       //    list of available mask options
01199       
01200       FLTExport void              ListMaskOptions  ( HWND hWnd, int item);
01201 
01202       //----------------------------------------------------------------------
01203       //-- R2 Stuff Below ----------------------------------------------------
01204       //----------------------------------------------------------------------
01205    
01206       //-- Internal Use
01207 
01208       FLTExport void              UpdateFilter     ( ImageFilterInfo *ii );
01209 
01210       
01211 };
01212 
01213 //-----------------------------------------------------------------------------
01214 //--   Forward References
01215 //
01216 
01217 extern FLTExport   void             OpenFLT         (  FLTInterface *i );
01218 extern FLTExport   void             CloseFLT        (  );
01219 
01220 //-----------------------------------------------------------------------------
01221 //--   The Primary Filter Manager  Object
01222 //
01223 // TO  DO: Move    to  App data    structure?
01224 
01225 extern FLTExport FilterManager *TheFilterManager; 
01226