TPLMeshPatchCorners

Data types

Description

TPLMeshPatchCorners is one patch of a Coons-patch mesh or a tensor-product-patch mesh: the element type of the Patches array passed to NewRGBCoonsPatchMesh and NewRGBTensorPatchMesh. The record is declared in the unit PDFlibMeshShading.

PX and PY hold the x and y coordinates of the control points in the order P1 to P12 of ISO 32000-1 Table 84. A patch has twelve control points, its four corners plus two control points per edge: the corners P1, P4, P7 and P10 sit in slots 0, 3, 6 and 9, and the control points of each edge follow the corner where the edge starts. A tensor patch adds the four inner control points P13 to P16 in slots 12 to 15; a Coons patch does not use them.

CR, CG and CB hold the red, green and blue component of the four corner colours, in the order P1, P4, P7, P10 in elements 0 to 3, each component from 0 to 1.

Both methods write every patch on its own with edge flag 0: a Coons patch encodes slots 0 to 11, a tensor patch slots 0 to 15, and both encode all four corner colours. The encoding is the same as for TPLMeshVertex. Each coordinate is taken as given: clamped to the coordinate range the method receives in BoundsX0, BoundsX1, BoundsY0 and BoundsY1, scaled linearly onto the integers 0 to 2^BitsPerCoordinate - 1 and rounded to the nearest one. Only those four bounds pass through the conversion for the document scale and origin (SetScale, SetOrigin); the point values do not. Each colour component is clamped to 0 to 1 and written with BitsPerComponent bits.

Syntax

TPLMeshPatchCorners= Record
  PX, PY: Array [0.. 15] Of Double;
  // Corner colours at P1, P4, P7, P10
  CR, CG, CB: Array [0.. 3] Of Double;
End;

Fields

PX, PYx and y of the control points: P1 to P12 in slots 0 to 11, with the corners in slots 0, 3, 6 and 9, and the inner control points P13 to P16 in slots 12 to 15 for a tensor patch. A point outside the converted bounds is clamped to the nearer bound
CR, CG, CBRed, green and blue of the corner colours at P1, P4, P7 and P10, in that order in elements 0 to 3, each from 0 to 1

Remarks

Patches must hold at least one record, otherwise the method returns 0.

Slots 12 to 15 are read only by NewRGBTensorPatchMesh; a Coons patch leaves them untouched.

No edge is shared between patches; every patch is complete on its own.

See also

NewRGBCoonsPatchMesh, NewRGBTensorPatchMesh, TPLMeshVertex, SetFillShader