#include <RGBImage.h>
Collaboration diagram for PLearn::RGBImage:
Public Member Functions | |
RGBImage (int the_height=0, int the_width=0) | |
RGBImage (Mat r, Mat g, Mat b) | |
r g and b must have values in range [0-255] | |
~RGBImage () | |
int | width () const |
int | height () const |
void | resize (int newheight, int newwidth) |
RGB | getPixel (int i, int j) const |
return RGB value of Pixel of row i and column j | |
void | setPixel (int i, int j, RGB value) |
sets RGB value of pixel in row i and column j | |
void | fill (RGB color) |
void | clear () |
void | loadPPM (const char *filename) |
void | savePPM (const char *filename) const |
void | loadJPEG (const char *filename, int scale=1) |
void | display () const |
void | displayAndWait () const |
void | removeBorders (int top_border, int bottom_border, int left_border, int right_border) |
remove borders around the image | |
void | removeBorders (int border) |
remove borders of thickness "border" from image (in-place), on all sides | |
void | shrinkToIntersection (int &i, int &j, int &h, int &w) const |
shrinks the box that starts at position (i,j) (in this image) and of size (h,w) to its intersection with this image's box (0,0,this->height,this->width_) | |
void | blit (int desti, int destj, RGBImage srcim) |
blits srcim at position (desti,destj) in this image | |
RGB | computeAverage () const |
Vec | computeHistogram (int r_bins=16, int g_bins=16, int b_bins=16, bool do_normalize=false) |
Returns a vector of size r_bins*g_bins*b_bins which contains the number of image pixels whose colors fell in the corresponding RGB range. | |
Protected Attributes | |
int | height_ |
int | width_ |
PP< Storage< RGB > > | storage |
char | tmpfilename [100] |
temporary file in which the image may be saved when displayed |
Definition at line 103 of file RGBImage.h.
|
Definition at line 64 of file RGBImage.cc. References clear(), height_, storage, tmpfilename, and width_. |
|
r g and b must have values in range [0-255]
Definition at line 75 of file RGBImage.cc. References height_, PLearn::Mat, setPixel(), storage, tmpfilename, and width_. |
|
Definition at line 86 of file RGBImage.cc. References tmpfilename. |
|
blits srcim at position (desti,destj) in this image
Definition at line 224 of file RGBImage.cc. References getPixel(), height_, setPixel(), shrinkToIntersection(), and width_. |
|
Definition at line 124 of file RGBImage.h. Referenced by RGBImage(). |
|
Definition at line 244 of file RGBImage.cc. References PLearn::RGB::b, PLearn::RGB::g, height_, PLERROR, PLearn::RGB::r, storage, and width_. |
|
Returns a vector of size r_bins*g_bins*b_bins which contains the number of image pixels whose colors fell in the corresponding RGB range.
Definition at line 264 of file RGBImage.cc. References PLearn::RGB::b, PLearn::RGB::g, getPixel(), height_, PLearn::RGB::r, and width_. Referenced by PLearn::RGBImageDB::computeHistogramRepresentation(). |
|
Definition at line 180 of file RGBImage.cc. References savePPM(), and tmpfilename. |
|
Definition at line 200 of file RGBImage.cc. References savePPM(), and tmpfilename. |
|
Definition at line 128 of file RGBImage.cc. References PLearn::color(), height_, PLERROR, storage, and width_. |
|
return RGB value of Pixel of row i and column j
Definition at line 153 of file RGBImage.h. References height_, PLERROR, storage, and width_. Referenced by blit(), computeHistogram(), and PLearn::RGBImageVMatrix::sample(). |
|
Definition at line 118 of file RGBImage.h. References height_. Referenced by PLearn::RGBImageVMatrix::RGBImageVMatrix(), and PLearn::RGBImageVMatrix::setImage(). |
|
Definition at line 189 of file RGBImage.cc. References PLearn::endl(), loadPPM(), and tmpfilename. Referenced by PLearn::RGBImageDB::getImage(). |
|
Definition at line 138 of file RGBImage.cc. References height_, PLERROR, PLWARNING, resize(), storage, and width_. Referenced by loadJPEG(). |
|
remove borders of thickness "border" from image (in-place), on all sides
Definition at line 137 of file RGBImage.h. References removeBorders(). |
|
remove borders around the image
Definition at line 103 of file RGBImage.cc. References height_, PLERROR, storage, and width_. Referenced by PLearn::RGBImageDB::getImage(), and removeBorders(). |
|
Definition at line 92 of file RGBImage.cc. |
|
Definition at line 162 of file RGBImage.cc. References PLearn::endl(), height_, PLERROR, PLWARNING, storage, and width_. Referenced by display(), and displayAndWait(). |
|
sets RGB value of pixel in row i and column j
Definition at line 165 of file RGBImage.h. References height_, PLERROR, storage, and width_. Referenced by blit(), and RGBImage(). |
|
shrinks the box that starts at position (i,j) (in this image) and of size (h,w) to its intersection with this image's box (0,0,this->height,this->width_)
Definition at line 210 of file RGBImage.cc. References height_, MAX, MIN, and width_. Referenced by blit(). |
|
Definition at line 117 of file RGBImage.h. References width_. Referenced by PLearn::RGBImageVMatrix::RGBImageVMatrix(), and PLearn::RGBImageVMatrix::setImage(). |
|
Definition at line 106 of file RGBImage.h. Referenced by blit(), computeAverage(), computeHistogram(), fill(), getPixel(), height(), loadPPM(), removeBorders(), resize(), RGBImage(), savePPM(), setPixel(), and shrinkToIntersection(). |
|
Definition at line 109 of file RGBImage.h. Referenced by computeAverage(), fill(), getPixel(), loadPPM(), removeBorders(), resize(), RGBImage(), savePPM(), and setPixel(). |
|
temporary file in which the image may be saved when displayed
Definition at line 110 of file RGBImage.h. Referenced by display(), displayAndWait(), loadJPEG(), RGBImage(), and ~RGBImage(). |
|
Definition at line 107 of file RGBImage.h. Referenced by blit(), computeAverage(), computeHistogram(), fill(), getPixel(), loadPPM(), removeBorders(), resize(), RGBImage(), savePPM(), setPixel(), shrinkToIntersection(), and width(). |