|
THotPDF.RegisterCoonsPatchMesh
|
Вгору |
|
Оголошує PDF 1.3+ Coons patch mesh shading (ISO 32000-1 8.7.4.5.6, /ShadingType 6) і wraps його в inline Pattern Type 2 entry у page Resources/Pattern dictionary Кожен patch bounded by four cubic Bezier curves і має one color per corner; renderer fits Coons surface between four edges, утворюючи довільно curved color-bearing quad Використовуйте це, коли straight-edge triangle meshes не дають потрібної кривої форми
Delphi syntax: function RegisterCoonsPatchMesh(XMin, YMin, XMax, YMax: Single; NumComponents: Integer; const Patches: array of Extended): AnsiString;
C++ syntax: AnsiString RegisterCoonsPatchMesh(float XMin, float YMin, float XMax, float YMax, int NumComponents, const Extended* Patches, int PatchesElementCount);
Опис Shading emitиться як indirect stream з /ShadingType 6, /BitsPerCoordinate 16, /BitsPerComponent 8 і /BitsPerFlag 8 Кожен patch packed as 1 flag byte (always 0 for independent patches), 12 control points і 4 corner colors, total 1 + 48 + 4 * NumComponents bytes per patch /Decode maps 16-bit coordinates назад у supplied user-space rectangle The 12 control points are numbered c1..c12 in clockwise order around the patch boundary starting from corner 1. The four corners are c1 / c4 / c7 / c10, and the remaining eight (c2, c3 between c1 and c4; c5, c6 between c4 and c7; c8, c9 between c7 and c10; c11, c12 between c10 and c1) are the inner Bezier handles of each cubic edge. When the inner handles sit at 1/3 and 2/3 along the straight line between adjacent corners, the Coons surface degenerates to bilinear interpolation - visually equivalent to a 4-vertex Type 4 mesh.
XMin, YMin, XMax, YMax - user-space rectangle, що bounds encoded coordinates Ці values стають першими entries of /Decode Control points outside this rectangle clamped during encoding Розміщуйте їх у same user-space coordinates, у які буде paint NumComponents - кількість color components per corner Передайте 1 для DeviceGray, 3 для DeviceRGB або 4 для DeviceCMYK Будь-яке інше value raises exception Patches - flat array Extended values Кожен patch contains 24 + 4 * NumComponents values: 24 floats для 12 control points і 4 * NumComponents floats для corner colors Array length має бути positive multiple of this stride Усі emitted patches carry flag = 0; continuation flags 1 / 2 / 3 не exposed in this overload
Return value: auto-generated pattern name (Sh1, Sh2, ...), registered у Resources/Pattern dictionary current page Повертає empty string, коли StrictVersionLock on і active Version нижча за PDF 1.3; інакше document version auto-bumps to 1.3
Code Example
See Also RegisterFreeFormGouraudShading, RegisterLatticeFormGouraudShading, RegisterDeviceN, Version, PDF Filter Support
|