1 / 43

Attributes of Output Primitives

Attributes of Output Primitives. Definition: Parameter that affects the way a primitive will be displayed. Line Attributes Curve Attributes Color and Gray Scale Levels Area Filled Attributes Text and Characters Attributes Bundled Attributes. Attributes of Output Primitives.

ayeager
Download Presentation

Attributes of Output Primitives

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Attributes of Output Primitives • Definition: • Parameter that affects the way a primitive will be displayed. • Line Attributes • Curve Attributes • Color and Gray Scale Levels • Area Filled Attributes • Text and Characters Attributes • Bundled Attributes

  2. Attributes of Output Primitives • Line Attributes : • Line Type • Line Width • Line Color • Pen & Brush Options • Line Type • setLinetype(lt) • lt 4 values 1-4

  3. Line Attribute • Line Type • 1. Solid • 2. Dotted – very short dash with spacing equal to • or greater than dash itself • 3. Dashed – displayed by generating an interdash spacing • 4. Dash dotted -.-.-.-.-.-. • `Pixel count for the span and interspan length is specified • by the mask . Ex. 111100011110001111Note :

  4. Line Attribute Line Width Specify in pixels and proportion of a standard line width. Thicker line can be produced by. Adding extra pixel vertically when |m| < 1 Adding extra pixel horizontally when |m| > 1 Issues: Line have different thickness on the slope Problem with End of the line Joining the two lines (polygon)

  5. Line Attribute Line Width

  6. Attributes of Output Primitives

  7. Attributes of Output Primitives

  8. Line Attributes Line color: setPolylineColorIndex(lc)

  9. Line Attribute Pen and Brush Options The selected “pen” or “brush” determine the way a line will be drawn. Pens and brushes have size, shape, color and pattern attribute. Pixel mask is applied in both of them.

  10. Line Attribute

  11. Curve Attribute Similar to line : type + width Thicker curves can be produced by: 1. Plotting additional pixel 2. Filling the space between two concentric circles. 3. Using thicker pen or brush

  12. Curve Attribute Curve Type: Pixel masks are also used in curve algorithms to generate dashes and dotted patterns. For example, the mask 111000 produces the dashed circle as in figure.

  13. Curve Attribute – Curve width • Method 1: • If the magnitude of the curve slope is less than 1, plot vertical spans; If the slope magnitude is greater than 1, plot horizontal spans.

  14. Curve Attribute Width • Method 2: • Fill in the area between two parallel curve paths, whose separation distance is equal to the desired width.

  15. Curve Attribute- Pen and brush

  16. Color and Gray Scale Level Color • Colors are represented by colors codes which are positive integers. • Color information is stored in frame buffer or in separate table and use pixel values as index to the color table. • Two ways to store color information : 1. Direct 2. Indirect

  17. COLOR Direct

  18. COLOR Indirect

  19. Color Lookup Table

  20. COLOR Lookup Table

  21. Color User can set color table entries in a program as setColorRepresentation(ws,ci,colorptr) ws-> workstation output device ci-> color index(0 to 255) colorptr-> points to RGB values 0 to 1

  22. Gray Scale Level . Apply for monitor that have no color Shades of grey (white->light grey->dark grey->black) . Color code mapped onto grayscale codes 2 bits can give 4 level of grayscale 8 bits per pixel will allow 256 combination . Dividing the actual code with 256 will give range of 0 and 1 E.g. Ex Color code in color display is 118 To map to nearest grayscale then 118/256 = 0.45  light gray

  23. Area Filled Attribute • Tiling: • The process of filling an area with a rectangular pattern is called tiling and rectangular fill patterns are sometimes referred to as tiling patterns.

  24. Area Filled Attribute 3. Soft fill: • Modified boundary-fill and flood-fill procedures that are applied to repaint areas so that the fill color is combined with the background colors are referred to as soft-fill or tint algorithms. • The linear soft-fill algorithm repaints an area that was originally painted by merging a foreground color F with a single background color B, where F!=B.

  25. Area Filled Attribute • Soft-fill • P = tF + (1-t)B where 0 < t < 1 • If t < 0.5 , background color contributes more to the interior color of the region than does the fill color.

  26. 5. Character Attributes • Divided into two • Text attributes • Marker attributes • Text and Characters • Very important output primitive • Many pictures require text

  27. Text attributes • Attributes are set for the entire character or string. • Includes • Font type • Font size • Underline style etc • Font type is set using the function: setTextFont(tf)

  28. Text attributes To set text color: setTextColorIndex(tc) tc available color code Character height is defined as the distance between the baseline and the capline of characters.

  29. Text attributes Text size can be adjusted without changing the width-to-height ratio of characters with setCharacterHeight(ch) cha real value greater than 0 to set the coordinate height of capital letters

  30. Text attributes The width only of text can be set wlth the function setCharacterExpansionFactor(cw) chcharacter-width parameter

  31. Text attributes Spacing between characters is controlled separately with setCharacterSpacing(cs) csCharacter spacing parameter

  32. Text attributes The orientation for a displayed character string is set as setCharacterUpVector(upvect)

  33. Text attributes To arrange character strings vertically or horizontally: setTextPath(tp) tptext-path parameter tp right, left, up, or down

  34. Text attributes Alignment attributes arc set with setTextAlignment(h,v) h,vcontrol horizontal and vertical alignment,

  35. Text attributes A precision specificationf or text display is given with setTextPrecision(tpr) tprvalues: string, char, or stroke. String—lowest quality Storke—high quality text

  36. Marker Attributes A marker symbol is a single character that can he displayed in different colors and in different sizes. A particular character is selected to be the marker symbol with setMarkerType(mt) mt marker type parameter ranges from 1 to 5. 1-dot(.), 2-a vertical cross(+), 3-an asterisk(*), 4-a circle(O), 5- a diagonal cross.

  37. Marker Attributes To set marker size setMarkerSizeScaleFactor(ms) msmarker size parameter(positive value) To set marker color setPolymarkerColorIndex(mc)

  38. Bundled Attributes • When each function reference a single attribute that specify exactly how primitive to be displayed ; then its called • individual (unbundled attribute). • Bundledattributes is where a set of attributes value can be chosen by specifying the appropriate index table. • The table for each primitive that defines group of attribute values is called bundled table. • . Attribute that can be bundled are: • Bundled Line Attribute • Bundled Area-Fill Attribute • Bundled Text Attribute • Bundled Marker Attribute

  39. Bundled Attributes • Bundled Line Attributes: • The line attributes on a specified workstation is set using the function setPolylineRepresentation(ws,li,lt,lw,lc) • where, ws—workstation identifier, li—Line Index Parameter, lt—line type, lw—line width, lc—line color • E.g. setPolylineRepresentation(1,3,2, 0.5,1) • - draws a blue colored line with half width.

  40. Bundled Attributes • A particular attribute is then selected from the table with the function setPolylineIndex(li) • where li is the line index

  41. Bundled Attributes • Bundled Area fill attributes: • Table entries for bundled area-fill attributes are set with setInteriorRepresentation(ws,fi,fs,pi,fc) • where, ws—workstation identifier, fi—fill index on workstation, fs—fill style, pi—pattern index, fc—fill color • A particular attribute is then selected from the table with the function setInteriorIndex(fi) • where fi is the fill index

  42. Bundled Attributes • Bundled Text AttributesTable entries for bundled text attributes are set with setTextRepresentation(ws,ti,tf,tp,te,ts,tc) • where, ws—workstation identifier, ti—text index, tf—text font, tp—text precision, te—text expansion factor, ts—text size,tc—text color - A particular attribute is then selected from the table with the function setTextIndex(ti)where ti is the text index

  43. Bundled Attributes • Bundled Marker Attributes-Table entries for bundled text attributes are set with setMarkerRepresentation(ws,mi,mt,ms,mc) • where, ws—workstation identifier, mi—marker index, mt—marker type, ms—marker scale factor, mc—marker color • A particular attribute is then selected from the table with the function setPolymarkerIndex(mi)

More Related