Software: Apache/2.4.41 (Ubuntu). PHP/8.0.30 uname -a: Linux apirnd 5.4.0-204-generic #224-Ubuntu SMP Thu Dec 5 13:38:28 UTC 2024 x86_64 uid=33(www-data) gid=33(www-data) groups=33(www-data) Safe-mode: OFF (not secure) /usr/share/doc/liblqr-1-0-dev/html/ drwxr-xr-x | |
| Viewing file: Select action/file-type: The visibility map can be saved at any moment by calling the function:
This function will return a pointer to a newly allocated
By default, the computed visibility maps are wasted. Instead of saving them individually, it is
possible to automatically dump them at the end of the carving process, attaching them to their
associated
This will have the effect of dumping the visibility map each time
In order to revert the effect of
Alternatively, the internal storage mechanism can be called over the current visibility map at any given moment by calling this function:
The dumped maps are stored inside To access the maps attached to a carver one has first to obtain the pointer to the list, with the function:
Then, one can iterate through the attached maps by using these two functions:
Here is a sample code usage: Example 2.7. Accessing visibility maps #1
LqrVMap *vmap;
LqrVMapList *list;
list = lqr_vmap_list_start (carver);
while (list) {
vmap = lqr_vmap_list_current (list);
/* ... do something on vmap ... */
list = lqr_vmap_list_next (list);
}
The maps will always be accessed in the order in which they were dumped. Alternatively, one can apply a function to all the elements of the list, through this function:
To use this second method, you'll need to define a function first, as in this sample code: Example 2.8. Accessing visibility maps #2
LqrRetVal my_func (LqrVMap vmap, gpointer data)
{
/* ... do something on vmap ... */
return LQR_OK;
}
LqrVMapList *list;
list = lqr_vmap_list_start (carver);
lqr_vmap_list_foreach (list, my_func, NULL);
In the above example, no data is actually passed on to the function. Note
In actual code the call to
The The information can be extracted with these functions: gint*
The first one returns a pointer to the data buffer. The orientation of the map is 0 if the map is to be used for horizontal rescaling, 1 otherwise. The depth of the map is the maximum amount of rescaling possible with that map, either shrinking or enlarging.
Example 2.9. Reading visibility maps data
If we have a
gint *buffer;
gint width;
gint vis;
buffer = lqr_vmap_get_data (vmap);
width = lqr_vmap_get_width (vmap);
vis = buffer[y * width + x];
Uninitialised points will yield
If the orientation is 0, the map allows resizing in the whole range form
Having an
The carver must not to be initialised, neither before nor after invoking this function. Note
This implies that the map cannot be updated, and that it will only be possible to resize the
carver by an amount NoteDo not attach other carvers after you have loaded a visibility map (see also the Attaching extra images section). |
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0225 ]-- |