0% found this document useful (0 votes)
1K views3 pages

Segments in Computer Graphics

To view images or parts of images with different attributes, computer graphics uses segments. Each segment corresponds to a component and can have unique scaling, rotation, and other transformation parameters applied. Segments allow subdivision of images, viewing specific parts, and transforming parts independently. Segments are created with a name and attributes, closed by changing the open segment name, and deleted to recover space in the display file. Segmentation provides benefits like organizing images in sub-pictures, applying attributes selectively, and transforming parts of images independently.

Uploaded by

Vaish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
0% found this document useful (0 votes)
1K views3 pages

Segments in Computer Graphics

To view images or parts of images with different attributes, computer graphics uses segments. Each segment corresponds to a component and can have unique scaling, rotation, and other transformation parameters applied. Segments allow subdivision of images, viewing specific parts, and transforming parts independently. Segments are created with a name and attributes, closed by changing the open segment name, and deleted to recover space in the display file. Segmentation provides benefits like organizing images in sub-pictures, applying attributes selectively, and transforming parts of images independently.

Uploaded by

Vaish
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
Download as pdf or txt
Download as pdf or txt
You are on page 1/ 3

Segments in Computer Graphics

To view an entire image or a part of image with various attributes, we need to organize image
information in a particular manner since existing structure of display file does not satisfy our
requirements of viewing an image. To achieve this display, file is divided into Segments. Each
segment corresponds to a component and is associated with a set of attributes and image
transformation parameters like scaling, rotation. Presence of Segment allows:
 Subdivision of picture.
 Visualization of particular part of picture.
 Scaling, rotation and translation of picture.

Types of Segments:
 Posted Segment: When visible attribute of segment is set to 1, it is called Posted segment.
This is included in active segment list.
 Unposted Segment: When visible attribute of segment is set to 0, it is called Unposted
segment. This is not included in active segment list.

Functions/Operations for segmenting the display:


1. Segment Creation: Segment must be created or opened when no other segment is open,
since two segments can’t be opened at the same time because it’s difficult to assign
drawing instruction to particular segment. The segment created must be given a name to
identify it which must be a valid one and there should be no segment with the same name.
After this, we initialize items in segment table under our segment name and the first
instruction of this segment is allocated at next free storage in display file and attributes of
segments are initialized to default.
Algorithm :
1. If any segment is open, give error message: “Segment is still open” and go to step 8.
2. Read the name of the new segment.
3. If the segment name is not valid, give error message: “Segment name not a valid
name” and go to step 8.
4. If given segment name already exists, give error message: “Segment name already
exists in name list” and go to step 8.
5. Make next free storage area in display file as start of new segment.
6. Initialize size of new segment to 0 and all its attributes to their default values.
7. Inform that the new segment is now open.
8. Stop.
2. Closing a Segment: After completing entry of all display file instructions, the segment
needs to be closed for which it to be has renamed, which is done by changing the name
of currently open segment as 0. Now the segment with name 0 is open i.e. unnamed
segment is open and if two unnamed segments are present in display file one needs to
be deleted.
Algorithm :
1. If any segment is not open, give error message: “No segment is open now” and
go to step 6.
2. Change the name of currently opened segment to any unnamed segment, lets say
0.
3. Delete any other unnamed segment instruction which may have been saved and
initialize above unnamed segment with no instructions.
4. Make the next free storage area available in display file as start of the unnamed
segment.
5. Initialize size of unnamed segment to 0.
6. Stop.
Deleting a Segment: To delete a particular segment from display file, we must just delete that
one segment without destroying or reforming the entire display and recover space occupied by
this segment. Use this space for some other segment. The method to achieve this depends upon
the data structure used to represent display file. In case of arrays, the gap left by deleted
segment is filled by shifting up all the segments following it.
Advantages of using segmented display:
 Segmentation allows organizing display files in sub-picture structure.
 It allows applying different set of attributes to different portions of image.
 It makes it easier to the picture by changing/replacing segments.
 It allows application of transformation on selective portions of image.

You might also like