THotPDF.RegisterDeviceN Method

 

THotPDF.RegisterDeviceN

THotPDF

 

先頭

N 個の user-supplied spot inks に backed された PDF 1.3+ DeviceN color space を宣言します (ISO 32000-1 8.6.6.5)。RegisterSeparation を 1 つの colorant から複数へ generalise します。six-color printing、metallic / fluorescent inks、custom PDF/X ink mixes、任意の N-channel ink set に使用できます

 

Delphi syntax:

function RegisterDeviceN(const ColorantNames: array of AnsiString; const AlternateCS: AnsiString; const TintC1Matrix: array of Extended): AnsiString;

 

C++ syntax:

AnsiString RegisterDeviceN(const AnsiString* ColorantNames, int ColorantNameCount, const AnsiString& AlternateCS, const Extended* TintC1Matrix, int TintC1MatrixCount);

 

説明

DeviceN[0..1] 内の N tint operands を colorant ごとに 1 つ受け取り、HotPDF が内部で PostScript-calculator Function Type 4 として構築する linear weighted-blend tint transform により、AlternateCS 内の M output components を計算します。channel m の output は、すべての colorants n について tint[n] * TintC1Matrix[n*M + m] を合計したもので、rendering pipeline により [0..1] に clamp されます

 

ColorantNames - N ink names の array です。各 entry は PDF name として書き込まれます。spaces は PDF 1.7 7.3.5 に従い #20 に escape されます。special name 'None' は unused colorant slot を示します。name list は結果の color space の N input dimensions を定義します

AlternateCS - 'DeviceGray' (1 component)、'DeviceRGB' (3)、または 'DeviceCMYK' (4) です。それ以外の値は exception を発生させます

TintC1Matrix - row-major の N * M Extended array です。row n column m は、他のすべての tints が zero で tint[n] = 1.0 のときの colorant n の AlternateCS channel m への contribution です。length は正確に Length(ColorantNames) * M でなければなりません

 

戻り値: auto-generated name (DevN1DevN2、...) です。StrictVersionLock が on で active Version が PDF 1.3 未満の場合は empty string を返します (それ以外では document version は 1.3 に auto-bump されます)

 

Code Example

// Two-colorant DeviceN over DeviceRGB. Colorant 0 ('Red') is pure
// red at full strength, colorant 1 ('Blue') is pure blue. Mixing
// (0.5, 0.5) yields a 50/50 blend; (1, 1) saturates to magenta
var
  CSName: AnsiString;
  Mat: array[0..5] of Extended;
begin
  HPDF.Version := pdf14;
  HPDF.BeginDoc;
  Mat[0] := 1.0; Mat[1] := 0.0; Mat[2] := 0.0;  // Red row     -> (1, 0, 0)
  Mat[3] := 0.0; Mat[4] := 0.0; Mat[5] := 1.0;  // Blue row    -> (0, 0, 1)
  CSName := HPDF.RegisterDeviceN(
    ['Red', 'Blue'], 'DeviceRGB', Mat);
  HPDF.CurrentPage.SetFillColorSpace(CSName);
  HPDF.CurrentPage.SetFillColor([0.5, 0.5]);   // mid-purple
  HPDF.CurrentPage.Rectangle(60, 60, 200, 100);
  HPDF.CurrentPage.Fill;
  HPDF.EndDoc;
end;

 

関連項目

RegisterSeparation, RegisterLabColorSpace, Version, PDF Filter Support