[babl] babl: make babl_model_get_flags also accept format
- From: Øyvind "pippin" Kolås <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] babl: make babl_model_get_flags also accept format
- Date: Sun, 2 Dec 2018 22:50:36 +0000 (UTC)
commit f209577b9b493c13be0b862e91b85cf7f655e495
Author: Øyvind Kolås <pippin gimp org>
Date: Sun Dec 2 23:47:14 2018 +0100
babl: make babl_model_get_flags also accept format
perhaps it should be renamed to babl_get_model_flags since it
now operates more generically on babl pointers, it could also
work on bablimage.
babl/babl-model.c | 13 ++++++++++---
1 file changed, 10 insertions(+), 3 deletions(-)
---
diff --git a/babl/babl-model.c b/babl/babl-model.c
index 0eae215..768d451 100644
--- a/babl/babl-model.c
+++ b/babl/babl-model.c
@@ -463,9 +463,16 @@ babl_model_with_space (const char *name, const Babl *space)
return babl_remodel_with_space (babl_model (name), space);
}
-BablModelFlag babl_model_get_flags (const Babl *model)
+BablModelFlag babl_model_get_flags (const Babl *babl)
{
- if (!model) return 0;
- return model->model.flags;
+ if (!babl) return 0;
+ switch (babl->class_type)
+ {
+ case BABL_MODEL:
+ return babl->model.flags;
+ case BABL_FORMAT:
+ return babl->format.model->flags;
+ }
+ return 0;
}
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]