THotPDF.RegisterDeviceN Method

 

THotPDF.RegisterDeviceN

THotPDF

 

Topo

Declara um espaço de cores DeviceN do PDF 1.3+ apoiado por N tintas especiais fornecidas pelo usuário (ISO 32000-1 8.6.6.5). Generaliza RegisterSeparation from one colorant to many: six-color printing, metallic / fluorescent inks, custom PDF/X ink mixes, or any N-channel ink set.

 

Sintaxe Delphi:

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

 

Sintaxe C++:

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

 

Descrição

DeviceN recebe N operandos de tinta em [0..1], um por colorant, e calcula M componentes de saída em AlternateCS usando uma transformação de tinta por mistura linear ponderada que o HotPDF monta internamente como Function Type 4 de calculadora PostScript. A saída do canal m é a soma, sobre todos os colorants n, de tint[n] * TintC1Matrix[n*M + m], limitada a [0..1] pelo pipeline de renderização

 

ColorantNames - matriz de N nomes de tinta. Cada entrada é gravada como um PDF name; espaços são escapados como #20 conforme PDF 1.7 7.3.5. O nome especial 'None' marca um slot de colorant não usado. A lista de nomes define as N dimensões de entrada do espaço de cores resultante

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.

 

Valor de retorno: um nome gerado automaticamente (DevN1, DevN2, ...). 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)

 

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