0% found this document useful (0 votes)
7 views11 pages

Unit - 3 Segments

This document discusses the concept of segments in display files, which allow for the organization of image information into manageable components or objects, each with associated attributes. It outlines the functions for creating, modifying, and deleting segments, as well as the attributes that can be assigned to them, such as visibility, priority, highlights, and transformations. Additionally, it covers memory management for segment storage and the structure of segment files within graphic systems.

Uploaded by

manojgmmanojgm1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views11 pages

Unit - 3 Segments

This document discusses the concept of segments in display files, which allow for the organization of image information into manageable components or objects, each with associated attributes. It outlines the functions for creating, modifying, and deleting segments, as well as the attributes that can be assigned to them, such as visibility, priority, highlights, and transformations. Additionally, it covers memory management for segment storage and the structure of segment files within graphic systems.

Uploaded by

manojgmmanojgm1
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

UNIT – 3

SEGMENTS
INTRODUCTION:
Until now we have discussed a single picture on the display. In practice, the image on the display screen is often
composed of several pictures or items of information. An image may contain several views of an object and
related information. It may also contain close up view of a particular component.

Example: We wish to display an internal plan of a living room. The plan may contain various objects such as TV,
Show piece, Table, etc. Each object has a set of attributes such as size, color and its position in the room. We
might wish to see all these objects simultaneously or a single object at a time.

To view the entire image or a part of the image with various attributes we need to organize the image information
in a particular manner. The image information is stored in the display file.

Existing structure of the display file does not satisfy our requirements of viewing the image. Hence the display
structure is modified to reflect the sub picture structure. To achieve this, display file is divided into segments.

Each segment corresponds to a component or an object of the overall display and is associated with a set of
attributes.
The presence of segment allows:
➢ Sub division of picture
➢ Visualization of a particular part of the picture.
➢ Scaling, rotation and translation of a particular part of the picture.
SEGMENT: The segment is a unit of the display file. (Used to define a unit of picture)
➢ It is efficient to define and modify a picture as a set of sub pictures. A segment is a set of output
primitives that are joined for modification purpose.
➢ It is a logical unit and a collection of display file instructions representing graphics primitives that
can be manipulated as a single unit.
The programmer must be able to name the different parts of the picture. Secondly furnish with
subroutines or functions that affect the desired modification on the appropriate parts. The display file
has two fundamental attributes that are required. Names or labels can be assigned to sets of instructions
and these instructions can be easily modified.
Function for segmenting the display file: For a sequential disk file we open a file to add data to it. We
close the file when we have added the last data items and the file is completed. To change the contents
of a file, we open it again, and the new data to replace the old and close the file. To get rid of a file,
delete it.

Similar operations are ideal for display file segments. To create a new segment, we open it and then call
graphics primitive to add to the segment the lines and text to be displayed. Then close the segment. To
remove a segment from the display file, we delete it.

The basic function:

OpenSegment (n) - Open a display file segment named n

CloseSegment - Close the open segment

DeleteSegment - Remove from the display file the segment named n.


Segment Files:
➢ A Segment file is any list of segments maintained by graphic system.
➢ Segment files often are stored as linked structures.
Several forms - a segmented display file is a display file program for a simple vector system.

A pseudo display file contains segment definitions from which appropriate bits in the frame buffer of
set.
Memory management for segment storage:
➢ Blocks must be assigned as segments when segments are created.
➢ Blocks must be returned to the storage pool as segments are deleted.
➢ Options
- Fixed size blocks
Easy to manage
Lead to fragmentation
-Variable sized blocks
Avoid fragmentation
More Memory management
➢ Make changes only at the end of the refresh cycle.
Segment Format:
Segment Attributes: A create segment can have number of attributes such as
1. Visibility
2. Priority
3. Highlights
4. Transformation
1. Visibility: Visibility of a segment can be set by the user with function

set_visibility(id, v)

where v is visible (posted) or invisible (unposted) which controls the display of segments and id the
segment number.

2. Priority: Segment priority can be set with the function

set_segment_priority(id, p)

where id is the segment number and p is the priority parameter which is a numeric value lying between 0
and 1.
Lower priority segments have values near 0 and are displayed first up to the highest priority segments
which are displayed last. If two segments have same priority number then uses either first in first out
scheme or segment number to break the priority tie. Since high priority segments paint over low
priority segments in the region of overlap, this property can be made use of in animation where objects
move part each other.

3. Highlights: Highlighting of a segment is implemented with the function

set_highlight(id, h)

where id is the segment number and h = highlighted or normal. The highlighting depends on the type of
displayed device used.
4. Transformation: To achieve segment transformations, the user can specify the transformation(i.e.,
size, position and orientation) matrix which needs to be applied to the individual segments.

Transformation of a segment is implemented with the function

set_segment_transformation(id, matrix)

where id is the segment number and matrix specifies the elements of transformation matrix.

Segment states: The segment states can be painted or unpainted.

You might also like