[babl] add some half-float based formats
- From: Ãyvind KolÃs <ok src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [babl] add some half-float based formats
- Date: Wed, 25 Apr 2012 23:18:10 +0000 (UTC)
commit bba8cef11bc6d8dc332369caadd5950db5630f0e
Author: Ãyvind KolÃs <pippin gimp org>
Date: Thu Apr 26 01:07:00 2012 +0200
add some half-float based formats
babl/babl-ids.h | 4 +++
babl/base/model-gray.c | 46 ++++++++++++++++++++++++++++++++++++++++
babl/base/model-rgb.c | 54 ++++++++++++++++++++++++++++++++++++++++++++++++
3 files changed, 104 insertions(+), 0 deletions(-)
---
diff --git a/babl/babl-ids.h b/babl/babl-ids.h
index 47b5aa5..a42d09b 100644
--- a/babl/babl-ids.h
+++ b/babl/babl-ids.h
@@ -91,6 +91,8 @@ enum {
BABL_FORMAT_BASE = 100000,
BABL_SRGB,
BABL_SRGBA,
+ BABL_RGB_HALF,
+ BABL_RGBA_HALF,
BABL_RGB_FLOAT,
BABL_RGBA_FLOAT,
BABL_RGBA_DOUBLE,
@@ -100,8 +102,10 @@ enum {
BABL_RGB_U8,
BABL_RGBA_U8,
BABL_RGBA_U16,
+ BABL_CMYK_HALF,
BABL_CMYK_FLOAT,
BABL_CMYK_ALPHA_FLOAT,
+ BABL_CMYK_ALPHA_HALF,
BABL_YCBCR411,
BABL_YCBCR422,
BABL_YCBCR420,
diff --git a/babl/base/model-gray.c b/babl/base/model-gray.c
index 5582c78..1101393 100644
--- a/babl/base/model-gray.c
+++ b/babl/base/model-gray.c
@@ -30,12 +30,14 @@
static void components (void);
static void models (void);
static void conversions (void);
+static void formats (void);
void babl_base_model_gray (void)
{
components ();
models ();
conversions ();
+ formats ();
}
static void
@@ -585,3 +587,47 @@ conversions (void)
NULL
);
}
+
+static void
+formats (void)
+{
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY_ALPHA),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMINANCE),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY_ALPHA_PREMULTIPLIED),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMINANCE_MUL_ALPHA),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMINANCE),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMA),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY_GAMMA_2_2_ALPHA_PREMULTIPLIED),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMA_MUL_ALPHA),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_GRAY_GAMMA_2_2),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_LUMA),
+ NULL);
+}
diff --git a/babl/base/model-rgb.c b/babl/base/model-rgb.c
index df7f7b0..0f4e751 100644
--- a/babl/base/model-rgb.c
+++ b/babl/base/model-rgb.c
@@ -516,6 +516,60 @@ formats (void)
babl_component_from_id (BABL_BLUE),
NULL);
+ babl_format_new (
+ "id", BABL_RGB_HALF,
+ babl_model_from_id (BABL_RGB),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED),
+ babl_component_from_id (BABL_GREEN),
+ babl_component_from_id (BABL_BLUE),
+ NULL);
+
+ babl_format_new (
+ "id", BABL_RGBA_HALF,
+ babl_model_from_id (BABL_RGBA),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED),
+ babl_component_from_id (BABL_GREEN),
+ babl_component_from_id (BABL_BLUE),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_RGBA_PREMULTIPLIED),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED_MUL_ALPHA),
+ babl_component_from_id (BABL_GREEN_MUL_ALPHA),
+ babl_component_from_id (BABL_BLUE_MUL_ALPHA),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_RGB_GAMMA_2_2),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED_GAMMA_2_2),
+ babl_component_from_id (BABL_GREEN_GAMMA_2_2),
+ babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_RGBA_GAMMA_2_2),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED_GAMMA_2_2),
+ babl_component_from_id (BABL_GREEN_GAMMA_2_2),
+ babl_component_from_id (BABL_BLUE_GAMMA_2_2),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
+ babl_format_new (
+ babl_model_from_id (BABL_RGBA_GAMMA_2_2_PREMULTIPLIED),
+ babl_type_from_id (BABL_HALF),
+ babl_component_from_id (BABL_RED_GAMMA_2_2_MUL_ALPHA),
+ babl_component_from_id (BABL_GREEN_GAMMA_2_2_MUL_ALPHA),
+ babl_component_from_id (BABL_BLUE_GAMMA_2_2_MUL_ALPHA),
+ babl_component_from_id (BABL_ALPHA),
+ NULL);
+
#ifdef XXXX
babl_format_new (
"id", BABL_RGB565,
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]