Computer Graphics
Dr.S.Sivakumar,Principal
C.P.A College, Bodinayakanur
1
11/15/2024
2
11/15/2024
Attributes of Output Primitives
Attributes of Output Primitives
Structure :
The way a primitive is to be displayed is referred to as an Attribute Parameter.
Some attribute parameters include color ,size etc.
Different ways to incorporate attribute changes :
Introduction
Line Attributes
Line Type
setLinetype (It)
Line Width
setLineWidthScaleFactor(lw);
Pen and Brush Options
Line Color
Curve Attributes
Curve Attributes
Color And Grayscale Levels
Color Tables
setColourRepresentation (ws, ci, colorptrl)
and parameter colorptr points to a hio of RGB color values (r,g, b) each specified in the range from 0 to 1.
1."reasonable" number of simultaneous colors without requiring large frame buffers.
2. For most applications, 256 or 512 different colors are sufficient for a single picture.
3. Table entries can be changed at any time.
4. Visualization applications can store values for some physical quantity, such as energy, in the frame buffer and use a lookup table to try out various color encodings without changing the pixel values.
Grayscale
intensity = 0.5[min(r, g, b) + max(r, g, b)]
Area-fill Attributes
Fill Styles
Pattern Fill
setpatternsize (dx, dy)
Soft Fill
Character Attributes
Text Attributes
setTextFont(tf)
setTextColorIndex(tc)
setChatacterHeight(ch)
setCharacterExpansionFactor(cw)
setCharacterSpacing(cs)
into the specified orientation before
transferring them to the frame buffer..
setAlignment(h,v)
setTextPrecision(tpr)
Marker Attribute:
setMarkerSizeScaleFactor (ms)