44 G_EXCEPTION( ReadError ,
"cannot read image" ) ;
75 shared_ptr<ImageBuffer>
recycle() ;
90 shared_ptr<const ImageBuffer>
ptr()
const ;
97 static void read( std::istream & ,
Image & ,
const std::string & exception_help_text = std::string() ) ;
120 shared_ptr<const ImageBuffer> m_ptr ;
shared_ptr< const ImageBuffer > ptr() const
Returns the image data shared pointer.
size_t size() const
Returns the image data total size.
static bool receive(G::PublisherSubscription &channel, Image &, std::string &type_str)
Reads a publication channel into an image.
void clear()
Clears the image as if default constructed.
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.
An easy-to-use combination of a G::PublisherChannel object and a single G::PublisherSubscriber.
bool empty() const
Returns true if constructed with no image data.
A class holding shared read-only image data (Gr::ImageBuffer) and its associated image type (Gr::Imag...
static void read(std::istream &, Image &, const std::string &exception_help_text=std::string())
Reads an input stream into an image. Throws on error.
static ImageBuffer * blank(Image &, ImageType raw_type, bool contiguous=false)
Factory function for a not-really-blank raw image that is temporarily writable via the returned image...
bool valid() const
Returns !empty() && type().valid().
ImageType type() const
Returns the image type.
const ImageBuffer & data() const
Returns the image data.
shared_ptr< ImageBuffer > recycle()
Creates a new shared pointer that can be deposited into a new Image, but if the current Image is not ...
Image()
Default constructor for an empty() image with an in-valid() type() and a null ptr().
static bool peek(G::PublisherSubscription &channel, Image &, std::string &type_str)
A variant on receive() that does a channel peek().