00001
00002 #ifndef INCLUDED_FileSystemImageSource_h_
00003 #define INCLUDED_FileSystemImageSource_h_
00004
00005 #include "FileSystemDataSource.h"
00006
00007
00008 class FileSystemImageSource : public FileSystemDataSource {
00009 public:
00010
00011 FileSystemImageSource(LoggedDataDriver& p, const std::string& filter)
00012 : FileSystemDataSource(p,filter), layer(0)
00013 {
00014 addEntry("Layer",layer,"Controls the resolution layer at which the image should be processed.\n0 indicates \"automatic\" mode (picks layer closest to image's resolution), positive numbers indicate the resolution layer directly.\nNegative values are relative to the number of layers marked available by the vision setup, so that typically -1 would correspond to the \"double\" layer, and -2 would correspond to the \"full\" layer.");
00015 }
00016
00017
00018
00019
00020
00021
00022
00023
00024 plist::Primitive<int> layer;
00025
00026 protected:
00027
00028
00029 virtual void updateProvidingOutputs() {}
00030
00031
00032 class ImageInfo : public FileInfo {
00033 public:
00034
00035 ImageInfo(const FileSystemImageSource& ds, const std::string& name, float time) : FileInfo(name,time), dataSource(ds), width(), height(), components() {}
00036
00037
00038 virtual void prepare();
00039
00040
00041 virtual size_t getHeaderSize() const;
00042
00043 virtual size_t writeHeader(char* buf, size_t size) const;
00044
00045
00046 const FileSystemImageSource& dataSource;
00047 size_t width;
00048 size_t height;
00049 size_t components;
00050 };
00051
00052 virtual void enqueueFile(const std::string& name, float lifetime) { files.push_back(new ImageInfo(*this,name,lifetime)); }
00053 };
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066 #endif