Ejemplo 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();
   }
}
void ScreenTransferFunctionInstance::GetViewSTF( const View& view )
{
   if ( !view.IsNull() )
   {
      View::stf_list F;
      view.GetScreenTransferFunctions( F );
      for ( int c = 0; c < 4; ++c )
      {
         STF& f = stf[c];
         const HistogramTransformation& H = F[c];
         f.m = H.MidtonesBalance();
         f.c0 = H.ShadowsClipping();
         f.c1 = H.HighlightsClipping();
         f.r0 = H.LowRange();
         f.r1 = H.HighRange();
      }

      interaction = view.IsColor() ? STFInteraction::SeparateChannels : STFInteraction::Grayscale;
   }
}