diff options
Diffstat (limited to 'docs')
-rw-r--r-- | docs/manual.md | 74 | ||||
-rw-r--r-- | docs/mock.html | 70 | ||||
-rw-r--r-- | docs/style.css | 99 |
3 files changed, 194 insertions, 49 deletions
diff --git a/docs/manual.md b/docs/manual.md index 69abae8..cff6f18 100644 --- a/docs/manual.md +++ b/docs/manual.md @@ -107,6 +107,7 @@ necessary header files: ~~~ {.c} #include <glib-object.h> +#include <uca-plugin-manager.h> #include <uca-camera.h> ~~~ @@ -116,6 +117,7 @@ Then you need to setup the type system: int main (int argc, char *argv[]) { + UcaPluginManager *manager; UcaCamera *camera; GError *error = NULL; /* this _must_ be set to NULL */ @@ -124,10 +126,12 @@ main (int argc, char *argv[]) Now you can instantiate new camera _objects_. Each camera is identified by a human-readable string, in this case we want to access any pco camera that is -supported by [libpco][]: +supported by [libpco][]. To instantiate a camera we have to create a plugin +manager first: ~~~ {.c} - camera = uca_camera_new ("pco", &error); + manager = uca_plugin_manager_new (); + camera = uca_plugin_manager_new_camera (manager, "pco", &error); ~~~ Errors are indicated with a returned value `NULL` and `error` set to a value @@ -241,6 +245,12 @@ The following cameras are supported: * Pylon * UFO Camera developed at KIT/IPE. +## Property documentation + +* [mock][mock-doc] + +[mock-doc]: mock.html + # More API @@ -252,38 +262,19 @@ communicate with the camera. Now we will go into more detail. We have already seen how to instantiate a camera object from a name. If you have more than one camera connected to a machine, you will most likely want the user decide which to use. To do so, you can enumerate all camera strings with -`uca_camera_get_types`: +`uca_plugin_manager_get_available_cameras`: ~~~ {.c} - gchar **types; + GList *types; - types = uca_camera_get_types (); + types = uca_camera_get_available_cameras (manager); - for (guint i = 0; types[i] != NULL; i++) - g_print ("%s\n", types[i]); + for (GList *it = g_list_first; it != NULL; it = g_list_next (it)) + g_print ("%s\n", (gchar *) it->data); - /* free the string array */ - g_strfreev (types); -~~~ - -If you _know_ which camera you want to use you can instantiate the sub-classed -camera object directly. In this case we create a pco-based camera: - -~~~ {.c} -#include <glib-object.h> -#include <uca/uca-camera-pco.h> - -int -main (int argc, char *argv[]) -{ - UcaPcoCamera *camera; - GError *error = NULL; - - g_type_init (); - camera = uca_pco_camera_new (&error); - g_object_unref (camera); - return 0; -} + /* free the strings and the list */ + g_list_foreach (types, (GFunc) g_free, NULL); + g_list_free (types); ~~~ [last section]: #first-look-at-the-api @@ -381,6 +372,31 @@ virtual methods. The simplest way is to take the `mock` camera and rename all occurences. Note, that if you class is going to be called `FooBar`, the upper case variant is `FOO_BAR` and the lower case variant is `foo_bar`. +In order to fully implement a camera, you need to override at least the +following virtual methods: + +* `start_recording`: Take suitable actions so that a subsequent call to + `grab` delivers an image or blocks until one is exposed. +* `stop_recording`: Stop recording so that subsequent calls to `grab` + fail. +* `grab`: Return an image from the camera or block until one is ready. + +## Asynchronous operation + +When the camera supports asynchronous acquisition and announces it with a true +boolean value for `"transfer-asynchronously"`, a mechanism must be setup up +during `start_recording` so that for each new frame the grab func callback is +called. + +## Cameras with internal memory + +Cameras such as the pco.dimax record into their own on-board memory rather than +streaming directly to the host PC. In this case, both `start_recording` and +`stop_recording` initiate and end acquisition to the on-board memory. To +initiate a data transfer, the host calls `start_readout` which must be suitably +implemented. The actual data transfer happens either with `grab` or +asynchronously. + [sub-classing]: http://developer.gnome.org/gobject/stable/howto-gobject.html diff --git a/docs/mock.html b/docs/mock.html new file mode 100644 index 0000000..0d38fc8 --- /dev/null +++ b/docs/mock.html @@ -0,0 +1,70 @@ +<html><head><link rel="stylesheet" href="style.css" type="text/css" /><link href='http://fonts.googleapis.com/css?family=Droid+Sans:400,700|Droid+Serif:400,400italic|Inconsolata' rel='stylesheet' type='text/css'><title>mock — properties</title></head><body><div id="header"><h1 class="title">Property documentation of mock</h1><h2>Properties</h2><ul id="toc"><li><code><a href=#name>"name"</a></code></li><li><code><a href=#sensor-width>"sensor-width"</a></code></li><li><code><a href=#sensor-height>"sensor-height"</a></code></li><li><code><a href=#sensor-bitdepth>"sensor-bitdepth"</a></code></li><li><code><a href=#sensor-horizontal-binning>"sensor-horizontal-binning"</a></code></li><li><code><a href=#sensor-horizontal-binnings>"sensor-horizontal-binnings"</a></code></li><li><code><a href=#sensor-vertical-binning>"sensor-vertical-binning"</a></code></li><li><code><a href=#sensor-vertical-binnings>"sensor-vertical-binnings"</a></code></li><li><code><a href=#sensor-max-frame-rate>"sensor-max-frame-rate"</a></code></li><li><code><a href=#trigger-mode>"trigger-mode"</a></code></li><li><code><a href=#exposure-time>"exposure-time"</a></code></li><li><code><a href=#roi-x0>"roi-x0"</a></code></li><li><code><a href=#roi-y0>"roi-y0"</a></code></li><li><code><a href=#roi-width>"roi-width"</a></code></li><li><code><a href=#roi-height>"roi-height"</a></code></li><li><code><a href=#roi-width-multiplier>"roi-width-multiplier"</a></code></li><li><code><a href=#roi-height-multiplier>"roi-height-multiplier"</a></code></li><li><code><a href=#has-streaming>"has-streaming"</a></code></li><li><code><a href=#has-camram-recording>"has-camram-recording"</a></code></li><li><code><a href=#transfer-asynchronously>"transfer-asynchronously"</a></code></li><li><code><a href=#is-recording>"is-recording"</a></code></li><li><code><a href=#is-readout>"is-readout"</a></code></li><li><code><a href=#frame-rate>"frame-rate"</a></code></li></ul><h2>Details</h2><dl><dt id="name"><a href="#toc">name</a></dt> +<dd><pre><code class="prop-type">"name" : gchararray : Read-only</code></pre> +<p>Name of the camera</p> +</dd><dt id="sensor-width"><a href="#toc">sensor-width</a></dt> +<dd><pre><code class="prop-type">"sensor-width" : guint : Read-only</code></pre> +<p>Width of the sensor in pixels</p> +</dd><dt id="sensor-height"><a href="#toc">sensor-height</a></dt> +<dd><pre><code class="prop-type">"sensor-height" : guint : Read-only</code></pre> +<p>Height of the sensor in pixels</p> +</dd><dt id="sensor-bitdepth"><a href="#toc">sensor-bitdepth</a></dt> +<dd><pre><code class="prop-type">"sensor-bitdepth" : guint : Read-only</code></pre> +<p>Number of bits per pixel</p> +</dd><dt id="sensor-horizontal-binning"><a href="#toc">sensor-horizontal-binning</a></dt> +<dd><pre><code class="prop-type">"sensor-horizontal-binning" : guint : Read / Write</code></pre> +<p>Number of sensor ADCs that are combined to one pixel in horizontal direction</p> +</dd><dt id="sensor-horizontal-binnings"><a href="#toc">sensor-horizontal-binnings</a></dt> +<dd><pre><code class="prop-type">"sensor-horizontal-binnings" : GValueArray : Read-only</code></pre> +<p>Array of possible binnings in horizontal direction</p> +</dd><dt id="sensor-vertical-binning"><a href="#toc">sensor-vertical-binning</a></dt> +<dd><pre><code class="prop-type">"sensor-vertical-binning" : guint : Read / Write</code></pre> +<p>Number of sensor ADCs that are combined to one pixel in vertical direction</p> +</dd><dt id="sensor-vertical-binnings"><a href="#toc">sensor-vertical-binnings</a></dt> +<dd><pre><code class="prop-type">"sensor-vertical-binnings" : GValueArray : Read-only</code></pre> +<p>Array of possible binnings in vertical direction</p> +</dd><dt id="sensor-max-frame-rate"><a href="#toc">sensor-max-frame-rate</a></dt> +<dd><pre><code class="prop-type">"sensor-max-frame-rate" : gfloat : Read-only</code></pre> +<p>Maximum frame rate at full frame resolution</p> +</dd><dt id="trigger-mode"><a href="#toc">trigger-mode</a></dt> +<dd><pre><code class="prop-type">"trigger-mode" : UcaCameraTrigger : Read / Write</code></pre> +<p>Trigger mode</p> +</dd><dt id="exposure-time"><a href="#toc">exposure-time</a></dt> +<dd><pre><code class="prop-type">"exposure-time" : gdouble : Read / Write</code></pre> +<p>Exposure time in seconds</p> +</dd><dt id="roi-x0"><a href="#toc">roi-x0</a></dt> +<dd><pre><code class="prop-type">"roi-x0" : guint : Read / Write</code></pre> +<p>Horizontal coordinate</p> +</dd><dt id="roi-y0"><a href="#toc">roi-y0</a></dt> +<dd><pre><code class="prop-type">"roi-y0" : guint : Read / Write</code></pre> +<p>Vertical coordinate</p> +</dd><dt id="roi-width"><a href="#toc">roi-width</a></dt> +<dd><pre><code class="prop-type">"roi-width" : guint : Read / Write</code></pre> +<p>Width of the region of interest</p> +</dd><dt id="roi-height"><a href="#toc">roi-height</a></dt> +<dd><pre><code class="prop-type">"roi-height" : guint : Read / Write</code></pre> +<p>Height of the region of interest</p> +</dd><dt id="roi-width-multiplier"><a href="#toc">roi-width-multiplier</a></dt> +<dd><pre><code class="prop-type">"roi-width-multiplier" : guint : Read-only</code></pre> +<p>Minimum possible step size of horizontal ROI</p> +</dd><dt id="roi-height-multiplier"><a href="#toc">roi-height-multiplier</a></dt> +<dd><pre><code class="prop-type">"roi-height-multiplier" : guint : Read-only</code></pre> +<p>Minimum possible step size of vertical ROI</p> +</dd><dt id="has-streaming"><a href="#toc">has-streaming</a></dt> +<dd><pre><code class="prop-type">"has-streaming" : gboolean : Read-only</code></pre> +<p>Is the camera able to stream the data</p> +</dd><dt id="has-camram-recording"><a href="#toc">has-camram-recording</a></dt> +<dd><pre><code class="prop-type">"has-camram-recording" : gboolean : Read-only</code></pre> +<p>Is the camera able to record the data in-camera</p> +</dd><dt id="transfer-asynchronously"><a href="#toc">transfer-asynchronously</a></dt> +<dd><pre><code class="prop-type">"transfer-asynchronously" : gboolean : Read / Write</code></pre> +<p>Specify whether data should be transfered asynchronously using a specified callback</p> +</dd><dt id="is-recording"><a href="#toc">is-recording</a></dt> +<dd><pre><code class="prop-type">"is-recording" : gboolean : Read-only</code></pre> +<p>Is the camera currently recording</p> +</dd><dt id="is-readout"><a href="#toc">is-readout</a></dt> +<dd><pre><code class="prop-type">"is-readout" : gboolean : Read-only</code></pre> +<p>Is camera in readout mode</p> +</dd><dt id="frame-rate"><a href="#toc">frame-rate</a></dt> +<dd><pre><code class="prop-type">"frame-rate" : gfloat : Read / Write</code></pre> +<p>Number of frames per second that are taken</p> +</dd></dl></body></html> diff --git a/docs/style.css b/docs/style.css index a9fc9ca..beccf45 100644 --- a/docs/style.css +++ b/docs/style.css @@ -1,35 +1,34 @@ - /* --- Reset ------------------------------------------------------ */ body, div, dl, dt, dd, ul, ol, li, h1, h2, h3, h4, h5, h6, pre, form, fieldset, input, textarea, -p, blockquote, th, td { - margin: 0; +p, blockquote, th, td { + margin: 0; padding: 0; } table { - border-collapse: collapse; + border-collapse: collapse; border-spacing: 0; } fieldset, img { - border: 0; - } - address, caption, cite, dfn, th, var { + border: 0; +} +address, caption, cite, dfn, th, var { font-style: normal; - font-weight: normal; - } - caption, th { + font-weight: normal; +} +caption, th { text-align: left; } h1, h2, h3, h4, h5, h6 { - font-size: 100%; + font-size: 100%; font-weight: normal; } q:before, q:after { - content: ''; - } - abbr, acronym { + content: ''; +} +abbr, acronym { border: 0; } @@ -52,10 +51,6 @@ p { margin-bottom: 24px; } -/* p > code { */ -/* font-size: 0.8em; */ -/* } */ - h1, h2, h3, h4, h5, h6 { margin-bottom: 24px; font-family: "Droid Sans", sans-serif; @@ -65,6 +60,9 @@ h1, h2, h3, h4, h5, h6 { h1 { font-size: 1.5em; line-height: 1em; + margin-top: 2em; + padding-bottom: 0.5em; + border-bottom: 2px dotted #bbb; } h2 { @@ -87,11 +85,29 @@ h5, h6 { line-height: 1.5em; } -h1 > a, h2 > a, h3 > a, h4 > a, h5 > a, h6 > a { - color: black; +h1 > a { + color: #555; text-decoration: none; } +a { + color: #8e3557; + text-decoration: none; +} + +a:hover { + color: #88a33e; +} + +h1:hover :after, +h2:hover :after, +h3:hover :after, +h4:hover :after, +h5:hover :after, +h6:hover :after { + content: " \2191"; +} + pre { margin-bottom: 24px; line-height: 1.2em; @@ -103,19 +119,62 @@ code { } ul, ol { + list-style-position: inside; + padding-left: 1em; + text-indent: -1em; + margin-left: 0; margin-bottom: 24px; } +ul#toc { + list-style-type: none; +} + +li + li { + margin-top: 0.1em; +} + ul ul, ol ol { margin: 0 0 0 24px; } +table { + width: 100%; + margin-bottom: 24px; +} + +th { + color: #555; + font-family: 'Droid Sans', sans-serif; + font-weight: bold; + border-bottom: 1px dotted #bbb; +} + +td, th { + padding: 2px; +} + +dl { + margin-bottom: 24px; +} + +dt { + font-style: italic; +} + +dd { + margin-top: 12px; + padding-left: 1em; +} + .title { font-size: xx-large; + color: #555; } .author { font-size: 1.25em; font-weight: normal; + color: #555; } |