diff options
-rw-r--r-- | doc/CMakeLists.txt | 7 | ||||
-rw-r--r-- | src/cameras/simple.h | 4 | ||||
-rw-r--r-- | src/uca.c | 1 | ||||
-rw-r--r-- | src/uca.h | 14 | ||||
-rw-r--r-- | test/grab-async.c | 9 |
5 files changed, 22 insertions, 13 deletions
diff --git a/doc/CMakeLists.txt b/doc/CMakeLists.txt index ff2030a..0e5afd1 100644 --- a/doc/CMakeLists.txt +++ b/doc/CMakeLists.txt @@ -7,10 +7,11 @@ if(DOXYGEN_FOUND) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/Doxyfile.in ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile) configure_file(${CMAKE_CURRENT_SOURCE_DIR}/publish.sh.in ${CMAKE_CURRENT_BINARY_DIR}/publish.sh) - # add 'ALL after 'doc' to create documentation, whenever you type make - add_custom_target(doc - ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile + add_custom_command(OUTPUT ${CMAKE_CURRENT_BINARY_DIR}/html/index.html + COMMAND ${DOXYGEN_EXECUTABLE} ${CMAKE_CURRENT_BINARY_DIR}/Doxyfile WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR} + DEPENDS ${CMAKE_CURRENT_SOURCE_DIR}/../src/uca.h COMMENT "Generating API documentation with Doxygen" VERBATIM ) + add_custom_target(docs ALL DEPENDS ${CMAKE_CURRENT_BINARY_DIR}/html/index.html) endif(DOXYGEN_FOUND) diff --git a/src/cameras/simple.h b/src/cameras/simple.h index 0c8e9a7..6d8e45e 100644 --- a/src/cameras/simple.h +++ b/src/cameras/simple.h @@ -15,8 +15,8 @@ with this library; if not, write to the Free Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110, USA */ -#ifndef __UNIFIED_CAMERA_ACCESS_PHOTON_H -#define __UNIFIED_CAMERA_ACCESS_PHOTON_H +#ifndef __UNIFIED_CAMERA_ACCESS_SIMPLE_H +#define __UNIFIED_CAMERA_ACCESS_SIMPLE_H uint32_t uca_simple_init(struct uca_camera_priv **uca, struct uca_grabber_priv *grabber); @@ -346,6 +346,7 @@ uint32_t uca_cam_release_buffer(struct uca_camera *cam, void *buffer) struct uca_camera_priv *priv = cam->priv; if (priv->release_buffer != NULL) return priv->release_buffer(priv, buffer); + return UCA_ERR_NOT_IMPLEMENTED; } uint32_t uca_cam_grab(struct uca_camera *cam, char *buffer, void *meta_data) @@ -208,6 +208,8 @@ enum uca_access_rights { /** * Describes the current state of the camera. + * + * \see uca_cam_get_state() */ enum uca_cam_state { UCA_CAM_CONFIGURABLE, /**< Camera can be configured and is not recording */ @@ -220,16 +222,19 @@ enum uca_cam_state { * Specify if the callback function keeps the buffer and will call * ufo_cam_release_buffer() at later time or if after returning the buffer can * be released automatically. + * + * \since 0.5 */ enum uca_buffer_status { - UCA_BUFFER_KEEP, - UCA_BUFFER_RELEASE + UCA_BUFFER_KEEP, /**< Keep the buffer and call ufo_cam_release_buffer() manually */ + UCA_BUFFER_RELEASE /**< Buffer is released upon return */ }; /** * A uca_property_t describes a vendor-independent property used by cameras and * frame grabbers. It basically consists of a human-readable name, a physical * unit, a type and some access rights. + * \see uca_get_full_property() */ typedef struct uca_property { /** @@ -266,6 +271,9 @@ union uca_value { * \param[in] meta_data Meta data provided by the camera specifying per-frame * data. * \param[in] user User data registered in uca_cam_register_callback() + * \return Value from uca_buffer_status. If #UCA_BUFFER_KEEP is returned, the + * callee must make sure to call uca_cam_release_buffer(). On the other hand, if + * #UCA_BUFFER_RELEASE is returned this is done by the caller. * * \note The meta data parameter is not yet specified but just a place holder. */ @@ -357,7 +365,7 @@ typedef struct uca { * relying on external calibration data. It is ignored when no JSON parser can * be found at compile time or config_filename is NULL. * - * \return Pointer to a uca structure + * \return Pointer to a #uca structure * * \note uca_init() is thread-safe if a Pthread-implementation is available. */ diff --git a/test/grab-async.c b/test/grab-async.c index 7ce8b01..7bcd5f7 100644 --- a/test/grab-async.c +++ b/test/grab-async.c @@ -32,10 +32,10 @@ enum uca_buffer_status grab_callback(uint64_t image_number, void *buffer, void * const int pixel_size = props->bits == 8 ? 1 : 2; char filename[256]; - /* sprintf(filename, "out-%04i.raw", (int) image_number); */ - /* FILE *fp = fopen(filename, "wb"); */ - /* fwrite(buffer, props->width * props->height, pixel_size, fp); */ - /* fclose(fp); */ + sprintf(filename, "out-%04i.raw", (int) image_number); + FILE *fp = fopen(filename, "wb"); + fwrite(buffer, props->width * props->height, pixel_size, fp); + fclose(fp); printf("grabbed picture %i at %p (%ix%i @ %i bits)\n", (int) image_number, buffer, @@ -65,7 +65,6 @@ int main(int argc, char *argv[]) uca_cam_get_property(cam, UCA_PROP_HEIGHT, &props.height, 0); uca_cam_get_property(cam, UCA_PROP_BITDEPTH, &props.bits, 0); - printf("width=%i, height=%i, bits=%i\n", props.width, props.height, props.bits); uca_cam_alloc(cam, 10); uca_cam_start_recording(cam); |