[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]
[XaraXtreme-commits] Commit Complete
Commit by : gavin
Repository : xara
Revision : 735
Date : Wed Mar 29 15:53:08 BST 2006
Changed paths:
M /Trunk/XaraLX
M /Trunk/XaraLX/GDraw/gdraw.h
M /Trunk/XaraLX/Kernel/GDrawIntf.cpp
M /Trunk/XaraLX/Kernel/GDrawIntf.h
M /Trunk/XaraLX/Kernel/XaDraw.cpp
M /Trunk/XaraLX/Kernel/XaDraw.h
M /Trunk/XaraLX/Kernel/XaDrwOld.cpp
M /Trunk/XaraLX/Kernel/XaDrwOld.h
M /Trunk/XaraLX/Kernel/biasgain.cpp
M /Trunk/XaraLX/Kernel/fillval.cpp
M /Trunk/XaraLX/Kernel/gradtbl.cpp
M /Trunk/XaraLX/Kernel/xagdraw.h
M /Trunk/XaraLX/wxCamelot.vcproj
M /Trunk/XaraLX/wxOil/fontbase.h
M /Trunk/XaraLX/wxOil/gdrawcon.h
M /Trunk/XaraLX/wxOil/grndrgn.cpp
Removed a lot of bitmap functionality from XaraLX and moved it into CDraw where it can be handled more efficiently. These changes require the newest version of CDraw.
Removed the definition of LOGFONT from fontbase.h. This definition was causing a compiler fault and doesn't appear to be used anyway.
Diff:
Index: Trunk/XaraLX/Kernel/gradtbl.cpp
===================================================================
--- Trunk/XaraLX/Kernel/gradtbl.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/gradtbl.cpp (revision 735)
@@ -1462,6 +1462,9 @@
// were a feather profile - we need to do a bit of extra work to ensure that ilans
// feather renders correctly. We MUST ensure that ilans white part of the bitmap
// is rendered as 100% transparent. The following lines of code do this ....
+
+ // TODO: (Gavin) Why on earth is this setting Index-2 and Index-1 to 255
+ // when the code below overwrites Index-2 anyway?
m_pTable->Table[Index-2] = static_cast<BYTE> ( 255 );
m_pTable->Table[Index-1] = static_cast<BYTE> ( 255 );
}
@@ -1479,6 +1482,7 @@
}
}
+ // TODO: (Gavin) Why on earth is this setting 0xFE and not 0xFF?
m_pTable->Table[0xFE] = static_cast <BYTE> ( EndTransp );
return(TRUE);
@@ -2333,6 +2337,11 @@
// When doing alt-rainbow, if one end colour has no specific hue (saturation near 0)
// then use the other colour's hue (if any)
+ //
+ // TODO: WRONG!!! This should always be doing these two tests, not just when
+ // the Effect equals EFFECT_HSV_LONG. Note also that the long HSV colour
+ // generation is incorrect, although I'm not too sure why. (Gavin).
+ //
if (Effect == EFFECT_HSV_LONG)
{
if (StartDef.Saturation < 2 && EndDef.Saturation >= 2)
Index: Trunk/XaraLX/Kernel/XaDrwOld.h
===================================================================
--- Trunk/XaraLX/Kernel/XaDrwOld.h (revision 734)
+++ Trunk/XaraLX/Kernel/XaDrwOld.h (revision 735)
@@ -272,6 +272,10 @@
BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
pcPOINT PointA, pcPOINT PointB, pcPOINT PointC, pcPOINT PointD
);
+INT32 XaBitmapOld_SetBias(double fBias);
+INT32 XaBitmapOld_SetGain(double fGain);
+INT32 XaBitmapOld_SetContone( UINT32 uContoneStyle, COLORREF rgbStart=0x000000, COLORREF rgbEnd=0xFFFFFF );
+INT32 XaBitmapOld_SetTransparencyRamp( BYTE uStart=0x00, BYTE uEnd=0xFF );
INT32 XaColourOld_SetTilePattern(
pcBITMAPINFOHEADER BitmapInfo,
pcBYTE Bitmap,
Index: Trunk/XaraLX/Kernel/biasgain.cpp
===================================================================
--- Trunk/XaraLX/Kernel/biasgain.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/biasgain.cpp (revision 735)
@@ -595,7 +595,8 @@
static const AFp kOne( 1.0 );
static const AFp kTwo( 2.0 );
- const AFp Output( Input / ( ( kOne / Bias - kTwo ) * ( kOne - Input ) + kOne ) );
+// const AFp Output( Input / ( ( kOne / Bias - kTwo ) * ( kOne - Input ) + kOne ) );
+ const AFp Output( Input*Bias / ( ( kOne - kTwo*Bias ) * ( kOne - Input ) + Bias ) );
return Output;
@@ -619,22 +620,20 @@
static const AFp kTwo( 2.0 );
static const AFp kHalf( 0.5 );
+// const AFp CommonPart( ( kOne / Gain - kTwo ) * ( kOne - kTwo * Input ) );
+ const AFp CommonPart( ( kOne - kTwo*Gain ) * ( kOne - kTwo * Input ) );
- const AFp CommonPart( ( kOne / Gain - kTwo ) * ( kOne - kTwo * Input ) );
- AFp Output( 0.0 );
-
if( Input < kHalf )
{
- Output = Input / ( CommonPart + kOne );
+// return Input / ( CommonPart + kOne );
+ return Input*Gain / ( CommonPart + Gain );
}
else
{
- Output = ( CommonPart - Input ) / ( CommonPart - kOne );
+// return ( CommonPart - Input ) / ( CommonPart - kOne );
+ return ( CommonPart - Input*Gain ) / ( CommonPart - Gain );
}
-
- return Output;
-
}
@@ -651,5 +650,3 @@
RangeLength_m = AFp( 1.0 );
}
-
-
Index: Trunk/XaraLX/Kernel/fillval.cpp
===================================================================
--- Trunk/XaraLX/Kernel/fillval.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/fillval.cpp (revision 735)
@@ -847,7 +847,6 @@
void ColourFillAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "Removed RenderRegion usage" )
pRegion->SetFillGeometry(this, Temp);
}
@@ -870,7 +869,6 @@
void ColourFillAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "Removed RenderRegion usage" )
pRegion->RestoreFillGeometry(this, Temp);
}
@@ -889,7 +887,6 @@
{
if (NewCol == NULL)
{
-//#pragma message( __LOCMSG__ "Removed ColorManager usage" )
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
_R(IDS_WHITENAME), &Colour);
}
@@ -1005,8 +1002,6 @@
void FlatFillAttribute::SetStartColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "FlatFillAttribute::SetStartColour - do nothing" )
-// TRACE( _T("Warning - FlatFillAttribute::SetStartColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -1326,8 +1321,6 @@
BOOL GradFillAttribute::RenderFill(RenderRegion *pRegion, Path *pPath)
{
-//#pragma message( __LOCMSG__ "GradFillAttribute::RenderFill - do nothing" )
-// TRACE( _T("Warning - GradFillAttribute::RenderFill called
") );
if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderRegion)) )
{
// Safe to cast now
@@ -1399,8 +1392,6 @@
void GradFillAttribute::SetEndColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "GradFillAttribute::SetEndColour - do nothing" )
-// TRACE( _T("Warning - GradFillAttribute::SetEndColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -2396,8 +2387,6 @@
void BitmapFillAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "BitmapFillAttribute::Render - do nothing" )
-// TRACE( _T("Warning - BitmapFillAttribute::Render called
") );
pRegion->SetFillGeometry(this, Temp);
}
@@ -2420,8 +2409,6 @@
void BitmapFillAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "BitmapFillAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - BitmapFillAttribute::Restore called
") );
pRegion->RestoreFillGeometry(this, Temp);
}
@@ -2673,8 +2660,6 @@
BOOL BitmapFillAttribute::RenderFill(RenderRegion *pRegion, Path *pPath)
{
-//#pragma message( __LOCMSG__ "BitmapFillAttribute::RenderFill - do nothing" )
-// TRACE( _T("Warning - BitmapFillAttribute::RenderFill called
") );
if ( pRegion->IsKindOf(CC_RUNTIME_CLASS(GRenderRegion)) )
{
// Safe to cast now
@@ -2851,8 +2836,6 @@
void BitmapFillAttribute::SetStartColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "BitmapFillAttribute::SetStartColour - do nothing" )
-// TRACE( _T("Warning - BitmapFillAttribute::SetStartColour called
") );
if (NewCol == NULL)
Colour = COLOUR_NONE;
else
@@ -2887,12 +2870,8 @@
void BitmapFillAttribute::SetEndColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "BitmapFillAttribute::SetEndColour - do nothing" )
-// TRACE( _T("Warning - BitmapFillAttribute::SetEndColour called
") );
if (NewCol == NULL)
- {
EndColour = COLOUR_NONE;
- }
else
EndColour = *NewCol;
@@ -3320,8 +3299,6 @@
void FractalFillAttribute::SetStartColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "FractalFillAttribute::SetStartColour - do nothing" )
-// TRACE( _T("Warning - FractalFillAttribute::SetStartColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -3350,8 +3327,6 @@
void FractalFillAttribute::SetEndColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "FractalFillAttribute::SetEndColour - do nothing" )
-// TRACE( _T("Warning - FractalFillAttribute::SetEndColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -3732,8 +3707,6 @@
void NoiseFillAttribute::SetStartColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "NoiseFillAttribute::SetStartColour - do nothing" )
-// TRACE( _T("Warning - NoiseFillAttribute::SetStartColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -3752,8 +3725,6 @@
void NoiseFillAttribute::SetEndColour(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "NoiseFillAttribute::SetEndColour - do nothing" )
-// TRACE( _T("Warning - NoiseFillAttribute::SetEndColour called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -3865,8 +3836,6 @@
ThreeColFillAttribute::ThreeColFillAttribute()
{
-//#pragma message( __LOCMSG__ "ThreeColFillAttribute::ThreeColFillAttribute - do nothing" )
-// TRACE( _T("Warning - ThreeColFillAttribute::ThreeColFillAttribute called
") );
IsPersp = FALSE;
EndPoint2 = DocCoord(0,0);
@@ -4028,8 +3997,6 @@
void ThreeColFillAttribute::SetEndColour2(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "ThreeColFillAttribute::SetEndColour2 - do nothing" )
-// TRACE( _T("Warning - ThreeColFillAttribute::SetEndColour2 called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -4059,8 +4026,6 @@
FourColFillAttribute::FourColFillAttribute()
{
-//#pragma message( __LOCMSG__ "FourColFillAttribute::FourColFillAttribute - do nothing" )
-// TRACE( _T("Warning - FourColFillAttribute::FourColFillAttribute called
") );
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
_R(IDS_YELLOWNAME), &EndColour3);
}
@@ -4131,8 +4096,6 @@
void FourColFillAttribute::SetEndColour3(DocColour* NewCol)
{
-//#pragma message( __LOCMSG__ "FourColFillAttribute::SetEndColour3 - do nothing" )
-// TRACE( _T("Warning - FourColFillAttribute::SetEndColour3 called
") );
if (NewCol == NULL)
{
AttributeManager::FindDefaultColour(ColourManager::GetCurrentColourList(),
@@ -4315,8 +4278,6 @@
void TranspFillAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "TranspFillAttribute::Render - do nothing" )
-// TRACE( _T("Warning - TranspFillAttribute::Render called
") );
pRegion->SetTranspFillGeometry(this, Temp);
}
@@ -4339,8 +4300,6 @@
void TranspFillAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "TranspFillAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - TranspFillAttribute::Restore called
") );
pRegion->RestoreTranspFillGeometry(this, Temp);
}
@@ -5835,8 +5794,6 @@
void BitmapTranspFillAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "BitmapTranspFillAttribute::Render - do nothing" )
-// TRACE( _T("Warning - BitmapTranspFillAttribute::Render called
") );
pRegion->SetTranspFillGeometry(this, Temp);
}
@@ -5859,8 +5816,6 @@
void BitmapTranspFillAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "BitmapTranspFillAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - BitmapTranspFillAttribute::Restore called
") );
pRegion->RestoreTranspFillGeometry(this, Temp);
}
@@ -8053,8 +8008,6 @@
void FillMappingAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "FillMappingAttribute::Render - do nothing" )
-// TRACE( _T("Warning - FillMappingAttribute::Render called
") );
pRegion->SetFillMapping(this, Temp);
}
@@ -8077,8 +8030,6 @@
void FillMappingAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "FillMappingAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - FillMappingAttribute::Restore called
") );
pRegion->RestoreFillMapping(this, Temp);
}
@@ -8211,8 +8162,6 @@
void FillEffectAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "FillEffectAttribute::Render - do nothing" )
-// TRACE( _T("Warning - FillEffectAttribute::Render called
") );
pRegion->SetFillEffect(this, Temp);
}
@@ -8235,8 +8184,6 @@
void FillEffectAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "FillEffectAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - FillEffectAttribute::Restore called
") );
pRegion->RestoreFillEffect(this, Temp);
}
@@ -8476,8 +8423,6 @@
void TranspFillMappingAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "TranspFillMappingAttribute::Render - do nothing" )
-// TRACE( _T("Warning - TranspFillMappingAttribute::Render called
") );
pRegion->SetTranspFillMapping(this, Temp);
}
@@ -8500,8 +8445,6 @@
void TranspFillMappingAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "TranspFillMappingAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - TranspFillMappingAttribute::Restore called
") );
pRegion->RestoreTranspFillMapping(this, Temp);
}
@@ -8659,8 +8602,6 @@
void StrokeColourAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "StrokeColourAttribute::Render - do nothing" )
-// TRACE( _T("Warning - StrokeColourAttribute::Render called
") );
pRegion->SetLineColour(this, Temp);
}
@@ -8683,8 +8624,6 @@
void StrokeColourAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "StrokeColourAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - StrokeColourAttribute::Restore called
") );
pRegion->RestoreLineColour(this, Temp);
}
@@ -8804,8 +8743,6 @@
void StrokeTranspAttribute::Render(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "StrokeTranspAttribute::Render - do nothing" )
-// TRACE( _T("Warning - StrokeColourAttribute::Render called
") );
pRegion->SetLineTransp(this, Temp);
}
@@ -8828,8 +8765,6 @@
void StrokeTranspAttribute::Restore(RenderRegion *pRegion, BOOL Temp)
{
-//#pragma message( __LOCMSG__ "StrokeTranspAttribute::Restore - do nothing" )
-// TRACE( _T("Warning - StrokeColourAttribute::Restore called
") );
pRegion->RestoreLineTransp(this, Temp);
}
@@ -9945,7 +9880,6 @@
AttrStrokeColour * pStartColour = (AttrStrokeColour *)pVal;
StrokeColourAttribute * pColourAttr = &(pStartColour->Value);
-//#pragma message( __LOCMSG__ "Removed DocColour usage" )
BOOL StartIsNoColour = pColourAttr->Colour.IsTransparent();
pVal = NULL;
@@ -9958,7 +9892,6 @@
AttrStrokeColour * pEndColour = (AttrStrokeColour *)pVal;
pColourAttr = &(pEndColour->Value);
-//#pragma message( __LOCMSG__ "Removed DocColour usage" )
BOOL EndIsNoColour = pColourAttr->Colour.IsTransparent();
// Blend the Start and End Transparencies
@@ -9996,8 +9929,6 @@
BOOL FillGeometryAttribute::BlendFillColours(DocColour* Start, DocColour* End, DocColour* Blend,
double& Ratio, BlendAttrParam* pBlendParam)
{
-//#pragma message( __LOCMSG__ "FillGeometryAttribute::BlendFillColours - do nothing" )
-// TRACE( _T("Warning - FillGeometryAttribute::BlendFillColours called
") );
ERROR3IF(Blend == NULL || pBlendParam == NULL, "Illegal NULL param");
if (Start == NULL)
Index: Trunk/XaraLX/Kernel/GDrawIntf.h
===================================================================
--- Trunk/XaraLX/Kernel/GDrawIntf.h (revision 734)
+++ Trunk/XaraLX/Kernel/GDrawIntf.h (revision 735)
@@ -249,6 +249,10 @@
CONST POINT *PointC,
CONST POINT *PointD
);
+ virtual BOOL SetBias(double fBias) ;
+ virtual BOOL SetGain(double fGain) ;
+ virtual BOOL SetContone( UINT32, COLORREF, COLORREF );
+ virtual BOOL SetTransparencyRamp( BYTE, BYTE );
virtual BOOL SetBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD );
Index: Trunk/XaraLX/Kernel/XaDraw.cpp
===================================================================
--- Trunk/XaraLX/Kernel/XaDraw.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/XaDraw.cpp (revision 735)
@@ -870,6 +870,38 @@
return nRetVal;
}
+INT32 XaBitmap_SetBias( double fBias )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmap_SetBias"),pContext);
+ INT32 nRetVal = g_XaFnsOriginal.pfnXaBitmap_SetBias(pContext,fBias);
+ XA_DRAW_LEAVE(pConvert,?);
+ return nRetVal;
+}
+
+INT32 XaBitmap_SetGain( double fGain )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmap_SetGain"),pContext);
+ INT32 nRetVal = g_XaFnsOriginal.pfnXaBitmap_SetGain(pContext,fGain);
+ XA_DRAW_LEAVE(pConvert,?);
+ return nRetVal;
+}
+
+INT32 XaBitmap_SetContone( pGCONTEXT pContext, UINT32 uContoneStyle, COLORREF rgbStart,COLORREF rgbEnd )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmap_SetContone"),pContext);
+ INT32 nRetVal = g_XaFnsOriginal.pfnXaBitmap_SetContone(pContext,uContoneStyle,rgbStart,rgbEnd);
+ XA_DRAW_LEAVE(pConvert,?);
+ return nRetVal;
+}
+
+INT32 XaBitmap_SetTransparencyRamp( pGCONTEXT pContext, BYTE uStart, BYTE uEnd )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmap_SetTransparencyRamp"),pContext);
+ INT32 nRetVal = g_XaFnsOriginal.pfnXaBitmap_SetTransparencyRamp(pContext,uStart,uEnd);
+ XA_DRAW_LEAVE(pConvert,?);
+ return nRetVal;
+}
+
INT32 XaColourDbg_SetTilePattern(
pGCONTEXT pContext,
pcBITMAPINFOHEADER BitmapInfo,
@@ -2013,6 +2045,10 @@
"GColour_SetTransparent3WayGraduation4",
"GColour_SetTransparent4WayGraduation",
"GColour_SetTransparent4WayGraduation4",
+ "GBitmap_SetBias",
+ "GBitmap_SetGain",
+ "GBitmap_SetContone",
+ "GBitmap_SetTransparencyRamp",
"GColour_SetTilePattern",
"GColour_SetTilePattern4",
"GColour_SetTransparentTilePattern",
@@ -2145,6 +2181,10 @@
XaColourDbg_SetTransparent3WayGraduation4,
XaColourDbg_SetTransparent4WayGraduation,
XaColourDbg_SetTransparent4WayGraduation4,
+ XaBitmapDbg_SetBias,
+ XaBitmapDbg_SetGain,
+ XaBitmapDbg_SetContone,
+ XaBitmapDbg_SetTransparencyRamp,
XaColourDbg_SetTilePattern,
XaColourDbg_SetTilePattern4,
XaColourDbg_SetTransparentTilePattern,
Index: Trunk/XaraLX/Kernel/xagdraw.h
===================================================================
--- Trunk/XaraLX/Kernel/xagdraw.h (revision 734)
+++ Trunk/XaraLX/Kernel/xagdraw.h (revision 735)
@@ -197,6 +197,11 @@
(GColour_SetTransparent4WayGraduation)
#define XaColour_SetTransparent4WayGraduation4 \
(GColour_SetTransparent4WayGraduation4)
+#define XaBitmap_SetBias (GBitmap_SetBias)
+#define XaBitmap_SetGain (GBitmap_SetGain)
+#define XaBitmap_SetContone (GBitmap_SetContone)
+#define XaBitmap_SetTransparencyRamp \
+ (GBitmap_SetTransparencyRamp)
#define XaColour_SetTilePattern (GColour_SetTilePattern)
#define XaColour_SetTilePattern4 (GColour_SetTilePattern4)
#define XaColour_SetTransparentTilePattern \
Index: Trunk/XaraLX/Kernel/GDrawIntf.cpp
===================================================================
--- Trunk/XaraLX/Kernel/GDrawIntf.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/GDrawIntf.cpp (revision 735)
@@ -1596,7 +1596,6 @@
return XaColour_SelectPalette(m_pContext, FALSE != WhichPal );
}
-
/********************************************************************************************
> BOOL GDrawAsm::SetGraduation(
@@ -1776,8 +1775,48 @@
return (MakeCurrent() && (XaColour_SetTransparentGraduation4(m_pContext, Style, Table->GetTable(), PointA, PointB, PointC, PointD ) ? FALSE : TRUE));
}
+/********************************************************************************************/
+BOOL GDrawAsm::SetBias( double fBias )
+{
+ CriticalSection Ralph;
+ CamProfile cp(CAMPROFILE_GDRAW);
+ return MakeCurrent() && (XaBitmap_SetBias(m_pContext,fBias) ? FALSE : TRUE);
+}
+
+/********************************************************************************************/
+
+BOOL GDrawAsm::SetGain( double fGain )
+{
+ CriticalSection Ralph;
+ CamProfile cp(CAMPROFILE_GDRAW);
+
+ return MakeCurrent() && (XaBitmap_SetGain(m_pContext,fGain) ? FALSE : TRUE);
+}
+
+/********************************************************************************************/
+
+BOOL GDrawAsm::SetContone( UINT32 uContoneStyle, COLORREF rgbStart, COLORREF rgbEnd )
+{
+ CriticalSection Ralph;
+ CamProfile cp(CAMPROFILE_GDRAW);
+
+ return MakeCurrent() && (XaBitmap_SetContone(m_pContext,uContoneStyle,rgbStart,rgbEnd) ? FALSE : TRUE);
+}
+
+/*******************************************************************************************/
+
+BOOL GDrawAsm::SetTransparencyRamp( BYTE uStart, BYTE uEnd )
+{
+ CriticalSection Ralph;
+ CamProfile cp(CAMPROFILE_GDRAW);
+
+ return MakeCurrent() && (XaBitmap_SetTransparencyRamp(m_pContext,uStart,uEnd) ? FALSE : TRUE);
+}
+
+/*******************************************************************************************/
+
BOOL GDrawAsm::SetBitmapFill( LPBITMAPINFOHEADER bmInfo, LPBYTE lpBytes, DWORD Style, LPPOINT Points,
COLORREF DefaultColour, LPRGBQUAD ColourTable,
LPBYTE Red, LPBYTE Green, LPBYTE Blue, LPBYTE Trans, DWORD Offset)
Index: Trunk/XaraLX/Kernel/XaDrwOld.cpp
===================================================================
--- Trunk/XaraLX/Kernel/XaDrwOld.cpp (revision 734)
+++ Trunk/XaraLX/Kernel/XaDrwOld.cpp (revision 735)
@@ -815,6 +815,38 @@
XA_DRAW_LEAVE(s_pContext);
return nRetVal;
}
+
+INT32 XaBitmapOld_SetBias( double fBias )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmapOld_SetBias"),s_pContext);
+ INT32 nRetVal = XaBitmap_SetBias(s_pContext,fBias);
+ XA_DRAW_LEAVE(s_pConvert);
+ return nRetVal;
+}
+
+INT32 XaBitmapOld_SetGain( double fGain )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmapOld_SetGain"),s_pContext);
+ INT32 nRetVal = XaBitmap_SetGain(s_pContext,fGain);
+ XA_DRAW_LEAVE(s_pConvert);
+ return nRetVal;
+}
+
+INT32 XaBitmapOld_SetContone( UINT32 uContoneStyle, COLORREF rgbStart,COLORREF rgbEnd )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmapOld_SetContone"),s_pContext);
+ INT32 nRetVal = XaBitmap_SetContone(s_pContext,uContoneStyle,rgbStart,rgbEnd);
+ XA_DRAW_LEAVE(s_pConvert);
+ return nRetVal;
+}
+
+INT32 XaBitmapOld_SetTransparencyRamp( BYTE uStart, BYTE uEnd )
+{
+ XA_DRAW_ENTER(TEXT("XaBitmapOld_SetTransaprencyRamp"),s_pContext);
+ INT32 nRetVal = XaBitmap_SetTransparencyRamp(s_pContext,uStart,uEnd);
+ XA_DRAW_LEAVE(s_pConvert);
+ return nRetVal;
+}
INT32 XaColourOld_SetTilePattern(
pcBITMAPINFOHEADER BitmapInfo,
Index: Trunk/XaraLX/Kernel/XaDraw.h
===================================================================
--- Trunk/XaraLX/Kernel/XaDraw.h (revision 734)
+++ Trunk/XaraLX/Kernel/XaDraw.h (revision 735)
@@ -294,6 +294,10 @@
BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
pcPOINT PointA, pcPOINT PointB, pcPOINT PointC, pcPOINT PointD
) ;
+ INT32 (*pfnXaBitmap_SetBias)(pGCONTEXT pContext,double fBias) ;
+ INT32 (*pfnXaBitmap_SetGain)(pGCONTEXT pContext,double fGain) ;
+ INT32 (*pfnXaBitmap_SetContone)( pGCONTEXT pContext,UINT32 uContoneStyle,COLORREF rgbStart,COLORREF rgbEnd ) ;
+ INT32 (*pfnXaBitmap_SetTransparencyRamp)( pGCONTEXT pContext,BYTE uStart,BYTE uEnd ) ;
INT32 (*pfnXaColour_SetTilePattern)(
pGCONTEXT pContext,
pcBITMAPINFOHEADER BitmapInfo,
@@ -764,6 +768,11 @@
(g_XaFns.pfnXaColour_SetTransparent4WayGraduation)
#define XaColour_SetTransparent4WayGraduation4 \
(g_XaFns.pfnXaColour_SetTransparent4WayGraduation4)
+#define XaBitmap_SetBias (g_XaFns.pfnXaBitmap_SetBias)
+#define XaBitmap_SetGain (g_XaFns.pfnXaBitmap_SetGain)
+#define XaBitmap_SetContone (g_XaFns.pfnXaBitmap_SetContone)
+#define XaBitmap_SetTransparencyRamp \
+ (g_XaFns.pfnXaBitmap_SetTransparencyRamp)
#define XaColour_SetTilePattern (g_XaFns.pfnXaColour_SetTilePattern)
#define XaColour_SetTilePattern4 (g_XaFns.pfnXaColour_SetTilePattern4)
#define XaColour_SetTransparentTilePattern \
Index: Trunk/XaraLX/wxOil/fontbase.h
===================================================================
--- Trunk/XaraLX/wxOil/fontbase.h (revision 734)
+++ Trunk/XaraLX/wxOil/fontbase.h (revision 735)
@@ -133,6 +133,7 @@
};
// The kernel likes dealing with LOGFONT and ENUMLOGFONT structures, so we do it this favour
+/*
struct LOGFONT
{
String_64 FaceName;
@@ -143,7 +144,7 @@
{
LOGFONT elfLogFont;
};
-
+*/
/********************************************************************************************
> class FontBase : public CCObject
Index: Trunk/XaraLX/wxOil/gdrawcon.h
===================================================================
--- Trunk/XaraLX/wxOil/gdrawcon.h (revision 734)
+++ Trunk/XaraLX/wxOil/gdrawcon.h (revision 735)
@@ -225,6 +225,11 @@
CONST POINT *PointC,
CONST POINT *PointD
) = 0;
+
+ virtual BOOL SetBias(double fBias) = 0;
+ virtual BOOL SetGain(double fGain) = 0;
+ virtual BOOL SetContone( UINT32, COLORREF=0x000000, COLORREF=0xFFFFFF ) = 0;
+ virtual BOOL SetTransparencyRamp( BYTE=0x00,BYTE=0xFF ) = 0;
virtual BOOL SetBitmapFill( LPBITMAPINFOHEADER, LPBYTE, DWORD, LPPOINT, COLORREF, LPRGBQUAD,
LPBYTE, LPBYTE, LPBYTE, LPBYTE, DWORD = 0) = 0;
Index: Trunk/XaraLX/wxOil/grndrgn.cpp
===================================================================
--- Trunk/XaraLX/wxOil/grndrgn.cpp (revision 734)
+++ Trunk/XaraLX/wxOil/grndrgn.cpp (revision 735)
@@ -3457,7 +3457,7 @@
BOOL GRenderRegion::RenderBitmapFill(Path *PathToDraw, BitmapFillAttribute* Fill)
{
- if (Fill->GetBitmap() == NULL || Fill->GetBitmap()->ActualBitmap == NULL)
+ if ( Fill==NULL || Fill->GetBitmap()==NULL || Fill->GetBitmap()->ActualBitmap==NULL)
return FALSE; // if no bitmap
ENSURE( Fill->GetBitmap()->ActualBitmap->IsKindOf( CC_RUNTIME_CLASS( CWxBitmap ) ),
@@ -3466,11 +3466,11 @@
INT32 bpp = Fill->GetBitmap()->GetBPP();
CWxBitmap *WinBM = NULL;
CWxBitmap *OrigWinBM = NULL;
- BYTE *pGreyTable = NULL;
- BOOL bContoned = FALSE;
+// BYTE *pGreyTable = NULL;
+// BOOL bContoned = FALSE;
// BOOL bAlpha = FALSE;
-
- if (Fill && Fill->GetStartColour()!=NULL && Fill->GetEndColour()!=NULL)
+/*
+ if (Fill->GetStartColour()!=NULL && Fill->GetEndColour()!=NULL)
{
// The bitmap is contoned
bContoned = TRUE;
@@ -3494,9 +3494,9 @@
if (WinBM == NULL)
{
- // Use the normal bitmap
+*/ // Use the normal bitmap
WinBM = (CWxBitmap*)Fill->GetBitmap()->ActualBitmap;
- }
+// }
if (WinBM == NULL || WinBM->BMInfo == NULL || WinBM->BMBytes == NULL)
return FALSE;
@@ -3547,7 +3547,7 @@
// Do the colour correction. This may produce a new pointer in Palette or BitmapBits,
// which we should CCFree() when we are done with it - see the end of this function
- ColourCorrectBitmap(Fill, WinBM->BMInfo, &Palette);
+/* ColourCorrectBitmap(Fill, WinBM->BMInfo, &Palette);
if ( bContoned && bpp>8 )
Style |= 0x80 ;
@@ -3574,7 +3574,7 @@
if (OldPalette != WinBM->BMInfo->bmiColors)
CCFree(OldPalette); // Don't need the contone palette any more
}
-
+*/
// Check for transparent bitmap plotting
BYTE *BitmapBits = WinBM->BMBytes;
@@ -3613,30 +3613,31 @@
}
// If we didn't create a temporary palette, then we'll use the original bitmap
- if (Palette == NULL)
+ if ( Palette==NULL && bpp<=8 && !Fill->IsKindOf(CC_RUNTIME_CLASS(FractalFillAttribute)) &&
+ !Fill->IsKindOf(CC_RUNTIME_CLASS( NoiseFillAttribute)) )
Palette = WinBM->BMInfo->bmiColors;
LPBYTE pTranspTable = NULL;
- if (uBitmapDepth==32 && bpp > 8)
+ if ( uBitmapDepth==32 && bpp==32 )
{
// If rendering a non-paletted bitmap, then gavin needs the
// transparency table to be passed in
pTranspTable = (LPBYTE) TranspTable.GetTable(); // this cast is OK as the structure
// returned is an array of bytes
Style |= 0x004000; // MarkH 15/7/99 Need to OR the Style with 0x004000 to say that
- // we want to use the alpha channel!!
+ // we want to use the alpha channel!!
}
BOOL bDoBitmapFill = TRUE;
BOOL bClearBitmapConv = FALSE;
BYTE* pSepTables = NULL;
- BGR *pCyanSepTable = NULL;
- BGR *pMagentaSepTable = NULL;
- BGR *pYellowSepTable = NULL;
- BGR *pBlackSepTable = NULL;
- BYTE *pUnderColourRemovalTable = NULL;
- BYTE *pBlackGenerationTable = NULL;
+// BGR *pCyanSepTable = NULL;
+// BGR *pMagentaSepTable = NULL;
+// BGR *pYellowSepTable = NULL;
+// BGR *pBlackSepTable = NULL;
+// BYTE *pUnderColourRemovalTable = NULL;
+// BYTE *pBlackGenerationTable = NULL;
CWxBitmap* pNewBitmap = NULL;
// --- Add Separation Style bits as approriate to the current colour separation mode
@@ -3710,11 +3711,24 @@
if (bDoBitmapFill)
{
//---------------------------------------------------------------------------------------
- // Bitmap scaling
+ // Setup contoning
//---------------------------------------------------------------------------------------
- // Andy Hills: removed, 27-10-00
+ if ( Fill->GetStartColour()!=NULL && Fill->GetEndColour()!=NULL )
+ {
+ DocColour* pCS = Fill->GetStartColour();
+ DocColour* pCE = Fill->GetEndColour ();
+ INT32 sr,sg,sb;
+ INT32 er,eg,eb;
+ pCS->GetRGBValue(&sr,&sg,&sb);
+ pCE->GetRGBValue(&er,&eg,&eb);
+ GetDrawContext()->SetContone(GetFillEffect()+1,RGB(sr,sg,sb),RGB(er,eg,eb));
+ }
+ else
+ GetDrawContext()->SetContone(0);
+ GetDrawContext()->SetBias(Fill->GetProfile().GetBias()) ;
+ GetDrawContext()->SetGain(Fill->GetProfile().GetGain()) ;
//---------------------------------------------------------------------------------------
// Smoothing decisions
@@ -3828,7 +3842,7 @@
GetDrawContext()->SetSeparationTables(); // Defaults to setting everything to NULL
CCFree(pSepTables);
}
-
+/*
if (pCyanSepTable)
CCFree(pCyanSepTable);
if (pMagentaSepTable)
@@ -3841,7 +3855,7 @@
CCFree(pUnderColourRemovalTable);
if (pBlackGenerationTable)
CCFree(pBlackGenerationTable);
-
+*/
// Reset smoothing flags
SetSmoothingFlags(NULL);
@@ -4180,8 +4194,10 @@
"Strange bitmapfill");
UINT32 bpp = Fill->GetBitmap()->GetBPP();
- CWxBitmap *WinBM = NULL;
+ CWxBitmap *WinBM = (CWxBitmap*)Fill->GetBitmap()->ActualBitmap;
+/* CWxBitmap *WinBM = NULL;
+
BYTE *pGreyTable = NULL;
if ( bpp<=8 )
{
@@ -4200,7 +4216,7 @@
// Use the normal bitmap
WinBM = (CWxBitmap*)Fill->GetBitmap()->ActualBitmap;
}
-
+*/
if (WinBM == NULL || WinBM->BMInfo == NULL || WinBM->BMBytes == NULL)
return FALSE;
@@ -4210,7 +4226,7 @@
StartTransp = *Fill->GetStartTransp();
if (Fill->GetEndTransp() != NULL)
EndTransp = *Fill->GetEndTransp();
-
+/*
TransparencyRamp *pTranspRamp=Fill->GetTranspRamp();
// Note: BuildBitmapTable is optimised internally depending upon the profile ....
pTranspTable->BuildBitmapTable(StartTransp, EndTransp, pTranspRamp, Fill->GetProfile ());
@@ -4226,7 +4242,24 @@
aRamp[i] = pRamp[pGreyTable[i]];
pRamp = aRamp;
}
+*/
+ BYTE aRamp[0x100];
+ BYTE* pRamp = NULL;
+ if ( bpp<=8 && !Fill->IsKindOf(CC_RUNTIME_CLASS(FractalTranspFillAttribute)) &&
+ !Fill->IsKindOf(CC_RUNTIME_CLASS( NoiseTranspFillAttribute)) )
+ {
+ RGBQUAD* pPalette = WinBM->BMInfo->bmiColors;
+ if ( pPalette )
+ {
+ for (INT32 i=0; i<1<<bpp; i++)
+ aRamp[i] = (pPalette[i].rgbRed *0x4D4D4D+
+ pPalette[i].rgbGreen*0x979797+
+ pPalette[i].rgbBlue *0x1C1C1C) >> 24;
+ pRamp = aRamp;
+ }
+ }
+
// convert ArtWorks style attribute into Gavin-style
POINT PGram[4];
PGram[0].x = (*Fill->GetStartPoint()).x;
@@ -4276,6 +4309,10 @@
if ( bpp==32 && Fill->GetBitmap()->IsTransparent() )
TranspStyle |= 0x8000;
+ GetDrawContext()->SetBias(Fill->GetProfile().GetBias()) ;
+ GetDrawContext()->SetGain(Fill->GetProfile().GetGain()) ;
+ GetDrawContext()->SetTransparencyRamp(StartTransp,EndTransp) ;
+
//---------------------------------------------------------------------------------------
// Smoothing decisions
//---------------------------------------------------------------------------------------
@@ -7451,12 +7488,12 @@
BOOL bForceToWhite = FALSE;
BOOL bClearBitmapConv = FALSE;
BYTE* pSepTables = NULL;
- BGR *pCyanSepTable = NULL;
- BGR *pMagentaSepTable = NULL;
- BGR *pYellowSepTable = NULL;
- BGR *pBlackSepTable = NULL;
- BYTE *pUnderColourRemovalTable = NULL;
- BYTE *pBlackGenerationTable = NULL;
+// BGR *pCyanSepTable = NULL;
+// BGR *pMagentaSepTable = NULL;
+// BGR *pYellowSepTable = NULL;
+// BGR *pBlackSepTable = NULL;
+// BYTE *pUnderColourRemovalTable = NULL;
+// BYTE *pBlackGenerationTable = NULL;
// BGR* pTable = NULL;
// --- Add Separation Style bits as approriate to the current colour separation mode
@@ -7609,7 +7646,7 @@
GetDrawContext()->SetSeparationTables(); // Defaults to setting everything to NULL
CCFree(pSepTables);
}
-
+/*
if (pCyanSepTable)
CCFree(pCyanSepTable);
if (pMagentaSepTable)
@@ -7622,7 +7659,7 @@
CCFree(pUnderColourRemovalTable);
if (pBlackGenerationTable)
CCFree(pBlackGenerationTable);
-
+*/
return SLOWJOB_SUCCESS;
}
Index: Trunk/XaraLX/GDraw/gdraw.h
===================================================================
--- Trunk/XaraLX/GDraw/gdraw.h (revision 734)
+++ Trunk/XaraLX/GDraw/gdraw.h (revision 735)
@@ -332,6 +332,15 @@
BYTE ValueA, BYTE ValueB, BYTE ValueC, BYTE ValueD,
pcPOINT PointA, pcPOINT PointB, pcPOINT PointC, pcPOINT PointD
) ;
+ extern INT32 GBitmap_SetBias(pGCONTEXT pContext,double fBias) ;
+ extern INT32 GBitmap_SetGain(pGCONTEXT pContext,double fGain) ;
+ extern INT32 GBitmap_SetContone(
+ pGCONTEXT pContext,
+ UINT32 uContoneStyle,
+ COLORREF rgbStart = 0x000000,
+ COLORREF rgbEnd = 0xFFFFFF
+ ) ;
+ extern INT32 GBitmap_SetTransparencyRamp( pGCONTEXT pContext,BYTE uStart=0x00,BYTE uEnd=0xFF) ;
extern INT32 GColour_SetTilePattern(
pGCONTEXT pContext,
pcBITMAPINFOHEADER BitmapInfo,
Index: Trunk/XaraLX/wxCamelot.vcproj
===================================================================
--- Trunk/XaraLX/wxCamelot.vcproj (revision 734)
+++ Trunk/XaraLX/wxCamelot.vcproj (revision 735)
@@ -388,6 +388,9 @@
RelativePath=".\wxOil\dragtrgt.cpp">
</File>
<File
+ RelativePath=".\wxOil\drawctl.cpp">
+ </File>
+ <File
RelativePath=".\wxOilnsure.cpp">
</File>
<File
@@ -612,6 +615,9 @@
Name="Kernel"
Filter="">
<File
+ RelativePath=".\Kernelligndlg.cpp">
+ </File>
+ <File
RelativePath=".\Kernelpp.cpp">
</File>
<File
@@ -1299,6 +1305,9 @@
RelativePath=".\Kernel\pbecomea.cpp">
</File>
<File
+ RelativePath=".\Kernel\penedit.cpp">
+ </File>
+ <File
RelativePath=".\Kernel\pngfuncs.cpp">
</File>
<File
@@ -1618,6 +1627,9 @@
RelativePath=". ools\opsquash.cpp">
</File>
<File
+ RelativePath=". ools\pentool.cpp">
+ </File>
+ <File
RelativePath=". ools\pushtool.cpp">
</File>
<File
@@ -3104,6 +3116,9 @@
RelativePath=".\wxOil\dragtrgt.h">
</File>
<File
+ RelativePath=".\wxOil\drawctl.h">
+ </File>
+ <File
RelativePath=".\wxOilnsure.h">
</File>
<File
@@ -3339,6 +3354,9 @@
RelativePath=".\Kerneli_layer.h">
</File>
<File
+ RelativePath=".\Kernelligndlg.h">
+ </File>
+ <File
RelativePath=".\Kernelpp.h">
</File>
<File
@@ -3957,6 +3975,9 @@
RelativePath=".\Kernel\pathtype.h">
</File>
<File
+ RelativePath=".\Kernel\penedit.h">
+ </File>
+ <File
RelativePath="..\Camelot\Source\kernel\pngfuncs.h">
</File>
<File
@@ -4273,6 +4294,9 @@
RelativePath=". ools\OpShadow.h">
</File>
<File
+ RelativePath=". ools\pentool.h">
+ </File>
+ <File
RelativePath=". ools\pushtool.h">
</File>
<File
Property changes on: Trunk/XaraLX
___________________________________________________________________
Name: svn:ignore
- Makefile.in
libtool2
depcomp
ltmain.sh
Makefile
config.status
build
XaraLX
libtool
XaraLX.kdevelop
configure
config.log
config.guess
XaraLX.kdevelop.pcs
config.sub
INSTALL
mkinstalldirs
XaraLX.kdevses
autom4te.cache
missing
aclocal.m4
install-sh
+ Makefile.in
libtool2
depcomp
ltmain.sh
Makefile
config.status
build
XaraLX
libtool
XaraLX.kdevelop
configure
config.log
config.guess
XaraLX.kdevelop.pcs
config.sub
INSTALL
mkinstalldirs
XaraLX.kdevses
autom4te.cache
missing
aclocal.m4
install-sh
Debug
Xara