vispy.visuals.filters.clipper module

class vispy.visuals.filters.clipper.Clipper(bounds=(0, 0, 1, 1), transform=None)

Bases: vispy.visuals.filters.base_filter.Filter

Clips visual output to a rectangular region.

FRAG_SHADER = '\n        void clip() {\n            vec4 pos = $fb_to_clip(gl_FragCoord);\n            if( pos.x < $view.x || pos.x > $view.y ||\n                pos.y < $view.z || pos.y > $view.w ) {\n                discard;\n            }\n        }\n    '
property bounds

The clipping boundaries.

This must be a tuple (x, y, w, h) in a clipping coordinate system that is defined by the transform property.

property transform

The transform that maps from framebuffer coordinates to clipping coordinates.