コード例 #1
0
ファイル: Form1.cs プロジェクト: Patapom/GodComplex
        public unsafe Form1()
        {
            InitializeComponent();

            Console.WriteLine( Color.LightGreen.ToString() );

            m_advancedParmsForm = new AdvancedParmsForm( this );

            #if !DEBUG
            buttonReload.Visible = false;
            #endif

            m_AppKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey( @"Software\Patapom\ToneMapping" );

            panelGraph_Hable.ScaleX = floatTrackbarControlScaleX.Value;
            panelGraph_Hable.ScaleY = floatTrackbarControlScaleY.Value;

            SaveResetValues();

            outputPanelFilmic_Insomniac.ScaleX = floatTrackbarControlScaleX.Value;
            outputPanelFilmic_Insomniac.ScaleY = floatTrackbarControlScaleY.Value;
            outputPanelFilmic_Insomniac.BlackPoint = floatTrackbarControlIG_BlackPoint.Value;
            outputPanelFilmic_Insomniac.WhitePoint = floatTrackbarControlIG_WhitePoint.Value;
            outputPanelFilmic_Insomniac.JunctionPoint = floatTrackbarControlIG_JunctionPoint.Value;
            outputPanelFilmic_Insomniac.ToeStrength = ComputeToeStrength();
            outputPanelFilmic_Insomniac.ShoulderStrength = ComputeShoulderStrength();

            // 			using ( Bitmap B = new Bitmap( 512, 512, PixelFormat.Format32bppArgb ) )
            // 			{
            // 				BitmapData	LockedBitmap = B.LockBits( new Rectangle( 0, 0, 512, 512 ), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb );
            //
            // 				for ( int Y=0; Y < 512; Y++ )
            // 				{
            // 					byte*	pScanline = (byte*) LockedBitmap.Scan0.ToPointer() + Y * LockedBitmap.Stride;
            // 					for ( int X=0; X < 512; X++ )
            // 					{
            // 						double	Angle = Math.Atan2( Y - 255, X - 255 );
            // //						byte	C = (byte) (255.0 * ((Angle + Math.PI) % (0.5 * Math.PI)) / (0.5 * Math.PI));
            // 						byte	C = (byte) (255.0 * ((Angle + Math.PI) % Math.PI) / Math.PI);
            // 						*pScanline++ = C;
            // 						*pScanline++ = C;
            // 						*pScanline++ = C;
            // 						*pScanline++ = (byte) ((X-255)*(X-255) + (Y-255)*(Y-255) < 255*255 ? 255 : 0);
            // 					}
            // 				}
            //
            // 				B.UnlockBits( LockedBitmap );
            //
            // 				B.Save( "\\Anisotropy.png", ImageFormat.Png );
            // 			}

            m_Camera.CameraTransformChanged += new EventHandler( Camera_CameraTransformChanged );

            Application.Idle += new EventHandler( Application_Idle );
        }
コード例 #2
0
ファイル: Form1.cs プロジェクト: neodyme60/GodComplex
        public unsafe Form1()
        {
            InitializeComponent();

            Console.WriteLine(Color.LightGreen.ToString());

            m_advancedParmsForm = new AdvancedParmsForm(this);

                        #if !DEBUG
            buttonReload.Visible = false;
                        #endif

            m_AppKey = Microsoft.Win32.Registry.CurrentUser.CreateSubKey(@"Software\Patapom\ToneMapping");

            panelGraph_Hable.ScaleX = floatTrackbarControlScaleX.Value;
            panelGraph_Hable.ScaleY = floatTrackbarControlScaleY.Value;

            SaveResetValues();

            outputPanelFilmic_Insomniac.ScaleX           = floatTrackbarControlScaleX.Value;
            outputPanelFilmic_Insomniac.ScaleY           = floatTrackbarControlScaleY.Value;
            outputPanelFilmic_Insomniac.BlackPoint       = floatTrackbarControlIG_BlackPoint.Value;
            outputPanelFilmic_Insomniac.WhitePoint       = floatTrackbarControlIG_WhitePoint.Value;
            outputPanelFilmic_Insomniac.JunctionPoint    = floatTrackbarControlIG_JunctionPoint.Value;
            outputPanelFilmic_Insomniac.ToeStrength      = ComputeToeStrength();
            outputPanelFilmic_Insomniac.ShoulderStrength = ComputeShoulderStrength();

//          using ( Bitmap B = new Bitmap( 512, 512, PixelFormat.Format32bppArgb ) )
//          {
//              BitmapData	LockedBitmap = B.LockBits( new Rectangle( 0, 0, 512, 512 ), ImageLockMode.WriteOnly, PixelFormat.Format32bppArgb );
//
//              for ( int Y=0; Y < 512; Y++ )
//              {
//                  byte*	pScanline = (byte*) LockedBitmap.Scan0.ToPointer() + Y * LockedBitmap.Stride;
//                  for ( int X=0; X < 512; X++ )
//                  {
//                      double	Angle = Math.Atan2( Y - 255, X - 255 );
// //						byte	C = (byte) (255.0 * ((Angle + Math.PI) % (0.5 * Math.PI)) / (0.5 * Math.PI));
//                      byte	C = (byte) (255.0 * ((Angle + Math.PI) % Math.PI) / Math.PI);
//                      *pScanline++ = C;
//                      *pScanline++ = C;
//                      *pScanline++ = C;
//                      *pScanline++ = (byte) ((X-255)*(X-255) + (Y-255)*(Y-255) < 255*255 ? 255 : 0);
//                  }
//              }
//
//              B.UnlockBits( LockedBitmap );
//
//              B.Save( "\\Anisotropy.png", ImageFormat.Png );
//          }

            m_Camera.CameraTransformChanged += new EventHandler(Camera_CameraTransformChanged);

            Application.Idle += new EventHandler(Application_Idle);
        }