|
THotPDF.RegisterSampledFunction
|
Вгору |
|
Оголошує непрямий stream object PDF 1.3+ Function Type 0 (Sampled) за ISO 32000-1 7.10.2 Sampled functions задають довільне перетворення input-to-output як регулярну N-вимірну сітку M-вимірних samples; renderer інтерполює значення між grid points Використовуйте це, коли механізм ICC profile надмірний, але потрібна вручну налаштована lookup table
Delphi syntax: function RegisterSampledFunction(const Domain: array of Single; const Range: array of Single; const Size: array of Integer; BitsPerSample: Integer; const Samples: array of byte; Order: Integer = 1): THPDFStreamObject;
C++ syntax: THPDFStreamObject* RegisterSampledFunction(const float* Domain, int DomainCount, const float* Range, int RangeCount, const int* Size, int SizeCount, int BitsPerSample, const unsigned char* Samples, int SamplesCount, int Order = 1);
Опис The function is emitted as an indirect stream with Order - optional, default 1. Accepts 1 (linear interpolation, PDF 1.7 default) or 3 (cubic-spline interpolation) per PDF 1.7 Table 38. Cubic gives smoother transitions at low sample-grid densities (e.g. 17-point ICC tone curves) but some older mobile readers silently fall back to linear when they encounter an Order value they do not implement. Available since HotPDF v2.54.0. For ASCII-input use cases - the typical authoring path - a single 1-input / M-output function with
Domain - 2N Single values, ordered Range - 2M значень Single з тією самою формою для M output dimensions; після decoding output samples обмежуються цим діапазоном Size - N integers giving grid-point count along each input axis Length(Size) must equal N Total grid points is product of all Size entries BitsPerSample - one of 1, 2, 4, 8, 12, 16, 24, or 32 per PDF 1.7 Table 38. Samples - raw bit-packed sample stream Довжина має бути не менше ceil(GridPoints * M * BitsPerSample / 8) bytes HotPDF копіює supplied bytes verbatim у indirect stream object; правильність bit packing є відповідальністю caller
Повернене значення: indirect THPDFStreamObject, щоб callers могли приєднати його всюди, де очікується Function dictionary (зазвичай передавши його indirect reference до іншого dict через AddValue або до shading / separation builder). Об'єкт належить списку IndirectObjects документа і звільняється наприкінці документа. Повертає nil, коли StrictVersionLock увімкнено і активна Version нижча за PDF 1.3; інакше версія документа автоматично підвищується до 1.3
Code Example
See Also RegisterAxialGradient, RegisterDeviceN, RegisterSeparation, Version, PDF Filter Support
|