[babl] palette: return the BablModel created
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] palette: return the BablModel created
- Date: Mon, 19 Mar 2012 15:34:37 +0000 (UTC)
commit a8101cab0f51d2b1aa486b3723f5f5606645a9d6
Author: Ãyvind KolÃs <pippin gimp org>
Date: Mon Mar 19 15:24:36 2012 +0000
palette: return the BablModel created
babl/babl-palette.c | 8 +++++---
babl/babl.h | 8 +++++---
2 files changed, 10 insertions(+), 6 deletions(-)
---
diff --git a/babl/babl-palette.c b/babl/babl-palette.c
index 961e52a..4655211 100644
--- a/babl/babl-palette.c
+++ b/babl/babl-palette.c
@@ -1,5 +1,5 @@
/* babl - dynamically extendable universal pixel conversion library.
- * Copyright (C) 2005, Ãyvind KolÃs.
+ * Copyright (C) 2012, Ãyvind KolÃs.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -449,8 +449,9 @@ conv_pala8_pal8 (unsigned char *src, unsigned char *dst, long samples)
/* should return the BablModel, permitting to fetch
* other formats out of it?
*/
-void babl_new_palette (const char *name, const Babl **format_u8,
- const Babl **format_u8_with_alpha)
+const Babl *babl_new_palette (const char *name,
+ const Babl **format_u8,
+ const Babl **format_u8_with_alpha)
{
const Babl *model;
const Babl *model_no_alpha;
@@ -579,6 +580,7 @@ void babl_new_palette (const char *name, const Babl **format_u8,
if (format_u8_with_alpha)
*format_u8_with_alpha = f_pal_a_u8;
babl_sanity ();
+ return model;
}
void
diff --git a/babl/babl.h b/babl/babl.h
index be629a2..019b7b9 100644
--- a/babl/babl.h
+++ b/babl/babl.h
@@ -200,13 +200,15 @@ int babl_format_is_format_n (const Babl *format);
const Babl * babl_conversion_new (const void *first_arg,
...) BABL_ARG_NULL_TERMINATED;
+
/**
* create a new palette based format, name is optional pass in NULL to get
* an anonymous format. If you pass in with_alpha the format also gets
- * an 8bit alpha channel.
+ * an 8bit alpha channel. Returns the BablModel of the color model.
*/
-void babl_new_palette (const char *name, const Babl **format_u8,
- const Babl **format_u8_with_alpha);
+const Babl *babl_new_palette (const char *name,
+ const Babl **format_u8,
+ const Babl **format_u8_with_alpha);
/**
* Assign a palette to a palette format, the data is a single span of pixels
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]