|
EDT PDV SDK Documentation 6.2.1
|
#include "edtinc.h"#include "clsim_lib.h"#include <stdio.h>#include <stdlib.h>#include <string.h>#include <tiffio.h>Data Structures | |
| struct | image_info_t |
Functions | |
| void | usage (const char *progname, const char *errstr) |
| int | get_image_info_file (const char *fname, image_info_t **imagelist) |
| ImgFmt | check_extension (const char *fname) |
| int | get_images_info_dir (const char *dirpath, image_info_t **imagelist) |
| int | get_image_info (ImgFmt fmt, image_info_t *image_p) |
| int | get_tif_info (image_info_t *img_details) |
| int | is_valid_tiff (TIFF *image) |
| int | get_gif_info (image_info_t *img_details) |
| int | get_ras_info (image_info_t *img_details) |
| int | get_raw_info (image_info_t *img_details) |
| int | get_bmp_info (image_info_t *img_details) |
| int | get_jpg_info (image_info_t *img_details) |
| char * | strip_nl (char *s) |
| int | comment_or_blank (const char *str) |
| void | error_exit (const char *errstr) |
| void | free_image_info_list (image_info_t *imagelist, const size_t cnt) |
| int | check_image_sizes (image_info_t *list, unsigned int nimages) |
| int | load_next_image (PdvDev pdv_p, unsigned int current_image, image_info_t *image_details, unsigned int total_images, uint8_t **buffers, unsigned int nbuffers, unsigned int buffer_size) |
| long unsigned int | fill_buffer_tif (image_info_t *img_details, uint8_t *buffer, int max_size) |
| int | fill_buffer_gif (image_info_t *img_details, uint8_t *buffer, int max_size) |
| int | fill_buffer_bmp (image_info_t *img_details, uint8_t *buffer, int max_size) |
| int | fill_buffer_jpg (image_info_t *img_details, uint8_t *buffer, int max_size) |
| int | fill_buffer_ras (image_info_t *img_details, uint8_t *buffer, int max_size) |
| int | fill_buffer_raw (image_info_t *img_details, uint8_t *buffer, int max_size) |
| unsigned int | edt_min (unsigned int l, unsigned int r) |
| int | main (int argc, const char *argv[]) |
A utility / example program to send multiple TIFF format images through the EDT Camera Link Simulator (CLS) to a Camera Link frame grabber, such as the EDT VisionLink F4.
For a more complex application (including variable width images, left/right fill, etc) with the same purpose see: send_tiffs.c
See the EDT CLS Simulator users guide for detailed information on this application.
Prerequisites: Setup the CLS via the clsiminit application.
| static void usage | ( | const char * | progname, |
| const char * | errmsg | ||
| ) |
Display usage information.
| progname | The name of this program. |
| errstr | A discription of what is invalid about the call. |
Display usage information.
| progname | The name of this program. |
| err | A description of what is invalid about the call. |
Display usage information.
| progname | The name of this program. |
| errmsg | A description of what is invalid about the call. |
| int get_image_info_file | ( | const char * | fname, |
| image_info_t ** | imagelist | ||
| ) |
Retrieve the specified image's information.
| fname | Name of the image file whose information is to be gathered. |
| imagelist | An array of structures containing information about each image in the imagelist. |
| ImgFmt check_extension | ( | const char * | fname | ) |
Validate image type of specified file, based on extension.
| fname | Name of the image file to validate. |
| int get_images_info_dir | ( | const char * | dirpath, |
| image_info_t ** | imagelist | ||
| ) |
Collect information for all valid images within a specified directory.
Uses the OS independent edt_* directory open / read / close functions.
| dirpath | Path to a directory containing images to validate and collect information upon. |
| imagelist | An array of structures containing information about each image in the imagelist. |
return number of images found, or -1 if error
| int get_image_info | ( | ImgFmt | fmt, |
| image_info_t * | image_p | ||
| ) |
Retrieve information for a specified image.
| fmt | An enum representing the image type. |
| image_p | Storage for the image details. Must have pathname specified. |
| int get_tif_info | ( | image_info_t * | img_details | ) |
Retrieve information for tiff image.
| img_details | Storage for the image details. Must have pathname specified. |
| int is_valid_tiff | ( | TIFF * | image | ) |
Validate the TIFF image; ensure it meets current requirements. Image must be <= 16 bits/pixel and 1 sample/pixel. Image must also define width and height.
| image | The image to validate. |
| int get_gif_info | ( | image_info_t * | img_details | ) |
Retrieve information for gif image - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| int get_ras_info | ( | image_info_t * | img_details | ) |
Retrieve information for ras image - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| int get_raw_info | ( | image_info_t * | img_details | ) |
Retrieve information for raw image - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| int get_bmp_info | ( | image_info_t * | img_details | ) |
Retrieve information for bmp image - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| int get_jpg_info | ( | image_info_t * | img_details | ) |
Retrieve information for jpg image - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| char * strip_nl | ( | char * | s | ) |
Strip the newline off a string by replacing any terminating (\r or \n) with a NULL character.
| s | String to strip any terminating characters from. |
\r and \n chars replaced. | int comment_or_blank | ( | const char * | str | ) |
Check the specified string for comment or blank character.
| str | The string to check. |
| void error_exit | ( | const char * | errstr | ) |
Helper function to specify error string before exiting with failure.
| errstr | String containing a specialized error message. |
| void free_image_info_list | ( | image_info_t * | imagelist, |
| const size_t | cnt | ||
| ) |
Free a list of images; all images within the list and then list itself.
| list | The list of images and their parameters. |
| cnt | The number of images in the list. |
| int check_image_sizes | ( | image_info_t * | list, |
| unsigned int | nimages | ||
| ) |
Verify that an image information list is (a) correctly sized to the expected image count and (b) all of the images within the list have the same dimensions.
| list | The list of images and their parameters. |
| nimages | The expected image count. |
| int load_next_image | ( | PdvDev | pdv_p, |
| unsigned int | current_image, | ||
| image_info_t * | image_details, | ||
| unsigned int | total_images, | ||
| uint8_t ** | buffers, | ||
| unsigned int | nbuffers, | ||
| unsigned int | buffer_size | ||
| ) |
Load the current_image into memory OR the appropriate ring-buffer.
If the index of current_image is larger than total_images it will wrap around. (current_image = current_image % total_images)
| pdv_p | Valid EDT device pointer to the CLS. |
| current_image | The index of the image to load into local buffer. |
| img_details | List of structures containing image details. |
| total_images | The number of elements in image_details list. |
| buffers | The array of ring buffers in use. |
| nbuffers | The number of elements in buffers array. |
| buffer_size | The size of image data buffers to allocate, if buffers is NULL. |
| long unsigned int fill_buffer_tif | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the tiff image found in img_details->pathname to the specified buffer.
| img_details | Storage for the image details. Must have pathname specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| int fill_buffer_gif | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the gif image found in img_details->filename to the specified buffer - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| int fill_buffer_bmp | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the bmp image found in img_details->filename to the specified buffer - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| int fill_buffer_jpg | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the jpg image found in img_details->filename to the specified buffer - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| int fill_buffer_ras | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the ras image found in img_details->filename to the specified buffer - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| int fill_buffer_raw | ( | image_info_t * | img_details, |
| uint8_t * | buffer, | ||
| int | max_size | ||
| ) |
Stores the raw image found in img_details->filename to the specified buffer - STUB.
| img_details | Storage for the image details. Must have filename specified. |
| buffer | A pointer to a buffer in which to store the image. |
| max_size | The size of the buffer in bytes. |
| unsigned int edt_min | ( | unsigned int | l, |
| unsigned int | r | ||
| ) |
Determine the minimum value of the two specified.
| l | One of two integer values to determine the lesser of. |
| r | The other of two integer values to determine the lesser of. |
| int main | ( | int | argc, |
| const char * | argv[] | ||
| ) |
Open a number of TIFF images and send them though the simulator.