[babl] docs: fixed example code in index-static.html.in



commit 95345a2afadc9df4eb7bc55f8f1c76e128e8b32f
Author: Rupert Weber <rpwh gmx de>
Date:   Wed Sep 1 18:16:10 2010 +0200

    docs: fixed example code in index-static.html.in
    
    added babl_init(), fish can't be const, Babl* can't be dereferenced,
    one variable name changed during example, added sizeof to make it
    a little more obvious.

 docs/index-static.html.in |   10 ++++++----
 1 files changed, 6 insertions(+), 4 deletions(-)
---
diff --git a/docs/index-static.html.in b/docs/index-static.html.in
index af6ab13..9127121 100644
--- a/docs/index-static.html.in
+++ b/docs/index-static.html.in
@@ -220,17 +220,19 @@ int width = 123, height = 581, pixel_count = width * height;
 
 const Babl *srgb            = <span class='function'>babl_format</span> <span class='paren'>(</span><span class='string'>"R'G'B' u8"</span><span class='paren'>)</span>;
 const Babl *lab             = <span class='function'>babl_format</span> <span class='paren'>(</span><span class='string'>"CIE Lab float"</span><span class='paren'>)</span>;
-const Babl *rgb_to_lab_fish = <span class='function'>babl_fish</span> <span class='paren'>(</span>srgb, lab);
+Babl       *rgb_to_lab_fish = <span class='function'>babl_fish</span> <span class='paren'>(</span>srgb, lab);
 
 float         *lab_buffer;
 unsigned char *srgb_buffer;
 
-srgb_buffer = malloc (pixel_count * srgb-&gt;format.bytes_per_pixel);
-lab_buffer  = malloc (pixel_count * 3 * 4);
+babl_init <span class='paren'>()</span>;
+
+srgb_buffer = malloc (pixel_count * babl_format_get_bytes_per_pixel (srgb));
+lab_buffer  = malloc (pixel_count * 3 * sizeof (float));
 
 ...... load data into srgb_buffer .......
 
-<span class='function'>babl_process</span> <span class='paren'>(</span>bablfish, srgb_buffer, lab_buffer, pixel_count<span class='paren'>);</span>
+<span class='function'>babl_process</span> <span class='paren'>(</span>rgb_to_lab_fish, srgb_buffer, lab_buffer, pixel_count<span class='paren'>);</span>
 
 ...... do operation in lab space ........
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]