Clipping is the process of drawing pixels only to a selected 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.
Technically, it can be viewed as a method or procedure that determines whether a pixel is outside or inside of a specified region. The method is termed as clipping or clipping algorithm.
There are various applications ranging from surface visibility identification in three-dimensional view, drawing operation, to object creation using solid modeling method.
Based on application, clipping window boundaries is identified i.e. polygon.
A portion of two-dimensional scene that is chosen for display is termed as clipping window.
A region to which an object inside the clipping window is mapped is called viewport.
Read : What is window and viewport?
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.
In point clipping, a point (x,y) is checked whether it falls within the window or not.
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.
Ploygon clipping also follows the same concept, it cuts out vertices of the polygon that is outside the windows. Sutherland–Hodgman algorithm and Weiler-Atherton polygon clipping algorithm techniques are used for clipping a polygon.
Clipping a polygon is a complex procedure, unlike line clipping where only two points need to map one another. In polygon clipping, a method may generate a sequence of vertices as output that can be represented as clipping boundaries.
It can be defined as a process where a string (a sequence of character) that falls outside the window is removed.
There are various text clipping methods and its usage depends on character generation mechanisms. all-or-none clipping is the simplest method for clipping text corresponding to a window.
This post was last modified on July 4, 2022