70 assure (0 <= low && high <= cpl_propertylist_get_size (pl) && low <= high,
71 CPL_ERROR_ILLEGAL_INPUT,
"Illegal range");
77 else if (cpl_propertylist_is_empty (pl)) {
78 xsh_msg (
"[Empty property list]");
81 for (i = low; i < high; i++) {
84 prop = cpl_propertylist_get ((cpl_propertylist *) pl, i);
89 return cpl_error_get_code ();
119 xsh_msg (
"%s =", cpl_property_get_name (prop));
123 check (t = cpl_property_get_type (prop));
125 switch (t & (~CPL_TYPE_FLAG_ARRAY)) {
127 if (t & CPL_TYPE_FLAG_ARRAY) {
128 xsh_msg (
" '%s'", cpl_property_get_string (prop));
132 xsh_msg (
" %c", cpl_property_get_char (prop));
136 if (cpl_property_get_bool (prop)) {
144 xsh_msg (
" %c", cpl_property_get_char (prop));
147 xsh_msg (
" %d", cpl_property_get_int (prop));
150 xsh_msg (
" %d", cpl_property_get_int (prop));
153 xsh_msg (
" %ld", cpl_property_get_long (prop));
156 xsh_msg (
" %ld", cpl_property_get_long (prop));
159 xsh_msg (
" %f", cpl_property_get_float (prop));
161 case CPL_TYPE_DOUBLE:
162 xsh_msg (
" %f", cpl_property_get_double (prop));
164 case CPL_TYPE_POINTER:
167 case CPL_TYPE_INVALID:
171 xsh_msg (
" unrecognized property");
176 if (t & CPL_TYPE_FLAG_ARRAY) {
177 cpl_msg_info(cpl_func,
" (array size = %d" CPL_SIZE_FORMAT
" )",
178 (
int)cpl_property_get_size(prop));
182 if (cpl_property_get_comment (prop) != NULL) {
183 xsh_msg (
" %s", cpl_property_get_comment (prop));
188 return cpl_error_get_code ();
205 if (frames == NULL) {
209 const cpl_frame *f = NULL;
210 cpl_frameset_iterator* it = cpl_frameset_iterator_new(frames);
211 f = cpl_frameset_iterator_get(it);
219 cpl_frameset_iterator_advance(it, 1);
220 f = cpl_frameset_iterator_get_const(it);
225 cpl_frameset_iterator_delete(it);
230 return cpl_error_get_code ();
251 cpl_frame_get_tag (f) != NULL ? cpl_frame_get_tag (f) :
"Null",
252 cpl_frame_get_filename (f));
262 return cpl_error_get_code ();
276 case CPL_FRAME_TYPE_NONE:
279 case CPL_FRAME_TYPE_IMAGE:
282 case CPL_FRAME_TYPE_MATRIX:
285 case CPL_FRAME_TYPE_TABLE:
289 return "unrecognized frame type";
304 case CPL_FRAME_GROUP_NONE:
307 case CPL_FRAME_GROUP_RAW:
308 return CPL_FRAME_GROUP_RAW_ID;
310 case CPL_FRAME_GROUP_CALIB:
311 return CPL_FRAME_GROUP_CALIB_ID;
313 case CPL_FRAME_GROUP_PRODUCT:
314 return CPL_FRAME_GROUP_PRODUCT_ID;
317 return "unrecognized frame group";
333 case CPL_FRAME_LEVEL_NONE:
336 case CPL_FRAME_LEVEL_TEMPORARY:
339 case CPL_FRAME_LEVEL_INTERMEDIATE:
340 return "INTERMEDIATE";
342 case CPL_FRAME_LEVEL_FINAL:
346 return "unrecognized frame level";
365 if (!(t & CPL_TYPE_FLAG_ARRAY))
366 switch (t & (~CPL_TYPE_FLAG_ARRAY)) {
391 case CPL_TYPE_DOUBLE:
394 case CPL_TYPE_POINTER:
398 case CPL_TYPE_INVALID:
402 return "unrecognized type";
405 switch (t & (~CPL_TYPE_FLAG_ARRAY)) {
407 return "string (char array)";
410 return "uchar array";
413 return "boolean array";
425 return "ulong array";
428 return "float array";
430 case CPL_TYPE_DOUBLE:
431 return "double array";
433 case CPL_TYPE_POINTER:
434 return "pointer array";
437 case CPL_TYPE_INVALID:
438 return "invalid (array)";
441 return "unrecognized type";
const char * xsh_tostring_cpl_frame_group(cpl_frame_group fg)
Convert a frame group to a string.
cpl_error_code xsh_print_cpl_frameset(cpl_frameset *frames)
Print a frame set.
const char * xsh_tostring_cpl_type(cpl_type t)
Convert a CPL type to a string.
cpl_error_code xsh_print_cpl_property(const cpl_property *prop)
Print a property.
cpl_error_code xsh_print_cpl_propertylist(const cpl_propertylist *pl, long low, long high)
Print a property list.
const char * xsh_tostring_cpl_frame_level(cpl_frame_level fl)
Convert a frame level to a string.
cpl_error_code xsh_print_cpl_frame(const cpl_frame *f)
Print a frame.
const char * xsh_tostring_cpl_frame_type(cpl_frame_type ft)
Convert a frame type to a string.
#define assure(CONDITION, ERROR_CODE,...)
#define xsh_msg(...)
Print a message on info level.
#define xsh_msg_dbg_low(...)