1<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 2<html> 3<head> 4<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"> 5<title>GstVideoDither: GStreamer Base Plugins 1.0 Library Reference Manual</title> 6<meta name="generator" content="DocBook XSL Stylesheets V1.79.1"> 7<link rel="home" href="index.html" title="GStreamer Base Plugins 1.0 Library Reference Manual"> 8<link rel="up" href="gstreamer-video.html" title="Video Library"> 9<link rel="prev" href="GstVideoFilter.html" title="GstVideoFilter"> 10<link rel="next" href="gst-plugins-base-libs-GstVideoChroma.html" title="GstVideoChromaResample"> 11<meta name="generator" content="GTK-Doc V1.28 (XML mode)"> 12<link rel="stylesheet" href="style.css" type="text/css"> 13</head> 14<body bgcolor="white" text="black" link="#0000FF" vlink="#840084" alink="#0000FF"> 15<table class="navigation" id="top" width="100%" summary="Navigation header" cellpadding="2" cellspacing="5"><tr valign="middle"> 16<td width="100%" align="left" class="shortcuts"> 17<a href="#" class="shortcut">Top</a><span id="nav_description"> <span class="dim">|</span> 18 <a href="#gst-plugins-base-libs-GstVideoDither.description" class="shortcut">Description</a></span> 19</td> 20<td><a accesskey="h" href="index.html"><img src="home.png" width="16" height="16" border="0" alt="Home"></a></td> 21<td><a accesskey="u" href="gstreamer-video.html"><img src="up.png" width="16" height="16" border="0" alt="Up"></a></td> 22<td><a accesskey="p" href="GstVideoFilter.html"><img src="left.png" width="16" height="16" border="0" alt="Prev"></a></td> 23<td><a accesskey="n" href="gst-plugins-base-libs-GstVideoChroma.html"><img src="right.png" width="16" height="16" border="0" alt="Next"></a></td> 24</tr></table> 25<div class="refentry"> 26<a name="gst-plugins-base-libs-GstVideoDither"></a><div class="titlepage"></div> 27<div class="refnamediv"><table width="100%"><tr> 28<td valign="top"> 29<h2><span class="refentrytitle"><a name="gst-plugins-base-libs-GstVideoDither.top_of_page"></a>GstVideoDither</span></h2> 30<p>GstVideoDither — Utility object for dithering and quantizing lines of video</p> 31</td> 32<td class="gallery_image" valign="top" align="right"></td> 33</tr></table></div> 34<div class="refsect1"> 35<a name="gst-plugins-base-libs-GstVideoDither.functions"></a><h2>Functions</h2> 36<div class="informaltable"><table class="informaltable" width="100%" border="0"> 37<colgroup> 38<col width="150px" class="functions_return"> 39<col class="functions_name"> 40</colgroup> 41<tbody> 42<tr> 43<td class="function_type"> 44<span class="returnvalue">void</span> 45</td> 46<td class="function_name"> 47<a class="link" href="gst-plugins-base-libs-GstVideoDither.html#gst-video-dither-free" title="gst_video_dither_free ()">gst_video_dither_free</a> <span class="c_punctuation">()</span> 48</td> 49</tr> 50<tr> 51<td class="function_type"> 52<span class="returnvalue">void</span> 53</td> 54<td class="function_name"> 55<a class="link" href="gst-plugins-base-libs-GstVideoDither.html#gst-video-dither-line" title="gst_video_dither_line ()">gst_video_dither_line</a> <span class="c_punctuation">()</span> 56</td> 57</tr> 58<tr> 59<td class="function_type"> 60<a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="returnvalue">GstVideoDither</span></a> * 61</td> 62<td class="function_name"> 63<a class="link" href="gst-plugins-base-libs-GstVideoDither.html#gst-video-dither-new" title="gst_video_dither_new ()">gst_video_dither_new</a> <span class="c_punctuation">()</span> 64</td> 65</tr> 66</tbody> 67</table></div> 68</div> 69<div class="refsect1"> 70<a name="gst-plugins-base-libs-GstVideoDither.other"></a><h2>Types and Values</h2> 71<div class="informaltable"><table class="informaltable" width="100%" border="0"> 72<colgroup> 73<col width="150px" class="name"> 74<col class="description"> 75</colgroup> 76<tbody> 77<tr> 78<td class="datatype_keyword"> </td> 79<td class="function_name"><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither">GstVideoDither</a></td> 80</tr> 81<tr> 82<td class="datatype_keyword">enum</td> 83<td class="function_name"><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherFlags" title="enum GstVideoDitherFlags">GstVideoDitherFlags</a></td> 84</tr> 85<tr> 86<td class="datatype_keyword">enum</td> 87<td class="function_name"><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherMethod" title="enum GstVideoDitherMethod">GstVideoDitherMethod</a></td> 88</tr> 89</tbody> 90</table></div> 91</div> 92<div class="refsect1"> 93<a name="gst-plugins-base-libs-GstVideoDither.includes"></a><h2>Includes</h2> 94<pre class="synopsis">#include <gst/video/video.h> 95</pre> 96</div> 97<div class="refsect1"> 98<a name="gst-plugins-base-libs-GstVideoDither.description"></a><h2>Description</h2> 99<p>GstVideoDither provides implementations of several dithering algorithms 100that can be applied to lines of video pixels to quantize and dither them.</p> 101</div> 102<div class="refsect1"> 103<a name="gst-plugins-base-libs-GstVideoDither.functions_details"></a><h2>Functions</h2> 104<div class="refsect2"> 105<a name="gst-video-dither-free"></a><h3>gst_video_dither_free ()</h3> 106<pre class="programlisting"><span class="returnvalue">void</span> 107gst_video_dither_free (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="type">GstVideoDither</span></a> *dither</code></em>);</pre> 108<p>Free <em class="parameter"><code>dither</code></em> 109</p> 110<div class="refsect3"> 111<a name="gst-video-dither-free.parameters"></a><h4>Parameters</h4> 112<div class="informaltable"><table class="informaltable" width="100%" border="0"> 113<colgroup> 114<col width="150px" class="parameters_name"> 115<col class="parameters_description"> 116<col width="200px" class="parameters_annotations"> 117</colgroup> 118<tbody><tr> 119<td class="parameter_name"><p>dither</p></td> 120<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="type">GstVideoDither</span></a></p></td> 121<td class="parameter_annotations"> </td> 122</tr></tbody> 123</table></div> 124</div> 125</div> 126<hr> 127<div class="refsect2"> 128<a name="gst-video-dither-line"></a><h3>gst_video_dither_line ()</h3> 129<pre class="programlisting"><span class="returnvalue">void</span> 130gst_video_dither_line (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="type">GstVideoDither</span></a> *dither</code></em>, 131 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#gpointer"><span class="type">gpointer</span></a> line</code></em>, 132 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> x</code></em>, 133 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> y</code></em>, 134 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> width</code></em>);</pre> 135<p>Dither <em class="parameter"><code>width</code></em> 136 pixels starting from offset <em class="parameter"><code>x</code></em> 137 in <em class="parameter"><code>line</code></em> 138 using <em class="parameter"><code>dither</code></em> 139.</p> 140<p><em class="parameter"><code>y</code></em> 141 is the line number of <em class="parameter"><code>line</code></em> 142 in the output image.</p> 143<div class="refsect3"> 144<a name="gst-video-dither-line.parameters"></a><h4>Parameters</h4> 145<div class="informaltable"><table class="informaltable" width="100%" border="0"> 146<colgroup> 147<col width="150px" class="parameters_name"> 148<col class="parameters_description"> 149<col width="200px" class="parameters_annotations"> 150</colgroup> 151<tbody> 152<tr> 153<td class="parameter_name"><p>dither</p></td> 154<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="type">GstVideoDither</span></a></p></td> 155<td class="parameter_annotations"> </td> 156</tr> 157<tr> 158<td class="parameter_name"><p>line</p></td> 159<td class="parameter_description"><p>pointer to the pixels of the line</p></td> 160<td class="parameter_annotations"> </td> 161</tr> 162<tr> 163<td class="parameter_name"><p>x</p></td> 164<td class="parameter_description"><p>x coordinate</p></td> 165<td class="parameter_annotations"> </td> 166</tr> 167<tr> 168<td class="parameter_name"><p>y</p></td> 169<td class="parameter_description"><p>y coordinate</p></td> 170<td class="parameter_annotations"> </td> 171</tr> 172<tr> 173<td class="parameter_name"><p>width</p></td> 174<td class="parameter_description"><p>the width</p></td> 175<td class="parameter_annotations"> </td> 176</tr> 177</tbody> 178</table></div> 179</div> 180</div> 181<hr> 182<div class="refsect2"> 183<a name="gst-video-dither-new"></a><h3>gst_video_dither_new ()</h3> 184<pre class="programlisting"><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="returnvalue">GstVideoDither</span></a> * 185gst_video_dither_new (<em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherMethod" title="enum GstVideoDitherMethod"><span class="type">GstVideoDitherMethod</span></a> method</code></em>, 186 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherFlags" title="enum GstVideoDitherFlags"><span class="type">GstVideoDitherFlags</span></a> flags</code></em>, 187 <em class="parameter"><code><a class="link" href="gst-plugins-base-libs-GstVideo.html#GstVideoFormat" title="enum GstVideoFormat"><span class="type">GstVideoFormat</span></a> format</code></em>, 188 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> quantizer[GST_VIDEO_MAX_COMPONENTS]</code></em>, 189 <em class="parameter"><code><a href="/usr/share/gtk-doc/html/glib/glib-Basic-Types.html#guint"><span class="type">guint</span></a> width</code></em>);</pre> 190<p>Make a new dither object for dithering lines of <em class="parameter"><code>format</code></em> 191 using the 192algorithm described by <em class="parameter"><code>method</code></em> 193.</p> 194<p>Each component will be quantized to a multiple of <em class="parameter"><code>quantizer</code></em> 195. Better 196performance is achived when <em class="parameter"><code>quantizer</code></em> 197 is a power of 2.</p> 198<p><em class="parameter"><code>width</code></em> 199 is the width of the lines that this ditherer will handle.</p> 200<p><span class="annotation">[<acronym title="Exposed in C code, not necessarily available in other languages."><span class="acronym">skip</span></acronym>]</span></p> 201<div class="refsect3"> 202<a name="gst-video-dither-new.parameters"></a><h4>Parameters</h4> 203<div class="informaltable"><table class="informaltable" width="100%" border="0"> 204<colgroup> 205<col width="150px" class="parameters_name"> 206<col class="parameters_description"> 207<col width="200px" class="parameters_annotations"> 208</colgroup> 209<tbody> 210<tr> 211<td class="parameter_name"><p>method</p></td> 212<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherMethod" title="enum GstVideoDitherMethod"><span class="type">GstVideoDitherMethod</span></a></p></td> 213<td class="parameter_annotations"> </td> 214</tr> 215<tr> 216<td class="parameter_name"><p>flags</p></td> 217<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDitherFlags" title="enum GstVideoDitherFlags"><span class="type">GstVideoDitherFlags</span></a></p></td> 218<td class="parameter_annotations"> </td> 219</tr> 220<tr> 221<td class="parameter_name"><p>format</p></td> 222<td class="parameter_description"><p>a <a class="link" href="gst-plugins-base-libs-GstVideo.html#GstVideoFormat" title="enum GstVideoFormat"><span class="type">GstVideoFormat</span></a></p></td> 223<td class="parameter_annotations"> </td> 224</tr> 225<tr> 226<td class="parameter_name"><p>quantizer</p></td> 227<td class="parameter_description"><p>quantizer</p></td> 228<td class="parameter_annotations"> </td> 229</tr> 230<tr> 231<td class="parameter_name"><p>width</p></td> 232<td class="parameter_description"><p>the width of the lines</p></td> 233<td class="parameter_annotations"> </td> 234</tr> 235</tbody> 236</table></div> 237</div> 238<div class="refsect3"> 239<a name="gst-video-dither-new.returns"></a><h4>Returns</h4> 240<p> a new <a class="link" href="gst-plugins-base-libs-GstVideoDither.html#GstVideoDither" title="GstVideoDither"><span class="type">GstVideoDither</span></a></p> 241</div> 242</div> 243</div> 244<div class="refsect1"> 245<a name="gst-plugins-base-libs-GstVideoDither.other_details"></a><h2>Types and Values</h2> 246<div class="refsect2"> 247<a name="GstVideoDither"></a><h3>GstVideoDither</h3> 248<pre class="programlisting">typedef struct _GstVideoDither GstVideoDither;</pre> 249</div> 250<hr> 251<div class="refsect2"> 252<a name="GstVideoDitherFlags"></a><h3>enum GstVideoDitherFlags</h3> 253<p>Extra flags that influence the result from <a class="link" href="gst-plugins-base-libs-GstVideoChroma.html#gst-video-chroma-resample-new" title="gst_video_chroma_resample_new ()"><code class="function">gst_video_chroma_resample_new()</code></a>.</p> 254<div class="refsect3"> 255<a name="GstVideoDitherFlags.members"></a><h4>Members</h4> 256<div class="informaltable"><table class="informaltable" width="100%" border="0"> 257<colgroup> 258<col width="300px" class="enum_members_name"> 259<col class="enum_members_description"> 260<col width="200px" class="enum_members_annotations"> 261</colgroup> 262<tbody> 263<tr> 264<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-FLAG-NONE:CAPS"></a>GST_VIDEO_DITHER_FLAG_NONE</p></td> 265<td class="enum_member_description"> 266<p>no flags</p> 267</td> 268<td class="enum_member_annotations"> </td> 269</tr> 270<tr> 271<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-FLAG-INTERLACED:CAPS"></a>GST_VIDEO_DITHER_FLAG_INTERLACED</p></td> 272<td class="enum_member_description"> 273<p>the input is interlaced</p> 274</td> 275<td class="enum_member_annotations"> </td> 276</tr> 277<tr> 278<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-FLAG-QUANTIZE:CAPS"></a>GST_VIDEO_DITHER_FLAG_QUANTIZE</p></td> 279<td class="enum_member_description"> 280<p>quantize values in addition to adding dither.</p> 281</td> 282<td class="enum_member_annotations"> </td> 283</tr> 284</tbody> 285</table></div> 286</div> 287</div> 288<hr> 289<div class="refsect2"> 290<a name="GstVideoDitherMethod"></a><h3>enum GstVideoDitherMethod</h3> 291<p>Different dithering methods to use.</p> 292<div class="refsect3"> 293<a name="GstVideoDitherMethod.members"></a><h4>Members</h4> 294<div class="informaltable"><table class="informaltable" width="100%" border="0"> 295<colgroup> 296<col width="300px" class="enum_members_name"> 297<col class="enum_members_description"> 298<col width="200px" class="enum_members_annotations"> 299</colgroup> 300<tbody> 301<tr> 302<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-NONE:CAPS"></a>GST_VIDEO_DITHER_NONE</p></td> 303<td class="enum_member_description"> 304<p>no dithering</p> 305</td> 306<td class="enum_member_annotations"> </td> 307</tr> 308<tr> 309<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-VERTERR:CAPS"></a>GST_VIDEO_DITHER_VERTERR</p></td> 310<td class="enum_member_description"> 311<p>propagate rounding errors downwards</p> 312</td> 313<td class="enum_member_annotations"> </td> 314</tr> 315<tr> 316<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-FLOYD-STEINBERG:CAPS"></a>GST_VIDEO_DITHER_FLOYD_STEINBERG</p></td> 317<td class="enum_member_description"> 318<p>Dither with floyd-steinberg error diffusion</p> 319</td> 320<td class="enum_member_annotations"> </td> 321</tr> 322<tr> 323<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-SIERRA-LITE:CAPS"></a>GST_VIDEO_DITHER_SIERRA_LITE</p></td> 324<td class="enum_member_description"> 325<p>Dither with Sierra Lite error diffusion</p> 326</td> 327<td class="enum_member_annotations"> </td> 328</tr> 329<tr> 330<td class="enum_member_name"><p><a name="GST-VIDEO-DITHER-BAYER:CAPS"></a>GST_VIDEO_DITHER_BAYER</p></td> 331<td class="enum_member_description"> 332<p>ordered dither using a bayer pattern</p> 333</td> 334<td class="enum_member_annotations"> </td> 335</tr> 336</tbody> 337</table></div> 338</div> 339</div> 340</div> 341</div> 342<div class="footer"> 343<hr>Generated by GTK-Doc V1.28</div> 344</body> 345</html>