THotPDF.RegisterLabColorSpace Method

 

THotPDF.RegisterLabColorSpace

THotPDF

 

顶部

用自动生成的 resource name(Lab1、Lab2 等)注册 PDF 1.3 CIELab colour space(ISO 32000-1 8.6.5.3)。将返回名称与 THPDFPage.SetFillColorSpace / SetStrokeColorSpace 结合使用,然后通过 SetFillColor / SetStrokeColor 传入三个 L*a*b* components

 

Delphi 语法:

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

 

C++ 语法:

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

 

说明

CIELab colour space 以独立于显示或打印设备的方式描述颜色:L* 表示 [0..100] 范围的 lightness,a* 表示 green/red axis,b* 表示 blue/yellow axis(通常为 [-128..127])。合规 PDF viewers 使用配置的 WhitePoint illuminant 将 L*a*b* 转换为 device colour。常见 illuminants:

 

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.

 

返回值:自动生成的 resource name(Lab1、Lab2 等)。StrictVersionLock 打开且活动 Version 低于 PDF 1.3 时返回空字符串;否则版本自动提升到 1.3

 

代码示例

// 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;

 

另请参阅

Version, Compression, PDF 过滤器支持