THotPDF.RegisterLabColorSpace Method

 

THotPDF.RegisterLabColorSpace

THotPDF

 

Topo

Valor de retorno: um nome de pattern gerado automaticamente (Sh1, Sh2, ...) registrado no dicionário Resources/Pattern da página atual. Retorna uma string vazia quando StrictVersionLock está ativo e a Version ativa é inferior a PDF 1.3 (caso contrário a versão do documento é elevada automaticamente para 1.3)

 

Sintaxe Delphi:

function RegisterLabColorSpace(WhitePointX, WhitePointY, WhitePointZ: Single; RangeAMin, RangeAMax, RangeBMin, RangeBMax: Single): AnsiString;

 

Sintaxe C++:

AnsiString RegisterLabColorSpace(float WhitePointX, float WhitePointY, float WhitePointZ, float RangeAMin, float RangeAMax, float RangeBMin, float RangeBMax);

 

Descrição

Registra um espaço de cores CIELab PDF 1.3 (ISO 32000-1 8.6.5.3) sob um nome de recurso gerado automaticamente (Lab1, Lab2, ...). Utilize o nome retornado com THPDFPage.SetFillColorSpace / SetStrokeColorSpace seguido de SetFillColor / SetStrokeColor, passando os três componentes L*a*b*

 

D50  - ICC print standard. WhitePoint = [0.9505, 1.0, 1.089].

D65  - sRGB / display standard. WhitePoint = [0.95047, 1.0, 1.08883].

 

WhitePoint Y must equal 1.0 per spec table 64; X and Z must be positive. Passing all four Range parameters as zero falls back to the spec's implicit default [-100 100 -100 100]; pass any non-zero combination to override.

 

O espaço de cores CIELab descreve cores independentemente de qualquer dispositivo de exibição ou impressão: L* expressa luminosidade em [0..100], a* o eixo verde/vermelho, b* o eixo azul/amarelo (normalmente [-128..127]). Visualizadores PDF conformes convertem L*a*b* para a cor do dispositivo usando o iluminante WhitePoint configurado. Iluminantes comuns:

 

Code Example

// Register a D50 Lab space for print, paint a magenta swatch
var
  CSName: AnsiString;
begin
  HPDF.Version := pdf14;
  HPDF.BeginDoc;
  CSName := HPDF.RegisterLabColorSpace(
    0.9505, 1.0, 1.089,        // D50 WhitePoint
    -128, 127, -128, 127);     // standard a* and b* range
  HPDF.CurrentPage.SetFillColorSpace(CSName);
  HPDF.CurrentPage.SetFillColor([50.0, 60.0, -50.0]);  // L* a* b*
  HPDF.CurrentPage.Rectangle(60, 60, 200, 100);
  HPDF.CurrentPage.Fill;
  HPDF.EndDoc;
end;

 

See Also

Version, Compression, PDF Filter Support