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: Once you have rescaled the image, you can read out the result through the functions:
or
Here,
The return value is
Each time these functions are invoked, they will store the coordinates and rgb information in the
output pointers and move to the next pixel. If they reach the end, they reset the reader and return
Here is a sample code usage: Example 2.1. A simple readout example
gint x, y;
guchar *rgb;
while (lqr_carver_scan (carver, &x, &y, &rgb) {
my_plot (x, y, rgb[0], rgb[1], rgb[2]);
}
The same readout example with different colour depth would read like this: Example 2.2. A simple readout example - extended version
gint x, y;
void *rgb;
gdouble *rgb_out;
while (lqr_carver_scan (carver, &x, &y, &rgb) {
rgb_out = (gdouble*) rgb;
my_plot (x, y, rgb_out[0], rgb_out[1], rgb_out[2]);
}
Important
The The image can also be read one line at a time, but it is not possible to freely decide if it is to be read by row or by column. Instead, this has to be queried by calling this function:
The function returns Then, the image can be read through these functions:
or
These functions work exactly the same way as Here is a sample code usage for the standard 8-bit case: Example 2.3. Line-by-line readout example
gint n;
guchar *rgb;
gboolean by_row;
by_row = lqr_carver_scan_by_row (carver);
while (lqr_carver_scan_line (carver, &n, &rgb) {
by_row ? my_plot_row (n, rgb) : my_plot_col (n, rgb);
}
The extended version for images with more colour depth is very similar, it only requires an additional cast: Example 2.4. Line-by-line readout example - extended version
gint n;
void *rgb;
guchar *rgb_out;
gboolean by_row;
by_row = lqr_carver_scan_by_row (carver);
while (lqr_carver_scan_line_ext (carver, &n, &rgb) {
rgb_out = (gboolean*) rgb;
by_row ? my_plot_row (n, rgb_out) : my_plot_col (n, rgb_out);
}
|
:: Command execute :: | |
--[ c99shell v. 2.5 [PHP 8 Update] [24.05.2025] | Generation time: 0.0049 ]-- |