C Graphics » Clipping

Clipping is the process of drawing pixels only to a selective region or well-defined window. In this, pixels that lie outside the window or clip region get removed by using various clipping algorithms. It is mainly used for artistic purposes.

A line or an object can be partially or completely inside in a window.

If the given line or object is partially inside the clip region, then the portion which is outside the window would be removed.

Point Clipping:

In point clipping, a point (x,y) is checked whether it falls within the window or not.

 Line Clipping:

A line clipping comes into play, where the extra portion of a given line that lies outside the window is cut off from the clip region. There is a popular line clipping algorithm named Cohen sutherland algorithm.

 Polygon clipping

It also follows the same concept, it cuts out vertices of the polygon that is outside the windows.

You must be logged in to take the quiz.

error: Content is protected !!