THotPDF.RegisterSeparationLUT Method

 

THotPDF.RegisterSeparationLUT

THotPDF

 

Üst

Tint dönüşümü Function Type 0 örneklenmiş arama tablosu (ISO 32000-1 7.10.2) olan PDF 1.3+ Separation renk uzayı (ISO 32000-1 8.6.6.4) bildirir. Bunu spot mürekkep renk eğrisi doğrusal olmadığında kullanın - PANTONE Hexachrome tarzı tint rampaları, gama düzeltilmiş yoğunluk eğrileri, baskı karakterizasyonuyla eşleşen elle çizilmiş ton eğrileri, tam ICC profil mekanizması olmadan sRGB-to-spot dönüşüm ICC LUT'leri. Sıfırdan tek tam güçlü renk uç noktasına giden basit doğrusal rampa için v2.45.0 RegisterSeparation giriş noktası hâlâ geçerlidir

 

Delphi syntax:

function RegisterSeparationLUT(const ColorantName: AnsiString; const AlternateCS: AnsiString; const Samples: array of byte): AnsiString;

 

C++ syntax:

AnsiString RegisterSeparationLUT(const AnsiString& ColorantName, const AnsiString& AlternateCS, const unsigned char* Samples, int SamplesCount);

 

Açıklama

HotPDF internally calls RegisterSampledFunction to build the Function Type 0 stream with /Domain [0 1], /Range covering each alt-CS channel in [0, 1], /Size [S] where S = Length(Samples) / M, /BitsPerSample 8 and /Order 1 (linear interpolation). The function is wired into a fresh [/Separation /ColorantName /AltCS <FuncRef>] colour-space array shared across pages, matching the layout RegisterSeparation produces - downstream SetFillColorSpace + SetFillColor code paths see no API surface change between the two registrar variants.

 

ColorantName - PDF Name of the ink (e.g. 'PANTONE 185 C', 'CutContour', 'White'). Spaces are escaped to #20 per PDF 1.7 7.3.5 by the existing name-writer path.

AlternateCS - 'DeviceGray' (M = 1), 'DeviceRGB' (M = 3), or 'DeviceCMYK' (M = 4). The sample stream supplies M output bytes per grid point. Any other value raises an exception.

Samples - raw 8-bit sample bytes ordered (c0_0, c1_0, ..., cM-1_0, c0_1, ..., cM-1_S-1) for S grid points. Length(Samples) must be a positive multiple of M; S is inferred as Length(Samples) / M and must be at least 2 so the function has interpolable range. Linear interpolation between grid points is the default (PDF 1.7 /Order 1).

 

Dönüş değeri: otomatik oluşturulan renk uzayı adı (Sep1, Sep2, ...). Separation girdisi v2.45.0 RegisterSeparation kayıt defteriyle paylaşılır, bu nedenle adlar iki varyant boyunca monoton artar. StrictVersionLock açıkken etkin Version PDF 1.3'ün altındaysa boş dize döndürür (aksi halde belge sürümü otomatik olarak 1.3'e yükseltilir)

 

Code Example

// Register a 'HeatLUT' Separation over DeviceRGB whose tint -> RGB
// curve is a 256-sample blue -> green -> red heatmap
var
  CSName: AnsiString;
  Samples: array[0..767] of byte;     // 256 * 3 RGB
  I: Integer;
  T: Single;
begin
  HPDF.BeginDoc;
  for I := 0 to 255 do
  begin
    T := I / 255.0;
    if T < 0.5 then
    begin
      Samples[I*3 + 0] := 0;
      Samples[I*3 + 1] := byte(Round(2.0 * T * 255.0));
      Samples[I*3 + 2] := byte(Round((1.0 - 2.0*T) * 255.0));
    end
    else
    begin
      Samples[I*3 + 0] := byte(Round(2.0 * (T - 0.5) * 255.0));
      Samples[I*3 + 1] := byte(Round((1.0 - 2.0*(T - 0.5)) * 255.0));
      Samples[I*3 + 2] := 0;
    end;
  end;
  CSName := HPDF.RegisterSeparationLUT('HeatLUT', 'DeviceRGB', Samples);
  HPDF.CurrentPage.SetFillColorSpace(CSName);
  HPDF.CurrentPage.SetFillColor([0.5]);    // midpoint -> pure green
  HPDF.CurrentPage.Rectangle(100, 100, 40, 40);
  HPDF.CurrentPage.Fill;
  HPDF.EndDoc;
end;

 

Ayrıca bkz.

RegisterSeparation, RegisterSampledFunction, RegisterDeviceN, Version, PDF Filter Support