Windowing and clipping are techniques used in computer graphics to select and display portions of an image or drawing. Windowing refers to selecting a region or "window" to view. The viewport defines the area on the display device where the window will be mapped. Clipping determines which parts of an image or drawing are visible within the window by dividing elements into visible and invisible portions. Common clipping techniques include point, line, polygon and curve clipping. The Cohen-Sutherland and Liang-Barsky algorithms are used for line clipping, and Sutherland-Hodgeman for polygon clipping. Midpoint subdivision is another line clipping method.
he capability that show some part of object internal a specify window is called windowing and a rectangular region in a world coordinate system is called window. ... Points and lines which are outside the window are "cut off" from view. This process of "cutting off" parts of the image of the world is called Clipping.
he capability that show some part of object internal a specify window is called windowing and a rectangular region in a world coordinate system is called window. ... Points and lines which are outside the window are "cut off" from view. This process of "cutting off" parts of the image of the world is called Clipping.
How to Make a Field invisible in Odoo 17Celine George
It is possible to hide or invisible some fields in odoo. Commonly using “invisible” attribute in the field definition to invisible the fields. This slide will show how to make a field invisible in odoo 17.
Model Attribute Check Company Auto PropertyCeline George
In Odoo, the multi-company feature allows you to manage multiple companies within a single Odoo database instance. Each company can have its own configurations while still sharing common resources such as products, customers, and suppliers.
Students, digital devices and success - Andreas Schleicher - 27 May 2024..pptxEduSkills OECD
Andreas Schleicher presents at the OECD webinar ‘Digital devices in schools: detrimental distraction or secret to success?’ on 27 May 2024. The presentation was based on findings from PISA 2022 results and the webinar helped launch the PISA in Focus ‘Managing screen time: How to protect and equip students against distraction’ https://www.oecd-ilibrary.org/education/managing-screen-time_7c225af4-en and the OECD Education Policy Perspective ‘Students, digital devices and success’ can be found here - https://oe.cd/il/5yV
The Roman Empire A Historical Colossus.pdfkaushalkr1407
The Roman Empire, a vast and enduring power, stands as one of history's most remarkable civilizations, leaving an indelible imprint on the world. It emerged from the Roman Republic, transitioning into an imperial powerhouse under the leadership of Augustus Caesar in 27 BCE. This transformation marked the beginning of an era defined by unprecedented territorial expansion, architectural marvels, and profound cultural influence.
The empire's roots lie in the city of Rome, founded, according to legend, by Romulus in 753 BCE. Over centuries, Rome evolved from a small settlement to a formidable republic, characterized by a complex political system with elected officials and checks on power. However, internal strife, class conflicts, and military ambitions paved the way for the end of the Republic. Julius Caesar’s dictatorship and subsequent assassination in 44 BCE created a power vacuum, leading to a civil war. Octavian, later Augustus, emerged victorious, heralding the Roman Empire’s birth.
Under Augustus, the empire experienced the Pax Romana, a 200-year period of relative peace and stability. Augustus reformed the military, established efficient administrative systems, and initiated grand construction projects. The empire's borders expanded, encompassing territories from Britain to Egypt and from Spain to the Euphrates. Roman legions, renowned for their discipline and engineering prowess, secured and maintained these vast territories, building roads, fortifications, and cities that facilitated control and integration.
The Roman Empire’s society was hierarchical, with a rigid class system. At the top were the patricians, wealthy elites who held significant political power. Below them were the plebeians, free citizens with limited political influence, and the vast numbers of slaves who formed the backbone of the economy. The family unit was central, governed by the paterfamilias, the male head who held absolute authority.
Culturally, the Romans were eclectic, absorbing and adapting elements from the civilizations they encountered, particularly the Greeks. Roman art, literature, and philosophy reflected this synthesis, creating a rich cultural tapestry. Latin, the Roman language, became the lingua franca of the Western world, influencing numerous modern languages.
Roman architecture and engineering achievements were monumental. They perfected the arch, vault, and dome, constructing enduring structures like the Colosseum, Pantheon, and aqueducts. These engineering marvels not only showcased Roman ingenuity but also served practical purposes, from public entertainment to water supply.
Ethnobotany and Ethnopharmacology:
Ethnobotany in herbal drug evaluation,
Impact of Ethnobotany in traditional medicine,
New development in herbals,
Bio-prospecting tools for drug discovery,
Role of Ethnopharmacology in drug evaluation,
Reverse Pharmacology.
This is a presentation by Dada Robert in a Your Skill Boost masterclass organised by the Excellence Foundation for South Sudan (EFSS) on Saturday, the 25th and Sunday, the 26th of May 2024.
He discussed the concept of quality improvement, emphasizing its applicability to various aspects of life, including personal, project, and program improvements. He defined quality as doing the right thing at the right time in the right way to achieve the best possible results and discussed the concept of the "gap" between what we know and what we do, and how this gap represents the areas we need to improve. He explained the scientific approach to quality improvement, which involves systematic performance analysis, testing and learning, and implementing change ideas. He also highlighted the importance of client focus and a team approach to quality improvement.
2. Windowing
• The method of selecting and enlarging a
portion of a drawing is called windowing.
• The area chosen for this display is called
a window.
• Viewport: An area on display device to which
a window is mapped [where it is to displayed].
...
3. Clipping
• When we have to display a large portion of the picture,
then not only scaling & translation is necessary, the
visible part of picture is also identified.
• This process is not easy. Certain parts of the image are
inside, while others are partially inside.
• The lines or elements which are partially visible will be
omitted.
• For deciding the visible and invisible portion, a
particular process called clipping is used.
• Clipping determines each element into the visible and
invisible portion. Visible portion is selected. An
invisible portion is discarded.
4. Types of Clipping:
• Point Clipping
• Line Clipping
• Area Clipping (Polygon)
• Curve Clipping
• Text Clipping
• Exterior Clipping
5. Some Basic Terms
• 1:A viewport defines in normalized coordinates a
rectangular area on the display device where the
image of the data appears.
• 2:The process of selecting and viewing the
picture with different views is called Windowing,
and
• a Process which divides each element of the
picture into its visible and invisible portions,
allowing the invisible portion to be discarded is
called Clipping.
6. CONTINUE..
• The method of selecting and enlarging a
portion of a drawing is called windowing.
• The area chosen for this display is called
a window.
• The window is selected by world-coordinate.
Almost all 2D and 3D graphics packages
provide means of defining viewport size on
the screen.
7. ……
• The method of selecting and enlarging a portion of a
drawing is called windowing. The area chosen for this
display is called a window. The window is selected by
world-coordinate.
• Sometimes we are interested in some portion of the
object and not in full object. So we will decide on an
imaginary box. This box will enclose desired or
interested area of the object. Such an imaginary box is
called a window.
• Viewport: An area on display device to which a window
is mapped [where it is to displayed].
8. Viewing transformation
• Viewing Transformation is the mapping of
coordinates of points and lines that form the
picture into appropriate coordinates on the
display device. ... Mapping the window onto a
sub region of the display device called the
viewport is called the Viewing Transformation
9.
10. Viewing transformation in several
steps:
• First, we construct the scene in world coordinate using the output
primitives and attributes.
• To obtain a particular orientation, we can set up a 2-D viewing
coordinate system in the window coordinate plane and define a
window in viewing coordinates system.
• Once the viewing frame is established, are then transform
description in world coordinates to viewing coordinates.
• Then, we define viewport in normalized coordinates (range from 0
to 1) and map the viewing coordinates description of the scene to
normalized coordinates.
• At the final step, all parts of the picture that (i.e., outside the
viewport are dipped, and the contents are transferred to device
coordinates).
•
13. Applications of clipping:
• It will extract part we desire.
• For identifying the visible and invisible area in the
3D object.
• For creating objects using solid modeling.
• For drawing operations.
• Operations related to the pointing of an object.
• For deleting, copying, moving part of an object.
14. Types of Lines:
• Visible: A line or lines entirely inside the
window is considered visible
• Invisible: A line entirely outside the window is
considered invisible
• Clipped: A line partially inside the window and
partially outside is clipped. For clipping point
of intersection of a line with the window is
determined.
15.
16. • Clipping can be applied through hardware as
well as software.
• In some computers, hardware devices
automatically do work of clipping.
• In a system where hardware clipping is not
available software clipping applied.
18. Point Clipping:
• Point Clipping is used to determining, whether
the point is inside the window or not. For this
following conditions are checked.
• x ≤ xmax
• x ≥ xmin
• y ≤ ymax
• y ≥ ymin
19. (x, y) is coordinate of the point. If
anyone from the above inequalities is
false, then the point will fall outside
the window and will not be considered
to be visible.
20. Line Clipping:
• It is performed by using the line clipping
algorithm.
• The line clipping algorithms are:
• Cohen Sutherland Line Clipping Algorithm
• Midpoint Subdivision Line Clipping Algorithm
• Liang-Barsky Line Clipping Algorithm
21. Category of line
• There are three possible cases for any given line.
• Completely inside the given rectangle : Bitwise OR of region
of two end points of line is 0 (Both points are inside the
rectangle)
• Completely outside the given rectangle : Both endpoints
share at least one outside region which implies that the line
does not cross the visible region. (bitwise AND of endpoints !=
0).
• Partially inside the window : Both endpoints are in different
regions. In this case, the algorithm finds one of the two points
that is outside the rectangular region. The intersection of the
line from outside point and rectangular window becomes new
corner point and the algorithm repeats
24. Mid Point Subdivision Line Clipping
Algorithm:
• It is used for clipping line.
• The line is divided in two parts. Mid points of
line is obtained by dividing it in two short
segments. Again division is done, by finding
midpoint. This process is continued until line
of visible and invisible category is obtained.
Let (xi,yi) are midpoint
28. Explanation
• Midpoint subdivision algorithm is an extension of the Cyrus Beck
algorithm. This algorithm is mainly used to compute visible areas of lines
that are present in the view port are of the sector or the image.
• It follows the principle of the bisection method and works similarly to the
Cyrus Beck algorithm by bisecting the line in to equal halves.
• But unlike the Cyrus Beck algorithm, which only bisects the line once,
Midpoint Subdivision Algorithm bisects the line numerous times.
• Also the Sutherland Cohen subdivision line clipping algorithm requires the
calculation of the intersection of the line with the window edge. These
calculations can be avoided by repetitively subdividing the line at its
midpoint.
• Like other algorithm, initially the line is tested for visibility. If line is
completely visible it is drawn and if it is completely invisible it is rejected.
If line is partially visible then it is subdivided in two equal parts. The
visibility tests are then applied to each half. This subdivision process is
repeated until we get completely visible and completely invisible line
segments. This is illustrated in figure (k) below
29. ….
• As shown in the figure (k), line P1 P2 is partially visible. It is
subdivided in two equal Parts P1 P3 and P3 P2 (see Fig. k (b)). Both
the line segments are tested for visibility and found to be partially
visible. Both line segments are then subdivided in two equal parts
to get midpoints P4 and P5 (see Fig. k (c)). It is observed that line
segments P1 P4 and P5 P2 are completely invisible and hence
rejected. However, line segment P3 P5 is completely visible and
hence drawn. The remaining line segment P4 P3 is still partially
visible. It is then subdivided to get midpoint P6. It is observed that
P6 P3 is completely visible whereas P4 P6 is partially visible. Thus
P6 P3 line segment is drawn and P4 P6 line segment is further
subdivided into equal parts to get midpoint P7. Now, it is observed
that line segment P4 P7 is completely invisible and line segment P7
P6 is completely visible (see Fig. k (f)), and there is no further
partially visible segment.
30. Advantage of midpoint subdivision Line Clipping:
It is suitable for machines in which multiplication and division operation is not
possible. Because it can be performed by introducing clipping divides in hardware
x5lie on point of intersection of boundary of
window.
31.
32. Algorithm of midpoint subdivision Line
Clipping
• :
• Step1: Calculate the position of both endpoints of the line
• Step2: Perform OR operation on both of these endpoints
• Step3: If the OR operation gives 0000
• then
• Line is guaranteed to be visible
• else
• Perform AND operation on both endpoints.
• If AND ≠ 0000
• then the line is invisible
• else
• AND=6000
• then the line is clipped case.
• Step4: For the line to be clipped. Find midpoint
• Xm=(x1+x2)/2
• Ym=(y1+y2)/2
• Xmis midpoint of X coordinate.
• Ymis midpoint of Y coordinate.
• Step5: Check each midpoint, whether it nearest to the boundary of a window or not.
• Step6: If the line is totally visible or totally rejected not found then repeat step 1 to 5.
• Step7: Stop algorithm.
33. Cohen Sutherland Line Clipping
Algorithm
• Cohen Sutherland Algorithm is a line clipping
algorithm :that cuts lines to portions which
are within a rectangular area. It eliminates the
lines from a given set of lines and rectangle
area of interest (view port) which belongs
outside the area of interest and clip those
lines which are partially inside the area of
interest.
34.
35. …
• There are 3 possibilities for the line:
• Line can be completely inside the window
(This line should be accepted).
• Line can be completely outside of the window
(This line will be completely removed from the
region).
• Line can be partially inside the window (We
will find intersection point and draw only that
portion of line that is inside region).
36. Algorithm
• The algorithm divides a two-dimensional
space into 9 regions (eight outside regions
and one inside region) and then efficiently
determines the lines and portions of lines that
are visible in the central region of interest (the
viewport).
• Following image illustrates the 9 regions:
39. ……….
• As you seen each region is denoted by a 4 bit code like
0101 for the bottom right region
• Four Bit code is calculated by comparing extreme end point
of given line (x,y) by four co-ordinates x_min, x_max,
y_max, y_min which are the coordinates of the area of
interest (0000)
• Calculate the four bit code as follows:
• Set First Bit if 1 Points lies to left of window (x < x_min)
• Set Second Bit if 1 Points lies to right of window (x > x_max)
• Set Third Bit if 1 Points lies to bottom of window (y <
y_min)
• Set Fourth Bit if 1 Points lies to top of window (y > y_max)
40. ….
The sequence for reading the codes' bits
is LRBT (Left, Right, Bottom, Top).
42. Algorithm
• Step 1 : Assign a region code for two endpoints of given line
• Step 2 : If both endpoints have a region code 0000 then given line is
completely inside and we will keep this line
• Step 3 : If step 2 fails, perform the logical AND operation for both
region codes.
– Step 3.1 : If the result is not 0000, then given line is completely
outside.
– Step 3.2 : Else line is partially inside.
• Step 3.2.a : Choose an endpoint of the line that is outside the given rectangle.
• Step 3.2.b : Find the intersection point of the rectangular boundary (based on
region code).
• Step 3.2.c : Replace endpoint with the intersection point and update the
region code.
• Step 3.2.d : Repeat step 2 until we find a clipped line either trivially accepted
or rejected.
• Step 4 : Repeat step 1 for all lines
43. …..
• To find out intersection boundary if bit 1 is 1 ,line
intersect with line x=xmin(left boundary)
• To find out intersection boundary if bit 2 is 1 ,line
intersect with line x=xmin(right boundary)
• To find out intersection boundary if bit 3 is 1 ,line
intersect with line x=xmin(bottom boundary)
• To find out intersection boundary if bit 4 is 1 ,line
intersect with line x=xmin(top boundary)
44. …..
• Then find out coordinates of intersection point, once
line of interaction is known, then point of intersection
is calculated as,
• 1.If boundary line is vertical ,then
• Xa=xmin or xmax
• Ya=y1+m(xa-x1)
• 2.if boundary line is horizontal ,then
• Ya=ymin or ymax, xa=x1+(ya-y1)/m
• m is slope of line=(y2-y1)/(x2-x1).
• Replace end points with intersection points, display
new line joining two intersection points.
45. Liang-Barsky Line Clipping Algorithm:
• Liang and Barsky have established an
algorithm that uses floating-point arithmetic
but finds the appropriate endpoints with at
most four computations. This algorithm uses
the parametric equations for a line and solves
four inequalities to find the range of the
parameter for which the line is in the
viewport.
47. Continue…..
• Let P(x1, y1), Q(x2, y2) is the line which we want
to study. The parametric equation of the line
segment from gives x-values and y-values for
every point in terms of a parameter that ranges
from 0 to 1. The equations are
• x=x1+(x2-x1 )*t=x1+dx*t and y=y1+(y2-
y1 )*t=y1+dy*t
• We can see that when t = 0, the point computed
is P(x1, y1); and when t = 1, the point computed
is Q(x2, y2).
48. Algorithm
• Algorithm of Liang-Barsky Line Clipping:
• 1. Set tmin=0 and tmax=1
• 2. Calculate the values tL,tR,tT and tB(tvalues).
If t<tmin or t<tmax? ignore it and go to the next edge
Otherwise classify the tvalue as entering or exiting value (using
inner product to classify)
If t is entering value set tmin=t if t is exiting value set
tmax=t.</t</t3. If tmin< tmax? then draw a line from (x1 + dx*tmin,
y1 + dy*tmin) to (x1 + dx*tmax?, y1 + dy*tmax? )
• 4. If the line crosses over the window, you will see (x1 + dx*tmin, y1 +
dy*tmin) and (x1 + dx*tmax? , y1 + dy*tmax?) are intersection
between line and edge.
49. Polygon Clipping
• Polygon is a representation of the surface. It is
primitive which is closed in nature. It is formed using a
collection of lines.
• It is also called as many-sided figure.
• The lines combined to form polygon are called sides or
edges. The lines are obtained by combining two
vertices.
• Triangle
• Rectangle
• Hexagon
• Pentagon
50.
51.
52. Convex Polygon
• A polygon is called convex of line joining any
two interior points of the polygon lies inside
the polygon.
53. Concave Polygon
• A concave polygon has one interior angle
greater than 180°. So that it can be clipped
into similar polygons.
•
54. Sutherland-Hodgeman Polygon
Clipping
• It is performed by processing the boundary of
polygon against each window corner or edge.
• First of all entire polygon is clipped against
one edge, then resulting polygon is
considered, then the polygon is considered
against the second edge, so on for all four
edges.
55. Four possible situations while
processing
• If the first vertex is an outside the window, the second
vertex is inside the window. Then second vertex is
added to the output list. The point of intersection of
window boundary and polygon side (edge) is also
added to the output line.
• If both vertexes are inside window boundary. Then only
second vertex is added to the output list.
• If the first vertex is inside the window and second is an
outside window. The edge which intersects with
window is added to output list.
• If both vertices are the outside window, then nothing is
added to output list.
56.
57. …
Sutherland-Hodgeman Polygon
Clipping Algorithm:-
…….
• A polygon can be clipped by processing its boundary as a whole against
each window edge.
• This is achieved by processing all polygon vertices against each clip
rectangle boundary in turn.
• beginning with the original set of polygon vertices, we could first clip the
polygon against the left rectangle boundary to produce a new sequence of
vertices.
• The new set of vertices could then be successively passed to a right
boundary clipper, a top boundary clipper and a bottom boundary clipper,
as shown in figure (l).
• At each step a new set of polygon vertices is generated and passed to the
next window boundary clipper.
• This is the fundamental idea used in the Sutherland - Hodgeman
algorithm.
•
58.
59. • The output of the algorithm is a list of polygon
vertices all of which are on the visible side of a
clipping plane.
• Such each edge of the polygon is individually
compared with the clipping plane.
• This is achieved by processing two vertices of
each edge of the polygon around the clipping
boundary or plane.
• This results in four possible relationships
between the edge and the clipping boundary or
Plane.
60.
61. …………
• If the first vertex of the edge is outside the window boundary and the second vertex of the edge is
inside then the intersection point of the polygon edge with the window boundary and the second
vertex are added to the output vertex list (See Fig. m (a)).
• If both vertices of the edge are inside the window boundary, only the second vertex is added to the
output vertex list. (See Fig. m (b)).
• If the first vertex of the edge is inside the window boundary and the second vertex of the edge is
outside, only the edge intersection with the window boundary is added to the output vertex list.
(See Fig. m (c)).
• If both vertices of the edge are outside the window boundary, nothing is added to the output list.
(See Fig. m (d)).
• Once all vertices are processed for one clip window boundary, the output list of vertices is clipped
against the next window boundary. Going through above four cases we can realize that there are
two key processes in this algorithm.
• Determining the visibility of a point or vertex (lnside - Outside test) and
• Determining the intersection of the polygon edge and the clipping plane.
• One way of determining the visibility of a point or vertex is described here. Consider that two
points A and B define the window boundary and point under consideration is V, then these three
points define a plane. Two vectors which lie in that plane are AB and AV. If this plane is considered
in the xy plane, then the vector cross product AV x AB has only a component given by
• The sign of the z component decides the position of Point V with respect to window boundary.
• If z is:
• Positive - Point is on the right side of the window boundary.
• Zero - Point is on the window boundary.
• Negative - Point is on the left side of the window boundary.
62. …
• Sutherland-Hodgeman Polygon Clipping Algorithm:-
• Read coordinates of all vertices of the Polygon.
• Read coordinates of the dipping window
• Consider the left edge of the window
• Compare the vertices of each edge of the polygon,
individually with the clipping plane.
• Save the resulting intersections and vertices in the new list
of vertices according to four possible relationships between
the edge and the clipping boundary.
• Repeat the steps 4 and 5 for remaining edges or the
clipping window. Each time the resultant list of vertices is
successively passed to process the next edge of the clipping
window.
• Stop.
63. …..
• Example :- For a polygon and clipping
window shown in figure below give the list
of vertices after each boundary clipping.
64. ……
• Solution:- Original polygon vertices are V1,
V2, V3, V4, and V5. After clipping each
boundary the new vertices are as shown in
figure above
65. Text Clipping:
• Several methods are available for clipping of text.
• Clipping method is dependent on the method of
generation used for characters.
• A simple method is completely considered, or
nothing considers method.
• This method is also called as all or none.
• If all characters of the string are inside window,
then we will keep the string, if a string character
is outside then whole string will be discarded in
fig (a).
66.
67. • Curve Clipping:
• Curve Clipping involves complex procedures as
compared to line clipping. Curve clipping
requires more processing than for object with
linear boundaries. Co
68. • Exterior Clipping:
• It is opposite to previous clipping. Here picture which is
outside the window is considered. The picture inside
the rectangle window is discarded. So part of the
picture outside the window is saved.
Uses of Exterior Clipping:
• It is used for displaying properly the pictures which
overlap each other.
• It is used in the concept of overlapping windows.
• It is used for designing various patterns of pictures.
• It is used for advertising purposes.