caca_dirty(3caca)
πΈ NAME πΈ
Okay bestie, welcome to the caca_dirty page from the libcaca manual β itβs literally all about dirty rectangle manipulation in libcaca. π
β¨ SYNOPSIS β¨
π Topics
- libcaca canvas transformation
π§ Functions
caca_disable_dirty_rectβ Disable dirty rectangles.
__extern int caca_disable_dirty_rect (caca_canvas_t *)
caca_enable_dirty_rectβ Enable dirty rectangles.
__extern int caca_enable_dirty_rect (caca_canvas_t *)
caca_get_dirty_rect_countβ Get the number of dirty rectangles in the canvas.
__extern int caca_get_dirty_rect_count (caca_canvas_t *)
caca_get_dirty_rectβ Get a canvas's dirty rectangle.
__extern int caca_get_dirty_rect (caca_canvas_t *, int, int *, int *,
int *, int *)
caca_add_dirty_rectβ Add an area to the canvas's dirty rectangle list.
__extern int caca_add_dirty_rect (caca_canvas_t *, int, int, int, int)
caca_remove_dirty_rectβ Remove an area from the dirty rectangle list.
__extern int caca_remove_dirty_rect (caca_canvas_t *, int, int, int,
int)
caca_clear_dirty_rect_listβ Clear a canvas's dirty rectangle list.
__extern int caca_clear_dirty_rect_list (caca_canvas_t *)
π« Detailed Description π«
These functions manipulate dirty rectangles for optimised blitting. Periodt. π
π§ Function Documentation π§
π caca_disable_dirty_rect
__extern int caca_disable_dirty_rect (caca_canvas_t * cv)
Disable dirty rectangle handling for all libcaca graphic calls. This is handy when the calling application needs to do slow operations within a known area. Just call caca_add_dirty_rect() afterwards. π«Ά
This function is recursive. Dirty rectangles are only reenabled when caca_enable_dirty_rect() is called as many times.
This function never fails. No cap.
Parameters
cvβ A libcaca canvas.
Returns
This function always returns 0.
π caca_enable_dirty_rect
__extern int caca_enable_dirty_rect (caca_canvas_t * cv)
This function can only be called after caca_disable_dirty_rect() was called.
If an error occurs, -1 is returned and errno is set accordingly:
EINVALβ Dirty rectangles were not disabled.
Parameters
cvβ A libcaca canvas.
Returns
0 in case of success, -1 if an error occurred.
π¦ caca_get_dirty_rect_count
__extern int caca_get_dirty_rect_count (caca_canvas_t * cv)
Get the number of dirty rectangles in a canvas. Dirty rectangles are areas that contain cells that have changed since the last reset. β¨
The dirty rectangles are used internally by display drivers to optimise rendering by avoiding to redraw the whole screen. Once the display driver has rendered the canvas, it resets the dirty rectangle list.
Dirty rectangles are guaranteed not to overlap. π
This function never fails.
Parameters
cvβ A libcaca canvas.
Returns
The number of dirty rectangles in the given canvas.
π caca_get_dirty_rect
__extern int caca_get_dirty_rect (caca_canvas_t * cv, int r, int * x, int *
y, int * width, int * height)
Get the canvas's given dirty rectangle coordinates. The index must be within the dirty rectangle count. See caca_get_dirty_rect_count() for how to compute this count. π
If an error occurs, no coordinates are written in the pointer arguments, -1 is returned and errno is set accordingly:
EINVALβ Specified rectangle index is out of bounds.
Parameters
cvβ A libcaca canvas.rβ The requested rectangle index.xβ A pointer to an integer where the leftmost edge of the dirty rectangle will be stored.yβ A pointer to an integer where the topmost edge of the dirty rectangle will be stored.widthβ A pointer to an integer where the width of the dirty rectangle will be stored.heightβ A pointer to an integer where the height of the dirty rectangle will be stored.
Returns
0 in case of success, -1 if an error occurred.
π₯ caca_add_dirty_rect
__extern int caca_add_dirty_rect (caca_canvas_t * cv, int x, int y, int
width, int height)
Add an invalidating zone to the canvas's dirty rectangle list. For more information about the dirty rectangles, see caca_get_dirty_rect().
This function may be useful to force refresh of a given zone of the canvas even if the dirty rectangle tracking indicates that it is unchanged. This may happen if the canvas contents were somewhat directly modified. π
If an error occurs, -1 is returned and errno is set accordingly:
EINVALβ Specified rectangle coordinates are out of bounds.
Parameters
cvβ A libcaca canvas.xβ The leftmost edge of the additional dirty rectangle.yβ The topmost edge of the additional dirty rectangle.widthβ The width of the additional dirty rectangle.heightβ The height of the additional dirty rectangle.
Returns
0 in case of success, -1 if an error occurred.
Referenced by caca_blit(), caca_clear_canvas(), caca_fill_box(), caca_flip(), caca_flop(), caca_free_frame(), caca_invert(), caca_put_attr(), caca_put_char(), caca_rotate_180(), caca_rotate_left(), caca_rotate_right(), caca_set_canvas_boundaries(), caca_set_frame(), caca_stretch_left(), and caca_stretch_right().
π§ caca_remove_dirty_rect
__extern int caca_remove_dirty_rect (caca_canvas_t * cv, int x, int y, int
width, int height)
Mark a cell area in the canvas as not dirty. For more information about the dirty rectangles, see caca_get_dirty_rect().
Values such that xmin > xmax or ymin > ymax indicate that the dirty rectangle is empty. They will be silently ignored.
If an error occurs, -1 is returned and errno is set accordingly:
EINVALβ Specified rectangle coordinates are out of bounds.
Parameters
cvβ A libcaca canvas.xβ The leftmost edge of the clean rectangle.yβ The topmost edge of the clean rectangle.widthβ The width of the clean rectangle.heightβ The height of the clean rectangle.
Returns
0 in case of success, -1 if an error occurred.
π caca_clear_dirty_rect_list
__extern int caca_clear_dirty_rect_list (caca_canvas_t * cv)
Empty the canvas's dirty rectangle list. Itβs giving clean slate energy. β¨
This function never fails.
Parameters
cvβ A libcaca canvas.
Returns
This function always returns 0.
Referenced by caca_refresh_display().
π Author π
Generated automatically by Doxygen for libcaca from the source code.
Version 0.99.beta20 Β· Wed May 13 2026 09:45:08 β thatβs the source/version and date, bestie. Mwah πβ¨
π¦ where this page comes from
- opensuse-leap 16.0: libcaca-devel 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: libcaca-devel 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: libcaca-devel 0.99.beta20-160000.3.1 Β· WTFPL
- opensuse-leap 16.0: libcaca-devel 0.99.beta20-160000.3.1 Β· WTFPL
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms