コード例 #1
0
ファイル: FileFormatInstance.cpp プロジェクト: aleixpuig/PCL
bool FileFormatInstance::WriteRGBWS( const RGBColorSystem& rgbws )
{
   try
   {
      if ( (*API->FileFormat->BeginRGBWSEmbedding)( handle ) == api_false )
         return false;

      float gamma = rgbws.Gamma();
      api_bool issRGB = rgbws.IsSRGB();
      FVector x = rgbws.ChromaticityXCoordinates();
      FVector y = rgbws.ChromaticityYCoordinates();
      FVector Y = rgbws.LuminanceCoefficients();

      bool ok = (*API->FileFormat->SetImageRGBWS)( handle, gamma, issRGB, x.Begin(), y.Begin(), Y.Begin() ) != api_false;

      if ( rgbws.Gamma() != gamma ||
           rgbws.IsSRGB() != (issRGB != api_false) ||
           rgbws.ChromaticityXCoordinates() != x ||
           rgbws.ChromaticityYCoordinates() != y ||
           rgbws.LuminanceCoefficients() != Y )
      {
         APIHackingAttempt( "WriteRGBWS" );
      }

      (*API->FileFormat->EndRGBWSEmbedding)( handle );

      return ok;
   }
   catch ( ... )
   {
      (*API->FileFormat->EndRGBWSEmbedding)( handle );
      throw;
   }
}
コード例 #2
0
ファイル: FileFormatInstance.cpp プロジェクト: aleixpuig/PCL
bool FileFormatInstance::ReadRGBWS( RGBColorSystem& rgbws )
{
   try
   {
      rgbws = RGBColorSystem();

      if ( (*API->FileFormat->BeginRGBWSExtraction)( handle ) == api_false )
         return false;

      float gamma = rgbws.Gamma();
      api_bool issRGB = rgbws.IsSRGB();
      FVector x = rgbws.ChromaticityXCoordinates();
      FVector y = rgbws.ChromaticityYCoordinates();
      FVector Y = rgbws.LuminanceCoefficients();

      bool ok = (*API->FileFormat->GetImageRGBWS)( handle, &gamma, &issRGB, x.Begin(), y.Begin(), Y.Begin() ) != api_false;
      if ( ok )
         rgbws = RGBColorSystem( gamma, issRGB, x, y, Y );

      (*API->FileFormat->EndRGBWSExtraction)( handle );
      return ok;
   }
   catch ( ... )
   {
      (*API->FileFormat->EndRGBWSExtraction)( handle );
      throw;
   }
}
コード例 #3
0
RGBWorkingSpaceInstance::RGBWorkingSpaceInstance( const MetaProcess* P, const RGBColorSystem& rgbws ) :
ProcessImplementation( P ),
Y( rgbws.LuminanceCoefficients() ),
x( rgbws.ChromaticityXCoordinates() ),
y( rgbws.ChromaticityYCoordinates() ),
gamma( rgbws.Gamma() ),
sRGB( rgbws.IsSRGB() ),
applyGlobalRGBWS( false )
{
}