#include <Image.h>
Inheritance diagram for Conjecture::Image:
Although arbitrary graphical formats will be supported, all formats will be converted to pnm, and the internal memory representation will be pnm-based (mostly pgm, greyscale).
Public Member Functions | |
Image (const std::string &file, bool verbose=false) | |
Image (const Image *src, const Coord &topleft, const Coord &bottomright, const ImageArgs &config) | |
~Image () | |
u1 | get (u2 x, u2 y) const |
Obtain the pixel value for position <x,y>. | |
u1 | get (const Coord &pos) const |
void | set (u2 x, u2 y, int val) |
void | set (const Coord &pos, int val) |
bool | writeMono (const std::string &filebase, bool verbose=false) const |
bool | writeGrey (const std::string &filebase, bool verbose=false) const |
bool | writeColor (const std::string &filebase, bool verbose=false) const |
int | bytesPerPixel () const |
Coord | size () const |
The size (in pixels) of the image. | |
uint16_t | width () const |
The width (in pixels) of the image. | |
uint16_t | height () const |
The height (in pixels) of the image. | |
Static Public Member Functions | |
static void | test (int argc=0, const char *argv[]=NULL) |
Protected Member Functions | |
void | dataIs (pix *data) |
const pix * | data () const |
int | index (u2 x, u2 y) const |
Returns the one-dimensional index associated with point <x,y>. |
|
Create a copy of a sub-region of another Image. 'topleft' and 'bottomright' identify the pixel boundaries of the desired region, and are relative to <0,0> in the top left corner of 'src'. See the documentation of ImageConfig for the 'config' parameter. |
|
Destructor for Image instances. This destructor is critical, because images may be created and destroyed often (and allocate nested space). |
|
Images can be stored either monochrome, greyscale or color. The latter uses 3 bytes per pixel, the former two use 1 byte per pixel. FUTURE FIX: I assume pbm packs 8 into one byte?? FUTURE FIX: Should we not bother with color at all, and always read images in greyscale? Problem with this is that color may provide useful hints for partitioning and maybe even identification. For now, we maintain support for color, although the primary focus currently is on greyscale analysis. |
|
Unit testing method. This static method should create instances of the class (and instances of any other class necessary) and perform tests to ensure that all methods within the class are working as expected. |