Changes between Version 40 and Version 41 of UnifiedCameraAccess


Ignore:
Timestamp:
Feb 8, 2012, 11:07:42 AM (13 years ago)
Author:
Matthias Vogelgesang
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • UnifiedCameraAccess

    v40 v41  
    8383== Code ==
    8484
    85 Followingly, we will build libpco (the hardware-dependent pco.edge "driver") and libuca. First of all, get the sources
     85Followingly, we will build libpco (the hardware-dependent pco "driver") and libuca. First of all, get the sources
    8686{{{
    8787#!sh
     
    108108}}}
    109109
    110 == Using libuca ==
     110There are several small test programs included, that demonstrate how to use the library:
    111111
    112 The following test program is supplied with `libuca` and demonstrates the general functionality of the library:
    113 
    114 {{{
    115 #!c
    116 #include <stdio.h>
    117 #include <stdlib.h>
    118 #include "uca.h"
    119 #include "uca-cam.h"
    120 
    121 int main(int argc, char *argv[])
    122 {
    123     struct uca_t *uca = uca_init();
    124     if (uca == NULL)
    125         return 1;
    126 
    127     /* take first camera */
    128     struct uca_camera_t *cam = uca->cameras;
    129 
    130     uint32_t val = 5000;
    131     cam->set_property(cam, UCA_PROP_EXPOSURE, &val);
    132     val = 0;
    133     cam->set_property(cam, UCA_PROP_DELAY, &val);
    134 
    135     uint32_t width, height;
    136     cam->get_property(cam, UCA_PROP_WIDTH, &width);
    137     cam->get_property(cam, UCA_PROP_HEIGHT, &height);
    138 
    139     uca_cam_alloc(cam, 20);
    140     uint16_t *buffer = (uint16_t *) malloc(width * height * 2);
    141 
    142     cam->start_recording(cam);
    143     cam->grab(cam, (char *) buffer);
    144     cam->stop_recording(cam);
    145     uca_destroy(uca);
    146 
    147     FILE *fp = fopen("out.raw", "wb");
    148     fwrite(buffer, width*height, 2, fp);
    149     fclose(fp);
    150 
    151     free(buffer);
    152     return 0;
    153 }
    154 }}}
    155 
     112* `enum` lists the available property of a camera
     113* `grab` tries to record twenty frames
     114* `control` is GUI to change properties and show frames
    156115
    157116== Milestones ==