00001
00002
00003
00004
00005
00011 #ifndef SEQUENCE_H
00012 #define SEQUENCE_H
00013
00014 #ifdef HAVE_CONFIG_H
00015 #include <config.h>
00016 #endif
00017
00018 #include <assert.h>
00019 #include <string.h>
00020 #include <stdlib.h>
00021 #include <dirent.h>
00022
00023 #include "FW/labImage.h"
00024 #include "Camera.h"
00025 #ifdef HAVE_V4L
00026 #include "V4LCamera.h"
00027 #endif
00028 #ifdef HAVE_V4L2
00029 #include "V4L2Camera.h"
00030 #endif
00031 #ifdef HAVE_QUICKCAM
00032 #include "QuickCam.h"
00033 #include "qcam.h"
00034 #endif
00035
00036 #define MAXSEQNAMELEN 256
00037 #define MAXSOURCE 4096
00038
00042 typedef enum {
00043 OTHER,
00044 #ifdef HAVE_V4L
00045 V4L,
00046 #endif
00047 #ifdef HAVE_V4L2
00048 V4L2,
00049 #endif
00050 #ifdef HAVE_QUICKCAM
00051 QCAM,
00052 #endif
00053 PIXMAP
00054 } imageSeqType;
00055
00059 typedef enum {
00060 LOOP,
00061 BOUNCE,
00062 NOLOOP
00063 } imageSeqLoopType;
00064
00065 class imageSeq {
00066
00067 public:
00071 typedef enum {
00072 FORWARD,
00073 BACKWARD
00074 } directionType;
00075
00077 imageSeq(imageSeqType type, const char *path);
00079 ~imageSeq();
00080
00089 static int file_select(const struct dirent *entry);
00090
00092 int getNumFrames(void);
00093
00098 Picture* tick(int frames=1);
00099
00101 Picture* getCurrent(void);
00102
00104 int getWidth(void);
00105
00107 int getHeight(void);
00108
00110 imageSeqType getSeqType(void);
00111
00113 bool getCameraReady(void);
00114
00116 Camera *getCamera(void);
00117
00119 char *getInfo(void);
00120
00121 private:
00123 char *seqPath;
00125 char seqInfo[MAXSOURCE];
00127 char **namelist;
00128
00130 imageSeqLoopType loopType;
00132 imageSeqType seqType;
00134 directionType direction;
00136 Picture** pics;
00138 Picture* current;
00140 int currentIndex;
00141
00143 int numFrames;
00145 int width;
00147 int height;
00148
00150 void GetSFiles(const char *dirpath, char *sinfo);
00151
00153 Camera *camera;
00155 bool cameraReady;
00156
00157 };
00158
00159 #endif
00160