Write a short note on curve clipping and text clipping.
Curve clipping :-
Curve clipping procedures will involve non-linear equations, however, this requires more processing than for objects with linear boundaries.
The bounding rectangle for a circle or other curved object can be used first to test for overlap with a rectangular clip window.
If the bounding rectangle for the object is completely inside the window, we save the object.
If the bounding rectangle is determined to be completely outside the window, we discard the object.
This procedures can be applied when clipping a curved object against a general polygon clip region. On the first pass, we can clip the bounding rectangle of the object against the bounding rectangle of the clip region.
If the two regions overlap, we will need to solve the simultaneous line-curve equations to obtain the clipping intersection points.
Text clipping :-
Text clipping is a clipping in which we clip the whole character or only part of it and depends on the requirement of the application.
Following are the various text clipping methods :
All-or-none string clipping method :
In this method, if all of the string is inside a clip window, we keep it. Otherwise, the string is discarded.
This method is implemented by considering a bounding rectangle around the text pattern.
The boundary positions of the rectangle are then compared to the window boundaries, and the string is rejected if there is any overlap.
This method produces the fastest text clipping.
All-or-none character clipping method :
In this method, we keep the character of the strings which lies inside clip window, otherwise, discard it.
In this case, the boundary limits of individual characters are compared to the window.
Any character that either overlaps or is outside a window boundary is clipped.