int id,
int luma,
int chroma,
- int alpha)
+ int alpha,
+ const char *doc)
{
Babl *babl;
babl->class_type = BABL_COMPONENT;
babl->instance.id = id;
+ babl->instance.doc = doc;
babl->component.luma = luma;
babl->component.chroma = chroma;
babl->component.alpha = alpha;
int alpha = 0;
const char *name = first_arg;
const char *arg;
+ const char *doc = NULL;
va_start (varg, first_arg);
{
id = va_arg (varg, int);
}
+ else if (!strcmp (arg, "doc"))
+ {
+ doc = va_arg (varg, const char *);
+ }
else if (!strcmp (arg, "luma"))
{
return babl;
}
- babl = component_new (name, id, luma, chroma, alpha);
+ babl = component_new (name, id, luma, chroma, alpha, doc);
/* Since there is not an already registered instance by the required
* id/name, inserting newly created class into database.
{
babl_model_new (
"id", BABL_YCBCR,
+ "doc", "Y'CbCr video format model, NB! math is tuned to sRGB space",
babl_component_from_id (BABL_GRAY_NONLINEAR),
babl_component_from_id (BABL_CB),
babl_component_from_id (BABL_CR),
babl_model_new (
"id", BABL_YCBCR_ALPHA,
+ "doc", "Y'CbCr video format model, separate alpha NB! math is tuned to sRGB space",
babl_component_from_id (BABL_GRAY_NONLINEAR),
babl_component_from_id (BABL_CB),
babl_component_from_id (BABL_CR),
body {
margin: 0;
padding: 0;
+ font-size: 14pt;
}
div.paper {
background-color: #fff;
span.NULL {
color: #555;
}
+ tt { font-size: 110%; }
pre.authors {
font-size: 100%;
font-family: FreeSans, Verdana, sans-serif;
}
}
-.item_title { font-weight: bold; margin-top: 1.5em; margin-bottom: 0.6em;
+.item_title { font-weight: bold; margin-top: 2.5em; margin-bottom: 0.6em;
}
static void
components (void)
{
- babl_component_new ("CIE L", NULL);
- babl_component_new ("CIE a", "chroma", NULL);
- babl_component_new ("CIE b", "chroma", NULL);
- babl_component_new ("CIE C(ab)", "chroma", NULL);
- babl_component_new ("CIE H(ab)", "chroma", NULL);
+ babl_component_new ("CIE L", "doc", "Luminance, range 0.0-100.0 in float", NULL);
+ babl_component_new ("CIE a", "chroma", "doc", "chroma component 0.0 is no saturation", NULL);
+ babl_component_new ("CIE b", "chroma", "doc", "chroma component 0.0 is no saturation", NULL);
+ babl_component_new ("CIE C(ab)", "chroma", "doc", "chrominance/saturation", NULL);
+ babl_component_new ("CIE H(ab)", "chroma", "doc", "hue value range 0.0-360.0", NULL);
babl_component_new ("CIE X", NULL);
babl_component_new ("CIE Y", NULL);
babl_component_new ("CIE Z", NULL);
{
babl_model_new (
"name", "CIE Lab",
+ "doc", "CIE Lab color model, a perceptually uniform space, euclidian distance in this space represents delta E.",
babl_component ("CIE L"),
babl_component ("CIE a"),
babl_component ("CIE b"),
babl_model_new (
"name", "CIE Lab alpha",
+ "doc", "CIE Lab color model, with separate alpha",
babl_component ("CIE L"),
babl_component ("CIE a"),
babl_component ("CIE b"),
babl_model_new (
"name", "CIE LCH(ab)",
+ "doc", "CIE LCH color model, using cylindrical coordinates",
babl_component ("CIE L"),
babl_component ("CIE C(ab)"),
babl_component ("CIE H(ab)"),
babl_model_new (
"name", "CIE LCH(ab) alpha",
+ "doc", "CIE LCH color model, using cylindrical coordinates, with separate alpha",
babl_component ("CIE L"),
babl_component ("CIE C(ab)"),
babl_component ("CIE H(ab)"),
{
babl_init ();
- printf ("<div class='expander'>");
- printf ("<div class='expander_title'><a style='font-size:110%%' name='Data-types' href='javascript:toggle_visible(\"x_types\")'>Data types</a></div><div class='expander_content' id='x_types'>\n");
+ printf ("<div>");
+ printf ("<h3>Types</h3>");
babl_type_class_for_each (each_item, NULL);
printf ("</div>\n");
- printf ("</div>\n");
- printf ("<div class='expander'>");
- printf ("<div class='expander_title'><a style='font-size:110%%' name='Color-models' href='javascript:toggle_visible(\"x_models\")'>Color models</a></div><div class='expander_content' id='x_models'>\n");
+ printf ("<div>");
+ printf ("<h3>Models</h3>");
babl_model_class_for_each (each_item, NULL);
printf ("</div>\n");
- printf ("</div>\n");
- printf ("<div class='expander'>");
- printf ("<div class='expander_title'><a style='font-size:110%%' name='Pixel-formats' href='javascript:toggle_visible(\"x_formats\")'>Pixel formats</a></div><div class='expander_content' id='x_formats'>\n");
+ printf ("<div>");
+ printf ("<h3>Pixelformats</h3>");
babl_format_class_for_each (each_item, NULL);
printf ("</div>\n");
- printf ("</div>\n");
/*
printf ("<div class='expander'>");
each_item (Babl *babl,
void *user_data)
{
- printf ("<div><div class='item_title'><a href='#%s', name='%s'>%s</a></div>\n",
+ const char *fun_pre = "babl_type";
+ const char *fun_post = ")";
+
+ switch (babl->class_type)
+ {
+ case BABL_MODEL: fun_pre = "babl_model"; break;
+ case BABL_FORMAT: fun_pre = "babl_format_with_space";
+ fun_post = ", space|NULL)";
+ break;
+ }
+
+ printf ("<div><div class='item_title'><a href='#%s', name='%s'><tt>%s (\"%s\"%s</tt></a></div>\n",
normalize (babl->instance.name),
normalize (babl->instance.name),
- babl->instance.name);
+ fun_pre,
+ babl->instance.name,
+ fun_post);
printf ("<div class='item_body'>");
printf ("%s", babl->instance.doc);
else
{
+ BablModelFlag flags = babl_get_model_flags (babl);
+ if (flags & BABL_MODEL_FLAG_RGB)
+ printf ("RGB");
+ else if (flags & BABL_MODEL_FLAG_GRAY)
+ printf ("Grayscale");
+ else if (flags & BABL_MODEL_FLAG_CMYK)
+ {
+ if (flags & BABL_MODEL_FLAG_INVERTED)
+ printf ("CMYK with inverted color components (0.0=full coverage), for additive compositing");
+ else
+ printf ("CMYK");
+ }
+
+ if (flags & BABL_MODEL_FLAG_LINEAR)
+ printf (" linear");
+ if (flags & BABL_MODEL_FLAG_NONLINEAR)
+ printf (" with TRC from space");
+ if (flags & BABL_MODEL_FLAG_PERCEPTUAL)
+ printf (" with perceptual (sRGB) TRC");
+
+ if (flags & BABL_MODEL_FLAG_ALPHA)
+ {
+ if (flags & BABL_MODEL_FLAG_ASSOCIATED)
+ {
+ printf (", associated alpha");
+ }
+ else
+ {
+ printf (", separate alpha");
+ }
+ }
+
}
}
printf ("%s", babl->instance.doc);
else
{
- const Babl *type = BABL (babl->format.type[0]);
+ //const Babl *type = BABL (babl->format.type[0]);
model_doc (model);
- if (type->instance.doc)
- printf (" %s", type->instance.doc);
- else
- printf (" %s", type->instance.name);
+ //if (type->instance.doc)
+ // printf (" %s", type->instance.doc);
+ //else
+ // printf (" %s", type->instance.name);
}
printf ("</p>");