v4l2_rect_intersect(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 of r1 and r2 gets 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 with r1 she'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:

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