|
Mendeklarasikan ruang warna DeviceN PDF 1.3+ yang didukung oleh N tinta spot yang disuplai pengguna (ISO 32000-1 8.6.6.5). Menggeneralisasi RegisterSeparation dari satu colorant ke banyak: pencetakan enam warna, tinta metalik / fluoresen, campuran tinta PDF/X kustom, atau set tinta N-channel apa pun
Sintaks Delphi:
function RegisterDeviceN(const ColorantNames: array of AnsiString; const AlternateCS: AnsiString; const TintC1Matrix: array of Extended): AnsiString;
Sintaks C++:
AnsiString RegisterDeviceN(const AnsiString* ColorantNames, int ColorantNameCount, const AnsiString& AlternateCS, const Extended* TintC1Matrix, int TintC1MatrixCount);
Deskripsi
DeviceN menerima N operand tint dalam [0..1], satu per colorant, dan menghitung M komponen output di AlternateCS menggunakan transform tint linear berbobot yang dibangun HotPDF secara internal sebagai Function Type 4 calculator PostScript. Output untuk kanal m adalah jumlah atas semua colorant n dari tint[n] * TintC1Matrix[n*M + m], lalu dijepit ke [0..1] oleh pipeline rendering
ColorantNames - array nama tinta N. Setiap entri ditulis sebagai PDF name; spasi di-escape menjadi #20 sesuai PDF 1.7 7.3.5. Nama khusus 'None' menandai slot colorant yang tidak dipakai. Daftar nama menentukan N dimensi input dari color space yang dihasilkan
AlternateCS - 'DeviceGray' (M = 1), 'DeviceRGB' (M = 3), atau 'DeviceCMYK' (M = 4). Nilai lain apa pun akan memunculkan exception
TintC1Matrix - array Extended N * M dengan urutan row-major. Baris n kolom m adalah kontribusi colorant n ke kanal AlternateCS m pada kekuatan penuh (tint[n] = 1.0) dengan semua tint lain nol. Panjang harus tepat Length(ColorantNames) * M
Return value: nama yang dihasilkan otomatis (DevN1, DevN2, ...). Mengembalikan string kosong saat StrictVersionLock aktif dan Version aktif di bawah PDF 1.3 (kalau tidak, versi dokumen otomatis naik ke 1.3)
Contoh kode
// 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;
Lihat juga
RegisterSeparation, RegisterLabColorSpace, Version, PDF Filter Support
|