[Date Prev][Date Next][Thread Prev][Thread Next][Thread Index]

[XaraXtreme-commits] Commit Complete



Commit by  : alex
Repository : xara
Revision   : 1132
Date       : Fri May 19 14:50:21 BST 2006

Changed paths:
   M /Trunk/XaraLX/wxOil/dragbmp.cpp
   M /Trunk/XaraLX/wxOil/gdrawcon.cpp
   M /Trunk/XaraLX/wxOil/gdrawcon.h
   M /Trunk/XaraLX/wxOil/osrndrgn.cpp

Ensure GDrawContext is in known state prior to plotting bitmaps


Diff:
Index: Trunk/XaraLX/wxOil/dragbmp.cpp
===================================================================
--- Trunk/XaraLX/wxOil/dragbmp.cpp	(revision 1131)
+++ Trunk/XaraLX/wxOil/dragbmp.cpp	(revision 1132)
@@ -788,9 +788,7 @@
 		PGram[1].x = DestWidth;		PGram[1].y = 0;
 		PGram[2].x = 0;				PGram[2].y = DestHeight;
 
-		GD->SetContone(0);
-		GD->SetBias(3, 0.0);
-		GD->SetGain(3, 0.0);
+		GD->SetDefaultBitmapParameters();
 		GD->SetTileSmoothingFlag(TRUE/*FALSE*/);
 		GD->SetTileFilteringFlag(TRUE/*FALSE*/);
 
Index: Trunk/XaraLX/wxOil/gdrawcon.h
===================================================================
--- Trunk/XaraLX/wxOil/gdrawcon.h	(revision 1131)
+++ Trunk/XaraLX/wxOil/gdrawcon.h	(revision 1132)
@@ -369,6 +369,8 @@
 
 	virtual BOOL SaveContext(GCONTEXT* Context) = 0;
 	virtual BOOL RestoreContext(CONST GCONTEXT* Context) = 0;
+
+	virtual BOOL SetDefaultBitmapParameters();
 };
 
 
Index: Trunk/XaraLX/wxOil/gdrawcon.cpp
===================================================================
--- Trunk/XaraLX/wxOil/gdrawcon.cpp	(revision 1131)
+++ Trunk/XaraLX/wxOil/gdrawcon.cpp	(revision 1132)
@@ -135,3 +135,36 @@
 {
 }
 
+/********************************************************************************************
+
+>	BOOL GDrawContext::SetDefaultBitmapParameters()
+
+	Author:		Alex Bligh
+	Created:	19/05/2005
+	Purpose:	Sets the default bitmap parameters so a bitmap plot afterwards does not
+				depend on the prior GDrawContext state
+
+******************************************************************************************/ 
+
+BOOL GDrawContext::SetDefaultBitmapParameters()
+{
+	BOOL ok=
+		SetBias(3, 0.0) &&
+		SetGain(3, 0.0) &&
+		SetInputRange(3, 0x00, 0xff) &&
+		SetOutputRange(3, 0x00, 0xff) &&
+		SetBrightness(0.0) &&
+		SetContone(0) &&
+		SetContrast(0.0) &&
+		SetGamma(1.0) &&
+		SetPostGamma(1.0) &&
+		SetSaturation(0.0) &&
+		Sharpen(0) &&
+		TRUE;
+	
+	SetMaxFilterSize(100);
+	SetTileSmoothingFlag( FALSE );
+	SetTileFilteringFlag( FALSE );
+	return ok;
+}
+
Index: Trunk/XaraLX/wxOil/osrndrgn.cpp
===================================================================
--- Trunk/XaraLX/wxOil/osrndrgn.cpp	(revision 1131)
+++ Trunk/XaraLX/wxOil/osrndrgn.cpp	(revision 1132)
@@ -4649,9 +4649,8 @@
 
 	// Set the context to the default values
 
-	GD->SetContone(0);
-	GD->SetBias(3, 0.0);
-	GD->SetGain(3, 0.0);
+	GD->SetDefaultBitmapParameters();
+
 	GD->SetTileSmoothingFlag(TRUE/*FALSE*/);
 	GD->SetTileFilteringFlag(TRUE/*FALSE*/);
 


Xara