void PEXOCCSetPrimitiveAntialiasing(
PEXOCC context,
unsigned int prims,
int blend_func
)
- context
- An OC context returned by a successful
PEXCreateOCC call.
- display (OCC)
- A pointer to a display structure returned by a successful
XOpenDisplay call.
- resource_id (OCC)
- The resource identifier of the renderer or structure.
- req_type (OCC)
- The request type for the output command
(PEXOCRender, PEXOCStore,
PEXOCRenderSingle or PEXOCStoreSingle).
- prims
- The primitive types selected for antialiasing
(PEXPrimitiveAANone, PEXPrimitiveAAPoint,
PEXPrimitiveAAVector, PEXPrimitiveAAPolygon,
PEXPrimitiveAARasterText,
PEXPrimitiveAAVectorText,
PEXPrimitiveAAPolygonalText).
- blend_func
- The blend function to use.
None.
Invoke PEXOCCSetPrimitiveAntialiasing to create an
attribute output command which sets the primitive
antialiasing entry of the renderer's pipeline state
according to the value specified by prims.
Primitive antialiasing specifies modifications made to
the image on a type of primitive basis to correct for
aliasing (jagged) effects.
Typically the algorithms smooth edges through a blending
operation.
PEXlib defines the following primitive types
(prims):
- PEXPrimitiveAANone -
- does not antialias primitives. (5.2)
- PEXPrimitiveAAPoint -
- the set of primitives and attributes which combine to form
a point primitive is implementation-dependent but at a
minimum includes marker type PEXMarkerDot applied to
PEXOCCMarkers. (5.2)
- PEXPrimitiveAAVector -
- The set of primitives and attributes which combine to form
a vector primitive is implementation-dependent but at
a minimum includes
PEXOCCPolyline and
PEXOCCPolylines,
all of nominal width. (5.2)
- PEXPrimitiveAAPolygon -
- The set of primitives and attributes which combine to form
a polygon primitive is implementation-dependent but
at a minimum includes interior style Solid applied
to: (5.2)
PEXOCCArcAreas
PEXOCCCones
PEXOCCFillArea
PEXOCCFillAreaSet
PEXOCCIndexedFillAreaSets
PEXOCCIndexedTriangles
PEXOCCNURBSurface
PEXOCCPolyTriangle
PEXOCCQuadrilateralMesh
PEXOCCSpheres
PEXOCCTriangleFan
PEXOCCTriangles
PEXOCCTriangleStrip
- PEXPrimitiveAARasterText -
- PEXText3D,
PEXText2D,
PEXAnnotationText3D, and
PEXAnnotationText2D
with a raster font applied. (5.2)
- PEXPrimitiveAAVectorText -
- PEXText3D,
PEXText2D,
PEXAnnotationText3D, and
PEXAnnotationText2D
with a stroked font applied. (5.2)
- PEXPrimitiveAAPolygonalText -
- PEXText3D,
PEXText2D,
PEXAnnotationText3D, and
PEXAnnotationText2D
with a polygonal font applied. (5.2)
To determine which primitive types you can antialias,
inquire PrimAntiAliasSupported with request
PEXGetImpDepConstants.
The implementation antialiases any primitives of the types
selected by prims.
It leaves aliased any primitives of the types selected
by prims which it cannot antialias.
If you specify an undefined value for prims, then the
implementation issues a BadPEXOutputCommand
error.
If the implementation is accomplishing
primitive antialiasing through a blending function, then you
have control over how the blending is accomplished.
PEXlib defines the following values for the blending
functions:
- PEXPrimitiveAABlendOpImpDep -
- specifies an implementation-dependent blending function. (5.2)
- PEXPrimitiveAABlendOpSimpleAlpha -
- specifies that an alpha value is calculated based on the
primitive's coverage of the pixel and applied such
that: (5.2)
Color = α * Colorprimitive + (1 α) * Colorprevious
If the implementation does not support the value you
specify in blend_func, then the blend function
defaults to PEXPrimitiveAABlendOpImpDep.
Inquire the supported values for the blend function by
invoking the
PEXGetEnumTypeInfo
function.
Primitive antialiasing interacts with HLHSR, alpha
blending, transparency, drawing functions (other than
GXcopy), and plane masking (other than all planes
enabled) in an implementation-dependent way.
This function is a member of the
global attribute set.
- BadPEXOutputCommand
- The output command contains an invalid value.
- BadPEXRenderer
- The specified renderer resource identifier is invalid.
- BadPEXStructure
- The specified structure resource identifier is invalid.
For an overview and for a list of all output attribute functions,
see Output Attribute Functions.