#include <sys/time.h>
#include <glib.h>
Go to the source code of this file.
Enumerations | 
| enum   | iwImgFormat {  
  IW_IMG_FORMAT_UNKNOWN, 
IW_IMG_FORMAT_PNM, 
IW_IMG_FORMAT_PNG, 
IW_IMG_FORMAT_JPEG, 
 
  IW_IMG_FORMAT_MOVIE, 
IW_IMG_FORMAT_AVI_RAW444 =  IW_IMG_FORMAT_MOVIE, 
IW_IMG_FORMAT_AVI_RAW420, 
IW_IMG_FORMAT_AVI_MJPEG, 
 
  IW_IMG_FORMAT_AVI_FFV1, 
IW_IMG_FORMAT_AVI_MPEG4, 
IW_IMG_FORMAT_MOVIE_MAX =  IW_IMG_FORMAT_AVI_MPEG4, 
IW_IMG_FORMAT_VECTOR =  200, 
 
  IW_IMG_FORMAT_SVG =  IW_IMG_FORMAT_VECTOR
 
 } | 
| enum   | iwType {  
  IW_8U, 
IW_16U, 
IW_32S, 
IW_FLOAT, 
 
  IW_DOUBLE
 
 } | 
| enum   | iwImgStatus {  
  IW_IMG_STATUS_OK, 
IW_IMG_STATUS_OPEN, 
IW_IMG_STATUS_READ, 
IW_IMG_STATUS_WRITE, 
 
  IW_IMG_STATUS_MEM, 
IW_IMG_STATUS_FORMAT, 
IW_IMG_STATUS_ERR, 
IW_IMG_STATUS_MAX
 
 } | 
| enum   | iwImgFree { IW_IMG_FREE_PLANE =  1 << 0, 
IW_IMG_FREE_PLANEPTR =  1 << 1, 
IW_IMG_FREE_CTAB =  1 << 2, 
IW_IMG_FREE_STRUCT =  1 << 3
 } | 
Functions | 
| gboolean  | iw_img_allocate (iwImage *img) | 
| gboolean  | iw_img_alloc_planeptr (iwImage *img) | 
| void  | iw_img_init (iwImage *img) | 
| iwImage *  | iw_img_new (void) | 
| iwImage *  | iw_img_new_alloc (int width, int height, int planes, iwType type) | 
| void  | iw_img_free (iwImage *img, iwImgFree what) | 
| void  | iw_img_copy_ctab (const iwImage *src, iwImage *dst) | 
| iwImage *  | iw_img_copy (const iwImage *src, iwImage *dst) | 
| iwImage *  | iw_img_duplicate (const iwImage *img) | 
| iwImage *  | iw_img_load (const char *fname, iwImgStatus *status) | 
| iwImage *  | iw_img_load_interleaved (const char *fname, iwImgStatus *status) | 
| void  | iw_movie_close (iwMovie *movie) | 
| iwMovie *  | iw_movie_open (const char *fname, iwImgStatus *status) | 
| iwImage *  | iw_movie_read (iwMovie **movie, const char *fname, int frame, iwImgStatus *status) | 
| float  | iw_movie_get_framerate (const iwMovie *movie) | 
| int  | iw_movie_get_framecnt (const iwMovie *movie) | 
| int  | iw_movie_get_framepos (iwMovie *movie) | 
| iwImgFileData *  | iw_img_data_create (void) | 
| void  | iw_img_data_free (iwImgFileData *data) | 
| void  | iw_img_data_set_movie (iwImgFileData *data, iwMovie **movie, float framerate) | 
| void  | iw_img_data_set_quality (iwImgFileData *data, int quality) | 
| iwImgFormat  | iw_img_save_get_format (iwImgFormat format, const char *fname) | 
| iwImgStatus  | iw_img_save (const iwImage *img, iwImgFormat format, const char *fname, const iwImgFileData *data) | 
Macro Definition Documentation
      
        
          | #define IW_FOURCC | 
          ( | 
            | 
          a,  | 
        
        
           | 
           | 
            | 
          b,  | 
        
        
           | 
           | 
            | 
          c,  | 
        
        
           | 
           | 
            | 
          d  | 
        
        
           | 
          ) | 
           |    ((unsigned int)((((unsigned int)d)<<24)+(((unsigned int)c)<<16)+(((unsigned int)b)<<8)+a)) | 
        
      
 
 
Color formats of the data for prev_render...() 
 
 
Only the first plane is used 
 
 
Only the first plane is used 
 
 
      
        
          | #define IW_COLFORMAT_MAX   IW_BW | 
        
      
 
Last 'special' definition 
 
 
      
        
          | #define IW_MOVIE_NEXT_FRAME   (-1) | 
        
      
 
 
      
        
          | #define IW_MOVIE_PREV_FRAME   (-2) | 
        
      
 
 
Size of image data type in bytes 
 
 
      
        
          | #define IW_TYPE_MIN | 
          ( | 
            | 
          i | ) | 
             (iwTypeMin[(i)->type]) | 
        
      
 
Min. representable value for the image data type 
 
 
      
        
          | #define IW_TYPE_MAX | 
          ( | 
            | 
          i | ) | 
             (iwTypeMax[(i)->type]) | 
        
      
 
Max. representable value for the image data type 
 
 
Typedef Documentation
      
        
          | typedef guchar(* iwColtab)[3] | 
        
      
 
 
Enumeration Type Documentation
Possible image file formats 
- Enumerator: 
 
| IW_IMG_FORMAT_UNKNOWN  | 
 | 
| IW_IMG_FORMAT_PNM  | 
 | 
| IW_IMG_FORMAT_PNG  | 
 | 
| IW_IMG_FORMAT_JPEG  | 
 | 
| IW_IMG_FORMAT_MOVIE  | 
 First movie format  
 | 
| IW_IMG_FORMAT_AVI_RAW444  | 
 | 
| IW_IMG_FORMAT_AVI_RAW420  | 
 | 
| IW_IMG_FORMAT_AVI_MJPEG  | 
 | 
| IW_IMG_FORMAT_AVI_FFV1  | 
 | 
| IW_IMG_FORMAT_AVI_MPEG4  | 
 | 
| IW_IMG_FORMAT_MOVIE_MAX  | 
 Last movie format  
 | 
| IW_IMG_FORMAT_VECTOR  | 
 | 
| IW_IMG_FORMAT_SVG  | 
 | 
 
 
 
Possible image data types 
- Enumerator: 
 
| IW_8U  | 
 | 
| IW_16U  | 
 | 
| IW_32S  | 
 | 
| IW_FLOAT  | 
 | 
| IW_DOUBLE  | 
 | 
 
 
 
- Enumerator: 
 
| IW_IMG_STATUS_OK  | 
 | 
| IW_IMG_STATUS_OPEN  | 
 Unable to open file  
 | 
| IW_IMG_STATUS_READ  | 
 Read error  
 | 
| IW_IMG_STATUS_WRITE  | 
 Write error  
 | 
| IW_IMG_STATUS_MEM  | 
 Unable to allocate memory  
 | 
| IW_IMG_STATUS_FORMAT  | 
 File format not supported (png, ...)  
 | 
| IW_IMG_STATUS_ERR  | 
 Another error  
 | 
| IW_IMG_STATUS_MAX  | 
 | 
 
 
 
Flags specifying what to free during iw_img_free() 
- Enumerator: 
 
| IW_IMG_FREE_PLANE  | 
 img->data[x]  
 | 
| IW_IMG_FREE_PLANEPTR  | 
 img->data  
 | 
| IW_IMG_FREE_CTAB  | 
 img->ctab  
 | 
| IW_IMG_FREE_STRUCT  | 
 img  
 | 
 
 
 
Function Documentation
      
        
          | gboolean iw_img_allocate  | 
          ( | 
          iwImage *  | 
          img | ) | 
           | 
        
      
 
  Allocate memory for img->data and img->data[] according to the
   other settings in img.
   Return: TRUE if memory could be allocated.
 
 
 
      
        
          | gboolean iw_img_alloc_planeptr  | 
          ( | 
          iwImage *  | 
          img | ) | 
           | 
        
      
 
  Allocate memory only for img->data (and NOT img->data[]) according
   to the other settings in img.
   Return: TRUE if memory could be allocated.
 
 
 
  Initialise image img by setting everything to 0.
   Do NOT allocate any memory.
 
 
 
  Allocate a new image and set everything to 0. -> Do NOT allocate
   any image data.
 
 
 
      
        
          | iwImage* iw_img_new_alloc  | 
          ( | 
          int  | 
          width,  | 
        
        
           | 
           | 
          int  | 
          height,  | 
        
        
           | 
           | 
          int  | 
          planes,  | 
        
        
           | 
           | 
          iwType  | 
          type  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
  Allocate and initialise a new img and allocate memory for
   img->data and img->data[].
 
 
 
  Free parts of the image. 'what' specifies what to free.
 
 
 
  If src has an own indexed color tabel, allocate a new one for dst
   and copy the table. Otherwise set the ctab entry of dst to the one
   of src.
 
 
 
  Copy src to dst, allocate all plane pointer, planes, and color
   tables, and return a pointer to dst, or NULL on error (no mem).
 
 
 
  Return a copy of the image img. All plane pointer, planes, and
   color tables are also copied.
 
 
 
  Load image from file fname in 'planed' form.
 
 
 
  Load image from file fname and return an interleaved image.
 
 
 
      
        
          | void iw_movie_close  | 
          ( | 
          iwMovie *  | 
          movie | ) | 
           | 
        
      
 
  Close movie file if it is != NULL and free all associated data.
 
 
 
  Open the movie file fname for reading.
 
 
 
  Open the movie 'fname' (if not already open) and return its frame
   'frame'.
   ATTENTION: The returned frame is a pointer to an internally used
   image which is freed by iw_movie_close().
 
 
 
      
        
          | float iw_movie_get_framerate  | 
          ( | 
          const iwMovie *  | 
          movie | ) | 
           | 
        
      
 
  Return frame rate of 'movie'.
 
 
 
      
        
          | int iw_movie_get_framecnt  | 
          ( | 
          const iwMovie *  | 
          movie | ) | 
           | 
        
      
 
  Return number of frames of 'movie'.
 
 
 
      
        
          | int iw_movie_get_framepos  | 
          ( | 
          iwMovie *  | 
          movie | ) | 
           | 
        
      
 
  Return the number of the frame, which was the result of the
   last call to iw_movie_read()
 
 
 
  Initialise struct holding settings for saving images.
 
 
 
  Free struct created with iw_img_create_data().
 
 
 
  Set parameters used for MOVIE saving.
 
 
 
      
        
          | void iw_img_data_set_quality  | 
          ( | 
          iwImgFileData *  | 
          data,  | 
        
        
           | 
           | 
          int  | 
          quality  | 
        
        
           | 
          ) | 
           |  | 
        
      
 
  Set quality parameter (used for JPEG saving),
 
 
 
  If 'format' == IW_IMG_FORMAT_UNKNOWN return a format based on the
   extension of fname. Otherwise return 'format'.
 
 
 
  Save 'img' in file 'fname' in the format 'format'. If
   'format' == IW_IMG_FORMAT_UNKNOWN the extension of fname is used.
 
 
 
Variable Documentation
PRIVATE, only for next macro 
 
 
      
        
          | char* iwImgFormatTextBM[] | 
        
      
 
 
PRIVATE, only for next macros 
 
 
PRIVATE, only for next macros 
 
 
PRIVATE, only for next macros