|
Declares a PDF 1.3+ DeviceN color space backed by N user-supplied spot inks (ISO 32000-1 8.6.6.5). Generalises RegisterSeparation from one colorant to many: six-color printing, metallic / fluorescent inks, custom PDF/X ink mixes, or any N-channel ink set.
Delphi 구문:
function RegisterDeviceN(const ColorantNames: array of AnsiString; const AlternateCS: AnsiString; const TintC1Matrix: array of Extended): AnsiString;
C++ 구문:
AnsiString RegisterDeviceN(const AnsiString* ColorantNames, int ColorantNameCount, const AnsiString& AlternateCS, const Extended* TintC1Matrix, int TintC1MatrixCount);
설명
DeviceN은 colorant당 하나씩 [0..1] 범위의 N개 tint operand를 받고, HotPDF가 내부적으로 PostScript-calculator Function Type 4로 build하는 linear weighted-blend tint transform을 사용해 AlternateCS의 M개 output component를 계산합니다. Channel m의 output은 모든 colorant n에 대한 tint[n] * TintC1Matrix[n*M + m]의 합이며 rendering pipeline에서 [0..1]로 clamp됩니다
ColorantNames - N개 ink name의 array입니다. 각 entry는 PDF name으로 작성됩니다. Space는 PDF 1.7 7.3.5에 따라 #20으로 escape됩니다. Special name 'None'은 사용되지 않는 colorant slot을 표시합니다. Name list는 결과 color space의 N개 input dimension을 정의합니다
AlternateCS - 'DeviceGray' (M = 1), 'DeviceRGB' (M = 3), or 'DeviceCMYK' (M = 4). Any other value raises an exception.
TintC1Matrix - row-major N * M Extended array. Row n column m is colorant n's contribution to AlternateCS channel m at full strength (tint[n] = 1.0) with all other tints at zero. Length must be exactly Length(ColorantNames) * M.
반환 값: auto-generated name(DevN1, DevN2, ...)입니다. StrictVersionLock이 켜져 있고 active Version이 PDF 1.3보다 낮으면 빈 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;
See Also
RegisterSeparation, RegisterLabColorSpace, Version, PDF Filter Support
|