CShadowerFlat Class Reference

'Wrapper' for the COM interface CShadowerFlat, which is itself a 'Facade' for the flat shadow generation system. Simply delegates to its owned COM component. See also: CShadowerFlat ( in CShadowerFlat.cpp ) To calculate/estimate the bound of an unshadowed pixmap, given the bound of a (hypothetical) shadowed pixmap, More...

#include <ShadowTl.h>

List of all members.

Public Member Functions

 CShadowerFlat ()
virtual ~CShadowerFlat ()
virtual HRESULT _Init_ ()
virtual VOID SetChoicesToDefault ()
virtual VOID SetChoices (const BOOL *MakeWallShadow, const AFloatPt01 *Darkness01, const APixels *Blurriness, const ACoordPixels XYPosition, const ADegrees *Tilt, const AFloatPt01 *YScale01)
virtual VOID SetBaseline (const AFloatPt01 *Baseline)
virtual VOID GetChoices (BOOL *MakeWallShadow, AFloatPt01 *Darkness01, APixels *Blurriness, ACoordPixels XYPosition, ADegrees *Tilt, AFloatPt01 *YScale01) const
virtual VOID GetBaseline (AFloatPt01 *Baseline) const
virtual VOID GetDarknessRange (AFloatPt01 &Min, AFloatPt01 &Max) const
virtual VOID GetBlurrinessRange (APixels &Min, APixels &Max) const
virtual VOID GetPositionRange (ACoordPixels Min, ACoordPixels Max) const
virtual VOID GetProjectionRange (ADegrees &MinTilt, ADegrees &MaxTilt, AFloatPt01 &MinYScale, AFloatPt01 &MaxYScale) const
virtual HRESULT SwitchToTransparencyInsteadOfAlpha (BOOL YesOrNo)
virtual HRESULT SwitchToUpsideDownPixelAddressing (BOOL YesOrNo)
virtual HRESULT InverseShadowBoundCalc (ACoordPixels UnshadowedWidHei, ACoordPixels UnshadowedPos, const ACoordPixels &ShadowedWidHei, const AFloatPt01 *Baseline) const
virtual HRESULT CalcShadowBound (ACoordPixels ShadowWidHei, ACoordPixels ShadowPos, const AAlphaChannel &TransparencyMap, const ACoordPixels &tWidHei, const ACoordPixels &tPos) const
virtual HRESULT DrawShadow (const AAlphaChannel &ShadowMapOut, const ACoordPixels &sWidHei, const ACoordPixels &sPos, const AAlphaChannel &TransparencyMapIn, const ACoordPixels &tWidHei, const ACoordPixels &tPos) const

Private Member Functions

 CShadowerFlat (const CShadowerFlat &)
CShadowerFlatoperator= (const CShadowerFlat &)

Private Attributes

IComShadowerFlat * pShadower_m

Static Private Attributes

static const GUID IID_IComShadowerFlat
static const GUID CLSID_CComShadowerFlat


Detailed Description

'Wrapper' for the COM interface CShadowerFlat, which is itself a 'Facade' for the flat shadow generation system. Simply delegates to its owned COM component. See also: CShadowerFlat ( in CShadowerFlat.cpp ) To calculate/estimate the bound of an unshadowed pixmap, given the bound of a (hypothetical) shadowed pixmap,

Updated by: Mark Howitt 3/8/98

Author:
Harrison_Ainsworth (Xara Group Ltd) <camelotdev@xara.com>
Date:
21/12/97
Returns:
Errors: (constructor throws if CoCreateInstance() fails) not currently.
Instructions: Construction: Construct, then call _init_ (if possible, rewrite this wrapper class, moving the _Init_() into the costructor). Setting/getting choices: Pass null pointers for the parameters you don't want to change/read. The baseline value means: position of baseline / height of image where: position of baseline = no. of pixels from top of image Switches: You might want to change the default init settings in _Init_(), The internal defaults are FALSE, FALSE - alpha channel, right way up (top left pixel is lowest address) Make shadow functions: Positions have their origin at the top left of the image. Call CalcShadowBound() to get the size and pos of the shadow, then allocate your shadow pixmap, then call DrawShadow() to draw the shadow. The shadow has zeros in the color channels. InverseShadowBoundCalc()
Parameters:
The width, height of a hypothetical pixmap with shadow [INPUTS] already applied.
The width, height and position of the unshadowed pixmap, [OUTPUTS] that would, after having it's shadow added, take up the above input bound. CalcShadowBound()
A transparency/alpha map, it's width, height and position [INPUTS]
The width, height and position of the shadow [OUTPUTS] DrawShadow()
A shadow map, it's width, height and position, [INPUTS] A transparency/alpha map, it's width, height and position
The shadow drawn onto the shadow map [OUTPUTS]

Definition at line 169 of file ShadowTl.h.


Constructor & Destructor Documentation

CShadowerFlat::CShadowerFlat  ) 
 

Definition at line 178 of file ShadowTl.cpp.

00179 {
00180     pShadower_m = NULL;
00181 }

CShadowerFlat::~CShadowerFlat  )  [virtual]
 

Definition at line 183 of file ShadowTl.cpp.

00184 {
00185     if( pShadower_m )
00186         pShadower_m->Release();
00187 }

CShadowerFlat::CShadowerFlat const CShadowerFlat  )  [private]
 

Definition at line 189 of file ShadowTl.cpp.

00190 {
00191     pShadower_m = NULL;
00192 }


Member Function Documentation

HRESULT CShadowerFlat::_Init_  )  [virtual]
 

Definition at line 199 of file ShadowTl.cpp.

00200 {
00201     
00202     // if( pShadower_m )
00203     {
00204         // already initialised so drop out
00205         return S_OK;
00206     }
00207     
00208     HRESULT hr = ::CoCreateInstance( CLSID_CComShadowerFlat, NULL, CLSCTX_INPROC_SERVER, IID_IComShadowerFlat,
00209                                      (void**)&pShadower_m );
00210     if( FAILED( hr ) )
00211         return hr;
00212 
00213     pShadower_m->SwitchToTransparencyInsteadOfAlpha( FALSE );
00214     pShadower_m->SwitchToUpsideDownPixelAddressing( TRUE );
00215 
00216     return S_OK;
00217 }

HRESULT CShadowerFlat::CalcShadowBound ACoordPixels  ShadowWidHei,
ACoordPixels  ShadowPos,
const AAlphaChannel TransparencyMap,
const ACoordPixels tWidHei,
const ACoordPixels tPos
const [virtual]
 

Definition at line 334 of file ShadowTl.cpp.

00336 {
00337     /*
00338     if( pShadower_m )
00339         return pShadower_m->CalcShadowBound( ShadowWidHei, ShadowPos, TransparencyIn, tWidHei, tPos );
00340     else
00341         return E_FAIL;
00342         */
00343 
00344     return S_OK;
00345 }

HRESULT CShadowerFlat::DrawShadow const AAlphaChannel ShadowMapOut,
const ACoordPixels sWidHei,
const ACoordPixels sPos,
const AAlphaChannel TransparencyMapIn,
const ACoordPixels tWidHei,
const ACoordPixels tPos
const [virtual]
 

Definition at line 347 of file ShadowTl.cpp.

00349 {
00350     /*
00351     if( pShadower_m )
00352         return  pShadower_m->DrawShadow( ShadowOut, sWidHei, sPos, TransparencyIn, tWidHei, tPos );
00353     else
00354         return  E_FAIL;
00355         */
00356 
00357     return S_OK;
00358 }

void CShadowerFlat::GetBaseline AFloatPt01 Baseline  )  const [virtual]
 

Definition at line 255 of file ShadowTl.cpp.

00256 {
00257     /*
00258     if( pShadower_m )
00259         pShadower_m->GetBaseline( Baseline );*/
00260 }

void CShadowerFlat::GetBlurrinessRange APixels Min,
APixels Max
const [virtual]
 

Definition at line 271 of file ShadowTl.cpp.

00272 {
00273     /*
00274     if( pShadower_m )
00275         pShadower_m->GetBlurrinessRange( Min,  Max );
00276         */
00277 }

void CShadowerFlat::GetChoices BOOL *  MakeWallShadow,
AFloatPt01 Darkness01,
APixels Blurriness,
ACoordPixels  XYPosition,
ADegrees Tilt,
AFloatPt01 YScale01
const [virtual]
 

Definition at line 246 of file ShadowTl.cpp.

00248 {
00249     /*
00250     if( pShadower_m )
00251         pShadower_m->GetChoices( MakeWallShadow, Darkness01, Blurriness, XYPosition, Tilt, YScale01 );
00252         */
00253 }

void CShadowerFlat::GetDarknessRange AFloatPt01 Min,
AFloatPt01 Max
const [virtual]
 

Definition at line 263 of file ShadowTl.cpp.

00264 {
00265     /*
00266     if( pShadower_m )
00267         pShadower_m->GetDarknessRange( Min, Max );
00268         */
00269 }

void CShadowerFlat::GetPositionRange ACoordPixels  Min,
ACoordPixels  Max
const [virtual]
 

Definition at line 279 of file ShadowTl.cpp.

00280 {
00281     /*
00282     if( pShadower_m )
00283         pShadower_m->GetPositionRange( Min, Max );
00284         */
00285 }

void CShadowerFlat::GetProjectionRange ADegrees MinTilt,
ADegrees MaxTilt,
AFloatPt01 MinYScale,
AFloatPt01 MaxYScale
const [virtual]
 

Definition at line 287 of file ShadowTl.cpp.

00289 {
00290     /*
00291     if( pShadower_m )
00292         pShadower_m->GetProjectionRange( MinTilt, MaxTilt, MinYScale, MaxYScale );
00293         */
00294 }

HRESULT CShadowerFlat::InverseShadowBoundCalc ACoordPixels  UnshadowedWidHei,
ACoordPixels  UnshadowedPos,
const ACoordPixels ShadowedWidHei,
const AFloatPt01 Baseline
const [virtual]
 

Definition at line 321 of file ShadowTl.cpp.

00323 {
00324     /*
00325     if( pShadower_m )
00326         return pShadower_m->InverseShadowBoundCalc( UnshadowedWidHei, UnshadowedPos, ShadowedWidHei, Baseline );
00327     else
00328         return E_FAIL;
00329         */
00330 
00331     return S_OK;
00332 }

CShadowerFlat & CShadowerFlat::operator= const CShadowerFlat  )  [private]
 

Definition at line 194 of file ShadowTl.cpp.

00195 {
00196    return *this;
00197 }

void CShadowerFlat::SetBaseline const AFloatPt01 Baseline  )  [virtual]
 

Definition at line 237 of file ShadowTl.cpp.

00238 {
00239     /*
00240     if( pShadower_m )
00241         pShadower_m->SetBaseline( Baseline );
00242         */
00243 }

void CShadowerFlat::SetChoices const BOOL *  MakeWallShadow,
const AFloatPt01 Darkness01,
const APixels Blurriness,
const ACoordPixels  XYPosition,
const ADegrees Tilt,
const AFloatPt01 YScale01
[virtual]
 

Definition at line 228 of file ShadowTl.cpp.

00230 {
00231     /*
00232     if( pShadower_m )
00233         pShadower_m->SetChoices( MakeWallShadow, Darkness01, Blurriness, XYPosition, Tilt, YScale01 );
00234         */
00235 }

void CShadowerFlat::SetChoicesToDefault  )  [virtual]
 

Definition at line 220 of file ShadowTl.cpp.

00221 {
00222     /*
00223     if( pShadower_m )
00224         pShadower_m->SetChoicesToDefault();
00225         */
00226 }

HRESULT CShadowerFlat::SwitchToTransparencyInsteadOfAlpha BOOL  YesOrNo  )  [virtual]
 

Definition at line 297 of file ShadowTl.cpp.

00298 {
00299     /*
00300     if( pShadower_m )
00301         return pShadower_m->SwitchToTransparencyInsteadOfAlpha( YesOrNo );
00302     else
00303         return E_FAIL;
00304         */
00305 
00306     return S_OK;
00307 }

HRESULT CShadowerFlat::SwitchToUpsideDownPixelAddressing BOOL  YesOrNo  )  [virtual]
 

Definition at line 309 of file ShadowTl.cpp.

00310 {
00311     /*
00312     if( pShadower_m )
00313         return pShadower_m->SwitchToUpsideDownPixelAddressing( YesOrNo );
00314     else
00315         return E_FAIL;
00316         */
00317     return S_OK;
00318 }


Member Data Documentation

const GUID CShadowerFlat::CLSID_CComShadowerFlat [static, private]
 

Initial value:

                    { 0x326f6db1, 0x7b82, 0x11d1, { 0xac, 0xbf, 0x0, 0x20, 0xaf, 0xe1, 0x4b, 0x7d } }

Definition at line 223 of file ShadowTl.h.

const GUID CShadowerFlat::IID_IComShadowerFlat [static, private]
 

Initial value:

 
                    { 0x326f6db0, 0x7b82, 0x11d1, { 0xac, 0xbf, 0x0, 0x20, 0xaf, 0xe1, 0x4b, 0x7d } }

Definition at line 222 of file ShadowTl.h.

IComShadowerFlat* CShadowerFlat::pShadower_m [private]
 

Definition at line 219 of file ShadowTl.h.


The documentation for this class was generated from the following files:
Generated on Sat Nov 10 03:53:17 2007 for Camelot by  doxygen 1.4.4