24#include <core/exceptions/system.h>
25#include <fvutils/writers/seq_writer.h>
48 this->writer = writer;
76 this->img_path = strdup(img_path);
77 printf(
"SeqWriter: img path set to %s\n", this->img_path);
89 this->filename = strdup(filename);
108 this->cspace = cspace;
121 time_t now = time(NULL);
123 struct timeval now_tv;
125 gettimeofday(&now_tv, NULL);
126 localtime_r(&now, &now_tm);
129 if (asprintf(×tring,
130 "%04d%02d%02d_%02d%02d%02d_%06ld",
131 now_tm.tm_year + 1900,
145 if (asprintf(&fn,
"%s/%s_%s-%04u", img_path, timestring, filename, frame_number) == -1) {
149 if (asprintf(&fn,
"%s_%s-%04u", timestring, filename, frame_number) == -1) {
156 if (asprintf(&fn,
"%s/%s-%04u", img_path, timestring, frame_number) == -1) {
160 if (asprintf(&fn,
"%s-%04u", timestring, frame_number) == -1) {
Base class for exceptions in Fawkes.
System ran out of memory and desired operation could not be fulfilled.
void set_dimensions(unsigned int width, unsigned int height)
Set the image dimensions.
SeqWriter(Writer *writer)
Constructor.
void set_colorspace(colorspace_t cspace)
Set the colorspace of the image.
void write(unsigned char *buffer)
Write a single image to disk.
void set_path(const char *img_path)
Set the path to where the images are stored.
void set_filename(const char *filename)
Set a (base-) filename.
Interface to write images.
virtual void set_dimensions(unsigned int width, unsigned int height)
Set dimensions of image in pixels.
virtual void write()=0
Write to file.
virtual void set_filename(const char *filename)
Set filename.
virtual void set_buffer(colorspace_t cspace, unsigned char *buffer)
Set image buffer.
Fawkes library namespace.