📘 Clipping in Computer Graphics — Exam Notes
🔹 1. Introduction
Clipping is the process of removing (cutting off) parts of objects that lie outside a specified region called the clipping area.
👉 In simple terms:
Only the visible part inside a boundary is displayed; everything else is discarded.
🔹 2. Clipping Window & Viewport
✔️ Clipping Window
- The selected visible region in world coordinates
- Defined by boundaries:
[
x_{min},\ x_{max},\ y_{min},\ y_{max}
]
✔️ Viewport
- The area on the screen where the clipped image is displayed
✔️ Relationship
- First clip → then map to viewport
🔹 3. Types of Clipping
- Point Clipping
- Line Clipping
- Polygon Clipping
- Text Clipping
🔹 4. Point Clipping
✔️ Concept
A point is visible if it lies inside the clipping window.
✔️ Condition
A point ((x, y)) is inside if:
[
x_{min} \le x \le x_{max}
]
[
y_{min} \le y \le y_{max}
]
🔹 5. Line Clipping
✔️ Concept
-
A line may be:
- Completely inside → accept
- Completely outside → reject
- Partially inside → clip
🔸 5.1 Cohen–Sutherland Line Clipping Algorithm (Important)
✔️ Idea
- Divide plane into 9 regions
- Assign a 4-bit code (Region Code) to each endpoint
✔️ Region Code Format
Each bit represents:
✔️ Steps
-
Assign region codes to endpoints
-
If both codes = 0000 → Accept line
-
If logical AND ≠ 0 → Reject line
-
Else → Clip line:
- Find intersection with boundary
- Replace point and repeat
✔️ Advantages
🔸 5.2 Liang–Barsky Algorithm
✔️ Idea
- Uses parametric equations of line
- More efficient than Cohen-Sutherland
✔️ Line Equation
[
x = x_1 + u(x_2 - x_1)
]
[
y = y_1 + u(y_2 - y_1)
]
✔️ Advantages
- Fewer calculations
- More precise
🔹 6. Polygon Clipping
✔️ Concept
Used to clip complex shapes (polygons).
🔸 6.1 Sutherland–Hodgman Algorithm
✔️ Steps
-
Take polygon edges
-
Clip against each boundary:
-
Generate new vertices
✔️ Cases
- Inside → Inside
- Outside → Outside
- Inside → Outside
- Outside → Inside
🔹 7. Text Clipping
✔️ Methods
-
All-or-None String Clipping
- Entire text visible or invisible
-
Character Clipping
- Individual characters clipped
-
Component Clipping
- Each character treated as polygon
🔹 8. Important Terms
- Clipping Window: Visible region
- Viewport: Display area
- Region Code: Binary code for position
- Intersection Point: Where line meets boundary
🔹 9. Diagram Descriptions
✔️ Clipping Window
- Draw rectangle (window)
- Show objects partly inside/outside
✔️ Cohen-Sutherland Regions
- Divide plane into 9 regions
- Label region codes
✔️ Line Clipping
- Draw line crossing boundary
- Show clipped portion
🔹 10. Advantages of Clipping
- Improves efficiency
- Displays only required part
- Saves memory and processing time
🔹 11. Limitations
- Complex calculations for polygons
- May require multiple steps
📝 Likely Exam Questions
- Define clipping in computer graphics.
- What is a clipping window and viewport?
- Explain point clipping with conditions.
- Describe Cohen-Sutherland algorithm.
- Explain Liang-Barsky algorithm.
- What is polygon clipping?
- Explain Sutherland-Hodgman algorithm.
- What are types of text clipping?
- Differentiate between clipping and windowing.
- Solve a numerical on line clipping.
⚡ Quick Revision Summary
- Clipping removes unwanted parts outside window
- Types: Point, Line, Polygon, Text
- Cohen-Sutherland → region codes
- Liang-Barsky → parametric method
- Sutherland-Hodgman → polygon clipping
- Condition for point:
[
x_{min} \le x \le x_{max},\ y_{min} \le y \le y_{max}
]