v4l2_rect_intersect(9)
π v4l2_rect_intersect β the Kernel API Manual page you didn't know you needed
okay so bestie, picture this: you're deep in the Kernel API Manual, right, in the ./include/media section, and you've got two rectangles and a dream. This function is literally the matchmaker. It takes two rects and computes the intersection β the overlap, the shared little zone where they both vibe. π«Ά
β¨ NAME β¨
v4l2_rect_intersect β calculate the intersection of two rects. that's it. that's the whole job. iconic, honestly. π
π¦ SYNOPSIS π¦
void v4l2_rect_intersect (struct v4l2_rect *r , const struct v4l2_rect
*r1 , const struct v4l2_rect *r2 );
no cap, that's the exact signature β copy it character for character or the compiler WILL be mean to you. π
π ARGUMENTS π
rβ the output, bestie! this is where the intersection ofr1andr2gets dropped. she's the main character here, receiving all the info. πr1β a rectangle. yes, just a rectangle. that's the whole description and honestly? respect. π§r2β a rectangle. the second rectangle. together withr1she's finding the overlap. π¦
ngl the kernel docs being like "rectangle" and nothing else is giving minimalism and I kind of live for it π
π SEE ALSO π
okay so there's a whole friend group here, all hanging out in the kernel file ./include/media/v4l2-rect.h. go say hi:
v4l2_rect_set_size_to(9)v4l2_rect_set_min_size(9)v4l2_rect_set_max_size(9)v4l2_rect_map_inside(9)v4l2_rect_same_size(9)v4l2_rect_same_position(9)v4l2_rect_equal(9)v4l2_rect_scale(9)v4l2_rect_overlap(9)v4l2_rect_enclosed(9)
that's a full squad, fr fr β size stuff, position stuff, equality, scaling, overlap, enclosure. the rect cinematic universe β¨
and that's a wrap, bestie!! π ππ¦
little sign-off moment: this page lives under ./include/media in the Kernel API Manual, dated October 2026, and it's filed as v4l2_rect_intersect(9). go intersect some rects, you absolute legend. ππΈ
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms