21 #ifndef GV_IMAGEOUTPUT__H
22 #define GV_IMAGEOUTPUT__H
57 void startViewer(
const std::string & title = std::string() ,
unsigned int scale = 1U ,
58 const std::string & output_channel = std::string() ) ;
72 void saveTo(
const std::string & base_dir ,
const std::string & name ,
bool fast ,
98 void sendText(
const char * data ,
size_t size ,
const std::string & type ) ;
101 const std::string &
dir()
const ;
104 static void path( std::string & out ,
const std::string & base_dir ,
const std::string & name ,
122 void commitFile( std::ofstream & ,
const G::Path & ) ;
123 static std::string viewer(
const G::Path & ) ;
124 static std::string sanitise(
const std::string & ) ;
125 void onPingTimeout() ;
128 unique_ptr<GNet::Timer<ImageOutput> > m_ping_timer_ptr ;
129 std::string m_base_dir ;
133 bool m_save_test_mode ;
134 unique_ptr<G::Publisher> m_publisher ;
135 unique_ptr<G::FatPipe> m_fat_pipe ;
void startViewer(const std::string &title=std::string(), unsigned int scale=1U, const std::string &output_channel=std::string())
Starts the viewer.
A subsecond-resolution timestamp based on a time_t.
const std::string & dir() const
Returns the saveTo() path.
An abstract interface for handling exceptions thrown out of event-loop callbacks (socket events and t...
A representation of a timezone.
G::Path send(const char *data, size_t size, Gr::ImageType type, G::EpochTime=G::EpochTime(0))
Emits an image. Returns the path if saveTo()d the filesystem.
A class for emiting images etc to a fat pipe that feeds a spawned viewer process, and/or to a publica...
An encapsulation of image type, including width, height and number of channels, with support for a st...
Vectors ImageBuffer
An ImageBuffer is used to hold raw image data, typically in more than one chunk.
static void path(std::string &out, const std::string &base_dir, const std::string &name, G::EpochTime, Gr::ImageType type, bool fast, const Gv::Timezone &tz, bool test_mode)
Returns by reference the filesystem path corresponding to the given base directory and timestamp...
void saveTo(const std::string &base_dir, const std::string &name, bool fast, const Gv::Timezone &tz, bool test_mode=false)
Saves images to the filesystem inside a deeply-nested directory hierarchy with the given base directo...
bool fast() const
Returns the saveTo() fast flag.
~ImageOutput()
Destructor.
bool viewing() const
Returns true if startViewer() has been called.
ImageOutput()
Constructor.
void pingViewerCheck()
Checks that the viewer is running if it should be (see pingViewer()), and throws an exeception if not...
A variant class holding a string, an item map keyed by name, or an ordered list of items...
A broadcast communication channel between unrelated processes using shared memory.
void startPublisher(const std::string &channel)
Starts the publisher channel.
bool pingViewer()
Returns true if the viewer seems to be running.
A Path object represents a file system path.
void sendText(const char *data, size_t size, const std::string &type)
Emits a non-image message. Non-image messages are not saveTo()d the filesystem.