Table of Contents

Class PdfShading.FreeFormGouraudShadedTriangleMesh

Namespace
iText.Kernel.Pdf.Colorspace
Assembly
itext.kernel.dll

The class that extends PdfShading class and is in charge of Shading Dictionary with free-form Gouraud-shaded triangle mesh type.

public class PdfShading.FreeFormGouraudShadedTriangleMesh : PdfShading
Inheritance
PdfShading.FreeFormGouraudShadedTriangleMesh
Inherited Members

Remarks

The class that extends PdfShading class and is in charge of Shading Dictionary with free-form Gouraud-shaded triangle mesh type. The area to be shaded is defined by a path composed entirely of triangles. The colour at each vertex of the triangles is specified, and a technique known as Gouraud interpolation is used to colour the interiors. The object shall be represented as stream containing a sequence of vertex data. Each vertex is specified by the following values, in the order shown: f x y c1 ... cn where: f - the vertex's edge flag, that determines the vertex is connected to other vertices of the triangle mesh. For full description, see ISO-320001 Paragraph 8.7.4.5.5 x, y - vertex's horizontal and vertical coordinates, expressed in the shading's target coordinate space. c1...cn - vertex's colour components. If the shading dictionary includes a Function entry, only a single parametric value, t, shall be specified for each vertex in place of the colour components c1...cn.

Constructors

FreeFormGouraudShadedTriangleMesh(PdfColorSpace, int, int, int, float[])

Creates the new instance of the class.

public FreeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, float[] decode)

Parameters

cs PdfColorSpace

the PdfColorSpace object in which colour values shall be expressed. The special Pattern space isn't excepted.

bitsPerCoordinate int

the number of bits used to represent each vertex coordinate. The value shall be 1, 2, 4, 8, 12, 16, 24, or 32.

bitsPerComponent int

the number of bits used to represent each colour component. The value shall be 1, 2, 4, 8, 12, or 16.

bitsPerFlag int

the number of bits used to represent the edge flag for each vertex. The value of BitsPerFlag shall be 2, 4, or 8, but only the least significant 2 bits in each flag value shall be used. The value for the edge flag shall be 0, 1, or 2.

decode float[]

the int[] of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present.

FreeFormGouraudShadedTriangleMesh(PdfColorSpace, int, int, int, PdfArray)

Creates the new instance of the class.

public FreeFormGouraudShadedTriangleMesh(PdfColorSpace cs, int bitsPerCoordinate, int bitsPerComponent, int bitsPerFlag, PdfArray decode)

Parameters

cs PdfColorSpace

the PdfColorSpace object in which colour values shall be expressed. The special Pattern space isn't excepted.

bitsPerCoordinate int

the number of bits used to represent each vertex coordinate. The value shall be 1, 2, 4, 8, 12, 16, 24, or 32.

bitsPerComponent int

the number of bits used to represent each colour component. The value shall be 1, 2, 4, 8, 12, or 16.

bitsPerFlag int

the number of bits used to represent the edge flag for each vertex. The value of BitsPerFlag shall be 2, 4, or 8, but only the least significant 2 bits in each flag value shall be used. The value for the edge flag shall be 0, 1, or 2.

decode PdfArray

the PdfArray of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present.

FreeFormGouraudShadedTriangleMesh(PdfStream)

Creates the new instance of the class from the existing PdfStream.

protected FreeFormGouraudShadedTriangleMesh(PdfStream pdfStream)

Parameters

pdfStream PdfStream

from which this PdfShading.FreeFormGouraudShadedTriangleMesh will be created

Methods

GetBitsPerComponent()

Gets the number of bits used to represent each colour component.

public virtual int GetBitsPerComponent()

Returns

int

the number of bits. Can be 1, 2, 4, 8, 12, or 16.

GetBitsPerCoordinate()

Gets the number of bits used to represent each vertex coordinate.

public virtual int GetBitsPerCoordinate()

Returns

int

the number of bits. Can be 1, 2, 4, 8, 12, 16, 24, or 32.

GetBitsPerFlag()

Gets the number of bits used to represent the edge flag for each vertex.

public virtual int GetBitsPerFlag()

Returns

int

the number of bits. Can be 2, 4 or 8.

Remarks

Gets the number of bits used to represent the edge flag for each vertex. But only the least significant 2 bits in each flag value shall be used. The valid flag values are 0, 1 or 2.

GetDecode()

Gets the PdfArray of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.

public virtual PdfArray GetDecode()

Returns

PdfArray

the PdfArray Decode object.

Remarks

Gets the PdfArray of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present.

SetBitsPerComponent(int)

Sets the number of bits used to represent each colour component.

public virtual void SetBitsPerComponent(int bitsPerComponent)

Parameters

bitsPerComponent int

the number of bits to be set. Shall be 1, 2, 4, 8, 12, or 16.

SetBitsPerCoordinate(int)

Sets the number of bits used to represent each vertex coordinate.

public virtual void SetBitsPerCoordinate(int bitsPerCoordinate)

Parameters

bitsPerCoordinate int

the number of bits to be set. Shall be 1, 2, 4, 8, 12, 16, 24, or 32.

SetBitsPerFlag(int)

Sets the number of bits used to represent the edge flag for each vertex.

public virtual void SetBitsPerFlag(int bitsPerFlag)

Parameters

bitsPerFlag int

the number of bits to be set. Shall be 2, 4 or 8.

Remarks

Sets the number of bits used to represent the edge flag for each vertex. But only the least significant 2 bits in each flag value shall be used. The valid flag values are 0, 1 or 2.

SetDecode(float[])

Sets the float[] of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.

public virtual void SetDecode(float[] decode)

Parameters

decode float[]

the float[] of Decode object to set.

Remarks

Sets the float[] of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present.

SetDecode(PdfArray)

Sets the PdfArray of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values.

public virtual void SetDecode(PdfArray decode)

Parameters

decode PdfArray

the PdfArray Decode object to set.

Remarks

Sets the PdfArray of numbers specifying how to map vertex coordinates and colour components into the appropriate ranges of values. The ranges shall be specified as follows: [x_min x_max y_min y_max c1_min c1_max … cn_min cn_max]. Only one pair of color values shall be specified if a Function entry is present.