image_clip_on(3)
π image_clip_on(3) β like, the Arcan Lua API one, bestie
okay so real talk, this is a page from the Arcan Lua API manual and it's all about telling a video object how to clip. it's giving "boundaries, but make it graphics" π
β¨ NAME β¨
image_clip_on β literally just controlling clipping for a video object. that's the whole gig. π
πΈ SYNOPSIS πΈ
nil
image_clip_on( vid:image )
image_clip_on( vid:image, int:mode )
image_clip_on( vid:image, int:mode=CLIP_SHALLOW, vid:cliptgt )
π¦ DESCRIPTION π¦
so this one changes the clipping mode for whatever video object image is pointing at. easy. π«Ά
by default the mode is CLIP_ON, and ngl bestie, that's the expensive one β it's the main character, it costs more π. it uses a stencil buffer to draw the entire hierarchy that you built with link_image. so if you've got a complex hierarchy with possibly rotated objects in it? this is the one for you, it eats. π₯
your other option is CLIP_SHALLOW. this one only uses the immediate parent, and it gets a fast-path assuming that both objects are rotated β because that whole situation can be solved by adjusting object size and texture coordinates alone. no stencil buffer drama, just vibes. β
now, if a cliptgt is provided along with the CLIP_SHALLOW clipping mode, then a specific object gets used for calculating the clipping bounds instead of using the one that link_image specified. obsessed, honestly. π this is useful when you need a transform hierarchy, but with specific clipping anchors. iykyk. π
π NOTES π
- if a clip target is set to a non-existing or otherwise bad object, or it becomes invalid through deletion, clipping will revert to the image parent as if no clip target had been specified. so likeβ¦ it snaps back, no cap. π
π EXAMPLE π
function image_clip_on0()
a = fill_surface(64, 64, 255, 0, 0);
b = fill_surface(64, 64, 0, 255, 0);
link_image(b, a);
move_image(b, 32, 32);
show_image({a,b});
image_clip_on(b, CLIP_SHALLOW);
end
look at her go π two 64Γ64 surfaces, one linked to the other, one moved to 32, 32, both shown, then image_clip_on(b, CLIP_SHALLOW) β iconic, no notes. π
π MISUSE π
function image_clip_on0()
image_clip_on(BADID);
end
yeah. don't do this one. that's a BADID, bestie, not a valid image. we do not pass garbage ids, periodt. π
ββοΈ
π«Ά SEE ALSO π«Ά
image_clip_off(3)β the other half of the clipping saga, go read her too π
and that's the whole page, mwah π β brought to you by the image manual, October 2026 edition, image_clip_on(3). slay, go clip something. β¨π§
π¦ where this page comes from
- nixos 26.05: arcan 0.7.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms