VideoTools
|
Implements a binary mask over an image that can be edited by mouse actions, and that can be stored on disk. More...
#include <gvmask.h>
Public Member Functions | |
Mask (int dx, int dy, const std::string &file=std::string(), bool create=false) | |
Constructor, optionally reading the mask from an existing file. More... | |
bool | empty () const |
Returns true if empty. | |
void | write (const G::Path &filename) const |
Writes to file. | |
bool | update () |
Updates the mask from the file. Returns true if updated. | |
void | scale (int factor) |
Scales down. | |
void | up (int x, int y, bool shift, bool control) |
Called on mouse-up. Commits any down()/move() edits. | |
void | move (int x, int y) |
Called on mouse-move. Modifies the current edit. | |
void | down (int x, int y, bool shift, bool control) |
Called on mouse-down. Starts an edit. | |
bool | masked (int x, int y) const |
Returns true if the pixel is masked. | |
bool | masked (size_t) const |
Optimised overload, ignoring the current edit. | |
G::EpochTime | time () const |
Returns the timestamp on the mask file at construction, not affected by any calls to write(). More... | |
Implements a binary mask over an image that can be edited by mouse actions, and that can be stored on disk.
Gv::Mask::Mask | ( | int | dx, |
int | dy, | ||
const std::string & | file = std::string() , |
||
bool | create = false |
||
) |
Constructor, optionally reading the mask from an existing file.
If the file is a different size from the parameters then its contents are resampled to fit.
Definition at line 37 of file gvmask.cpp.
G::EpochTime Gv::Mask::time | ( | ) | const |
Returns the timestamp on the mask file at construction, not affected by any calls to write().
Definition at line 129 of file gvmask.cpp.