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
8
votes
3 answers

In SwiftUI, how can you make a gesture inactive outside a container view?

I'm trying to make a view draggable and/or zoomable only within its clipping container view (otherwise it can run into and conflict with other views' gestures), but nothing I've tried so far keeps the gesture from extending outside the visible…
rliebert
  • 81
  • 1
  • 3
8
votes
3 answers

How to check if an object lies outside the clipping volume in OpenGL?

I'm really confused about OpenGL's modelview transformation. I understand all the transformation processes, but when it comes to projection matrix, I'm lost :( If I have a point P (x, y, z), how can I check to see if this point will be drawn on a…
roxrook
  • 13,511
  • 40
  • 107
  • 156
8
votes
2 answers

Is there a way to clip intermediate exploded gradients in tensorflow

Problem: a very long RNN net N1 -- N2 -- ... --- N100 For a Optimizer like AdamOptimizer, the compute_gradient() will give gradients to all training variables. However, it might explode during some step. A method like in…
8
votes
1 answer

Can't turn off clipping of NSView instances created in Interface Builder

I am unable to figure out how to turn off subview/sublayer clipping when my custom view is defined in Interface Builder. When I create the view programmatically, and do the setup found in many questions here on StackOverflow, it works fine for both…
Eric apRhys
  • 316
  • 2
  • 7
8
votes
3 answers

Clipping a border in WPF

I need to create a round ProgressBar template. ControlTemplate :
eran otzap
  • 12,293
  • 20
  • 84
  • 139
8
votes
1 answer

Silverlight: Canvas overflows

I have created a Canvas, and within it I placed a StackPanel. The StackPanel is horizontal, and it accepts a list of thumbnailed images. The Canvas has a fixed size. When I put more thumbnails than the Canvas width can hold, the StackPanel is…
Palantir
  • 23,820
  • 10
  • 76
  • 86
8
votes
4 answers

Displaying wpf content over/outside main window bounds

I am trying to achieve an effect of overlapping the main window boundary with a control. It's hard to explain this in words which is also maybe why I am having difficulty finding information on how to do this or if it is even possible. Below is an…
Dale
  • 12,884
  • 8
  • 53
  • 83
7
votes
3 answers

How do I clip a floating-point number to just below a limit?

Functions like numpy.random.uniform() return floating point values between a two bounds, including the first bound but excluding the top one. That is, numpy.random.uniform(0,1) may yield 0 but will never result in 1. I'm taking such numbers and…
mattdm
  • 2,082
  • 25
  • 39
7
votes
2 answers

Facebook Like and Send plugin flyout clipping

I am implementing a Facebook application that shown as a tab in a fan page. The application has a product details page that has like, send and comments plugins. The problem is when clicking on the send and like buttons, the flyout dialog (the window…
Koby Mizrahy
  • 1,361
  • 2
  • 12
  • 23
7
votes
2 answers

Frustum plane calculus

I'm writing a simple JavaScript 3D engine from scratch using Canvas and box like primitives (à la Minecraft) for the hell of it. I'm implementing as much optimizations as I can and so far I have back face culling and hidden face occlusion, but I…
Solenoid
  • 2,351
  • 5
  • 29
  • 48
7
votes
3 answers

Prevent UILabel from clipping it's text when the font size is larger than the label height

I have a circumstance in my app whereby a label may be given a font size greater than it's height. This is to do with some rather complex architecture and layout code. Normally I would increase the label's height to accommodate the larger font but…
Jacob King
  • 6,025
  • 4
  • 27
  • 45
7
votes
5 answers

Library for polygon operations

I've recently encountered a need for a library or set of libraries to handle operations on 2D polygons. I need to be able to perform boolean/clipping operations (difference and union) and triangulation. So far the libraries I've found are poly2tri,…
AJM
  • 655
  • 1
  • 9
  • 19
7
votes
1 answer

libGDX - How to clip

I have one SpriteBatch in my game, between whose batch.begin() and batch.end() I draw... a large static background image several game sprites I want to clip the area in which the sprites are seen, which I've read is done using ScissorStack. The…
Bumpy
  • 1,290
  • 1
  • 22
  • 32
7
votes
4 answers

Possible to have anti-aliasing when drawing a clipped image?

Currently, I'm successfully using the Graphics class to draw a non-rectangular clipped image (the turtle inside): My code looks something like: using (var g = Graphics.FromImage(image)) { g.InterpolationMode =…
Uwe Keim
  • 39,551
  • 56
  • 175
  • 291
7
votes
2 answers

Drawing a path with subtracted text using Core Graphics

Creating filled paths in Core Graphics is straight-forward, as is creating filled text. But I am yet to find examples of paths filled EXCEPT for text in a sub-path. My experiments with text drawing modes, clipping etc have got me nowhere. Here's an…
Jaysen Marais
  • 3,956
  • 28
  • 44
1 2
3
44 45