Esempio n. 1
0
void NewImageInterface::UpdateReadout( const View& v, const DPoint&, double R, double G, double B, double A )
{
   if ( GUI != 0 && IsVisible() )
   {
      if ( ISCOLOR || !v.IsColor() )
      {
         instance.v0 = R;
         instance.v1 = G;
         instance.v2 = B;
      }
      else
      {
         RGBColorSystem rgb;
         v.Window().GetRGBWS( rgb );
         instance.v0 = instance.v1 = instance.v2 = rgb.Lightness( R, G, B );
      }

      GUI->V0_NumericControl.SetValue( instance.v0 );
      GUI->V1_NumericControl.SetValue( instance.v1 );
      GUI->V2_NumericControl.SetValue( instance.v2 );

      if ( HASALPHA )
      {
         instance.va = A;
         GUI->VA_NumericControl.SetValue( instance.va );
      }

      GUI->ColorSample_Control.Update();
   }
}
Esempio n. 2
0
void BinarizeInterface::UpdateReadout( const View& v, const DPoint&, double R, double G, double B, double /*A*/ )
{
   if ( GUI != 0 && IsVisible() )
   {
      if ( instance.isGlobal )
      {
         RGBColorSystem rgbws;
         v.Window().GetRGBWS( rgbws );
         instance.level[0] = instance.level[1] = instance.level[2] = rgbws.Lightness( R, G, B );
      }
      else
      {
         instance.level[0] = R;
         instance.level[1] = G;
         instance.level[2] = B;
      }

      UpdateControls();

      if ( !RealTimePreview::IsUpdating() )
         RealTimePreview::Update();
   }
}