Questions tagged [clipping]

Any procedure which identifies that portion of a picture which is either inside or outside a region is referred to as a clipping algorithm or clipping. The region against which an object is to be clipped is called clipping window.

Any procedure which identifies that portion of a picture which is either inside or outside a region is referred to as a clipping algorithm or clipping. The region against which an object is to be clipped is called clipping window.

Examples

In 2D graphics for example, if the user of an image editing program is modifying an image and has "zoomed in" the view to display only the top half of the image, there is no need for the program to spend any CPU time doing any of the calculations or memory moves needed to display the bottom half. By clipping the bottom half of the image and avoiding these calculations, the program runs faster.

In 3D graphics, in a city street scene the computer may have model, texture, and shader data in memory for every building in the city; but since the camera viewing the scene only sees things within, say, a 90° angle, or field of view, the computer does not need to transform, texture, and shade the buildings that are behind the camera, nor those which are far enough to the side that they are off the screen. The clipping algorithm lets the rendering code skip all consideration of those buildings, and the program runs faster

(From wikipedia)

665 questions
13
votes
2 answers

How to clip a circular path inside a rectangle in Android

I've read over 20 questions/answers but I still can't get what I want. I want to cut a circle inside a rectangle as seen below: Here is my code: @Override protected void onDraw(Canvas canvas) { Paint paint = new Paint(); …
13
votes
1 answer

Finding the intersection of two 3D polygons

a.k.a. Polygon clipping algorithm in 3D a.k.a. Finding the collision manifold between 2 colliding polygons Most algorithms for polygon clipping are described in detail for 2D and described as being extendable to 3D but without details. For example…
Richard Tingle
  • 16,906
  • 5
  • 52
  • 77
12
votes
1 answer

Can I apply clipping in SVG without specifying a clip-path ID?

In my markup, I have a chunk like this:
mikepurvis
  • 1,568
  • 2
  • 19
  • 28
12
votes
4 answers

How to apply inverse text mask with CSS

I'll try to explain my question with images. Here we go. 1 - This image shows the text masking an image, so far so good, I can do with the following code: font-size: 120px; background: url(image-to-be-masked.jpg) repeat 0 0,…
12
votes
3 answers

Dynamic height of TextView within a GridLayout

I have a problem using GridLayout using library compatibility (not tried without). I am using app:layout_gravity="fill_horizontal" instead of android:layout_gravity="fill_horizontal" but all the content inside the TextView is not displayed. In order…
Jul
  • 1,039
  • 3
  • 12
  • 20
11
votes
5 answers

SwiftUI Text clips on resize

In the following sample, tapping the 'Expand' button causes the text '39' to clip as it resizes in transition to '40'. The real context of this use is a text label that reflects the value of a picker in an animated diagram. I'd like for the text to…
Michael Pangburn
  • 261
  • 1
  • 10
11
votes
5 answers

How do I keep an object always in front of everything else in OpenGL?

I have this function which draws a small 3D axis coordinate system on the bottom left corner of the screen but depending on what I have in front of me, it may get clipped. For instance, I have drawn a plain terrain on the ground, on the XZ plane at…
rfgamaral
  • 16,546
  • 57
  • 163
  • 275
11
votes
3 answers

How to Clip content with rounded corners in Windows Store App

I've attempted to have a (with interactive stuff inside, not just an image) clipped with rounded corners (a or a , whatever works). I've attempted multiple solutions, but none of them was compatible with a Windows Store…
Cœur
  • 37,241
  • 25
  • 195
  • 267
10
votes
1 answer

border-radius; overflow: hidden, and text is not clipped

I'm doing some stylistic text inside of rounded divs, where the text bumps right up against the top of the container. I've been able to control almost all content, nested divs, images set as backgrounds, etc, and had them all clip successfully, but…
ioTus
  • 667
  • 6
  • 9
10
votes
1 answer

RectangleGeometry with relative dimensions... how?

I'm trying to replicate the nowadays so fashionable "reflex" effect on a controltemplate for buttons I'm creating. The basic idea is to create a rectangle with a gradient fill from white to transparent and then clip some of that semi-transparent…
Padu Merloti
  • 3,219
  • 3
  • 33
  • 44
10
votes
2 answers

Drag a zoomed image within a div clipping mask using jQuery draggable?

I'm creating an interface to allow a user to zoom in on an image and drag the zoomed version around within a clipping mask div. I have a div 200px by 200px that I set overflow: hidden on. Then I load a std img () into the div that…
Justin Vincent
  • 1,329
  • 2
  • 14
  • 22
10
votes
3 answers

WPF Adorner Clipping

I have an ItemsControl in a ScrollViewer. The items in the ItemsControl are expanded to a DataTemplate which basically consists of an Adorner. Now the problem is, when scrolling, the Visual Children of the Adorner are visible outside the…
Andrej
  • 981
  • 8
  • 17
10
votes
1 answer

CGContextClipToMask returning blank image

I'm new to Quartz. I have 2 images, a background, and a mask with cutout shape that I want to lay over the background in order to cut out a section. The resulting image should be the shape of the cutout. This is my mask (the shape in the middle is 0…
Smikey
  • 8,106
  • 3
  • 46
  • 74
9
votes
4 answers

Avoid clipping of points along axis in ggplot

I am plotting a time series with mean values of a response variable as points (y-axis) by month (x-axis). Values lying on the x-axis (i.e. 0 values) are clipped. I can change the limits of the y-axis to include some padding below 0, but I prefer…
user1267299
  • 125
  • 1
  • 2
  • 6
9
votes
2 answers

How to apply a clipping mask to geom in a ggplot?

I am trying to apply a clipping mask to a geom from a ggplot to mask part of the data, but keep the axis, the grid, other geoms and the legend visible. I do not want to create a specific plot, and therefore I am not looking for a work-around with…
Hobo Sheep
  • 389
  • 2
  • 11
1
2
3
44 45