|
THotPDF.RegisterCoonsPatchMesh
|
الأعلى |
|
يعلن Coons patch mesh shading في PDF 1.3+ (ISO 32000-1 8.7.4.5.6, /ShadingType 6) ويلفه في Pattern Type 2 inline ضمن Resources/Pattern. كل patch محدود بأربع منحنيات cubic Bezier ويحمل لونًا لكل زاوية؛ يلائم renderer سطح Coons بين الحواف الأربع ليعطي quad ملونًا ذا انحناء حر، مناسبًا للتدرجات المعدنية وSVG mesh gradients
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 كتدفق غير مباشر مع /ShadingType 6 و/BitsPerCoordinate 16 و/BitsPerComponent 8 و/BitsPerFlag 8. يحزم كل patch كـ flag byte ثم 12 نقطة تحكم وأربعة ألوان زوايا، وتربط /Decode الإحداثيات ومكونات اللون بالنطاقات المعطاة 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 الذي يحد الإحداثيات المشفرة. تصبح هذه القيم أول مداخل /Decode، وتوضع في الإحداثيات التي سيجري الرسم فيها NumComponents - عدد مكونات اللون لكل زاوية. مرر 1 لـ DeviceGray أو 3 لـ DeviceRGB أو 4 لـ DeviceCMYK. أي قيمة أخرى ترفع exception Patches - مصفوفة مسطحة من قيم Extended. يساهم كل patch بـ 24 + 4 * NumComponents قيمة: 24 float لنقاط التحكم الـ 12 ثم 4 * NumComponents float لألوان الزوايا. يجب أن يكون طول المصفوفة مضاعفًا موجبًا لهذا stride، وكل patches الصادرة تحمل flag = 0
القيمة المعادة: اسم pattern مولد تلقائيًا (Sh1, Sh2, ...) ومسجل في قاموس Resources/Pattern للصفحة الحالية. يعيد سلسلة فارغة عندما يكون StrictVersionLock مفعّلًا وVersion النشطة أقل من PDF 1.3؛ وإلا يرفع إصدار المستند تلقائيًا إلى 1.3
Code Example
انظر أيضا RegisterFreeFormGouraudShading, RegisterLatticeFormGouraudShading, RegisterDeviceN, Version, PDF Filter Support
|