Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members

PLearn::RGBImageVMatrix Class Reference

#include <RGBImage.h>

Inheritance diagram for PLearn::RGBImageVMatrix:

Inheritance graph
[legend]
Collaboration diagram for PLearn::RGBImageVMatrix:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 RGBImageVMatrix (RGBImage image, const Vec &delta_row, const Vec &delta_col, real scale=1.0, real offset_=0.0)
virtual int width ()
virtual int length ()
virtual void reset ()
virtual void sample (Vec &samplevec)
virtual void seek (int position)
virtual int position ()
virtual bool first ()
 short hand for (position()==0)

void setImage (RGBImage new_image)
 replace the active image by this one


Protected Attributes

RGBImage image
Vec delta_row
 row displacement of neighbors

Vec delta_column
 column displacement of neighbors

real scale
 preprocessing of RGB values:

real offset_
 new_pixel = (old_pixel + offset_)*scale;

int width_
 (neighbors.length()+1)*3

int max_delta_row
int max_delta_column
int first_row
 first row that we can sample

int first_column
 first column that we can sample

int bottom_border_row
 first row that is in the bottom border

int right_border_col
 first column that is in the right border

int n_cols
 right_border_col-first_column

int current_i
int current_j
 current (row,column) of target pixel


Detailed Description

RGBImageVMatrix is a subclass of distribution that allows to sample pixels from an RGB image, along with neighboring pixels. Sampling from this distribution gives a vector containing first the value of the chosen neighbors of the pixel and after the the value of the pixel itself. The neighbors are specified by relative row and column positions. The distribution cycles in left-to-right top-down order through all the pixels (except the borders where the neighbors are outside the image). RGB values may be translated and then scaled if scale and offset_are given.

Definition at line 222 of file RGBImage.h.


Constructor & Destructor Documentation

PLearn::RGBImageVMatrix::RGBImageVMatrix RGBImage  image,
const Vec delta_row,
const Vec delta_col,
real  scale = 1.0,
real  offset_ = 0.0
 

The delta_row and delta_col vectors specify the relative position of the neighbors whose RGB values will be put before the "target" pixel's RGB values in each sample. Scale and offset_allow to linearly transform each R, G, and B value, with new_pixel = (old_pixel + offset_)*scale

Definition at line 390 of file RGBImage.cc.

References bottom_border_row, delta_column, delta_row, first_column, first_row, PLearn::RGBImage::height(), image, PLearn::TVec< T >::length(), MAX, PLearn::max(), max_delta_column, max_delta_row, MIN, PLearn::min(), n_cols, PLERROR, reset(), right_border_col, PLearn::Vec, PLearn::RGBImage::width(), and width_.


Member Function Documentation

virtual bool PLearn::RGBImageVMatrix::first  )  [inline, virtual]
 

short hand for (position()==0)

Definition at line 261 of file RGBImage.h.

References current_i, current_j, first_column, and first_row.

Referenced by PLearn::RGBImagesVMatrix::firstSampleOfObject(), and PLearn::RGBImagesVMatrix::sample().

int PLearn::RGBImageVMatrix::length  )  [virtual]
 

Definition at line 443 of file RGBImage.cc.

References bottom_border_row, first_row, and n_cols.

Referenced by PLearn::RGBImagesVMatrix::nSamplesOfObject(), PLearn::RGBImagesVMatrix::RGBImagesVMatrix(), and seek().

int PLearn::RGBImageVMatrix::position  )  [virtual]
 

Definition at line 464 of file RGBImage.cc.

References current_i, current_j, first_column, first_row, and n_cols.

Referenced by PLearn::RGBImagesVMatrix::position().

void PLearn::RGBImageVMatrix::reset  )  [virtual]
 

Definition at line 449 of file RGBImage.cc.

References current_i, current_j, first_column, and first_row.

Referenced by PLearn::RGBImagesVMatrix::reset(), RGBImageVMatrix(), and setImage().

void PLearn::RGBImageVMatrix::sample Vec samplevec  )  [virtual]
 

Definition at line 469 of file RGBImage.cc.

References PLearn::RGB::b, bottom_border_row, current_i, current_j, PLearn::TVec< T >::data(), delta_column, delta_row, first_column, first_row, PLearn::RGB::g, PLearn::RGBImage::getPixel(), image, PLearn::TVec< T >::length(), offset_, PLearn::RGB::r, PLearn::TVec< T >::resize(), right_border_col, PLearn::sample(), sample(), scale, and width_.

Referenced by PLearn::RGBImagesVMatrix::sample(), and sample().

void PLearn::RGBImageVMatrix::seek int  position  )  [virtual]
 

Definition at line 455 of file RGBImage.cc.

References current_i, current_j, first_column, first_row, length(), n_cols, and PLERROR.

Referenced by PLearn::RGBImagesVMatrix::seek().

void PLearn::RGBImageVMatrix::setImage RGBImage  new_image  ) 
 

replace the active image by this one

Definition at line 424 of file RGBImage.cc.

References bottom_border_row, delta_row, first_column, PLearn::RGBImage::height(), image, PLearn::TVec< T >::length(), max_delta_column, max_delta_row, MIN, n_cols, reset(), right_border_col, and PLearn::RGBImage::width().

Referenced by PLearn::RGBImagesVMatrix::reset(), PLearn::RGBImagesVMatrix::RGBImagesVMatrix(), PLearn::RGBImagesVMatrix::sample(), and PLearn::RGBImagesVMatrix::seek().

int PLearn::RGBImageVMatrix::width  )  [virtual]
 

Definition at line 446 of file RGBImage.cc.

References width_.

Referenced by PLearn::RGBImagesVMatrix::RGBImagesVMatrix().


Member Data Documentation

int PLearn::RGBImageVMatrix::bottom_border_row [protected]
 

first row that is in the bottom border

Definition at line 236 of file RGBImage.h.

Referenced by length(), RGBImageVMatrix(), sample(), and setImage().

int PLearn::RGBImageVMatrix::current_i [protected]
 

Definition at line 239 of file RGBImage.h.

Referenced by first(), position(), reset(), sample(), and seek().

int PLearn::RGBImageVMatrix::current_j [protected]
 

current (row,column) of target pixel

Definition at line 239 of file RGBImage.h.

Referenced by first(), position(), reset(), sample(), and seek().

Vec PLearn::RGBImageVMatrix::delta_column [protected]
 

column displacement of neighbors

Definition at line 229 of file RGBImage.h.

Referenced by RGBImageVMatrix(), and sample().

Vec PLearn::RGBImageVMatrix::delta_row [protected]
 

row displacement of neighbors

Definition at line 228 of file RGBImage.h.

Referenced by RGBImageVMatrix(), sample(), and setImage().

int PLearn::RGBImageVMatrix::first_column [protected]
 

first column that we can sample

Definition at line 235 of file RGBImage.h.

Referenced by first(), position(), reset(), RGBImageVMatrix(), sample(), seek(), and setImage().

int PLearn::RGBImageVMatrix::first_row [protected]
 

first row that we can sample

Definition at line 234 of file RGBImage.h.

Referenced by first(), length(), position(), reset(), RGBImageVMatrix(), sample(), and seek().

RGBImage PLearn::RGBImageVMatrix::image [protected]
 

Definition at line 227 of file RGBImage.h.

Referenced by RGBImageVMatrix(), sample(), and setImage().

int PLearn::RGBImageVMatrix::max_delta_column [protected]
 

Definition at line 233 of file RGBImage.h.

Referenced by RGBImageVMatrix(), and setImage().

int PLearn::RGBImageVMatrix::max_delta_row [protected]
 

Definition at line 233 of file RGBImage.h.

Referenced by RGBImageVMatrix(), and setImage().

int PLearn::RGBImageVMatrix::n_cols [protected]
 

right_border_col-first_column

Definition at line 238 of file RGBImage.h.

Referenced by length(), position(), RGBImageVMatrix(), seek(), and setImage().

real PLearn::RGBImageVMatrix::offset_ [protected]
 

new_pixel = (old_pixel + offset_)*scale;

Definition at line 231 of file RGBImage.h.

Referenced by sample().

int PLearn::RGBImageVMatrix::right_border_col [protected]
 

first column that is in the right border

Definition at line 237 of file RGBImage.h.

Referenced by RGBImageVMatrix(), sample(), and setImage().

real PLearn::RGBImageVMatrix::scale [protected]
 

preprocessing of RGB values:

Definition at line 230 of file RGBImage.h.

Referenced by sample().

int PLearn::RGBImageVMatrix::width_ [protected]
 

(neighbors.length()+1)*3

Definition at line 232 of file RGBImage.h.

Referenced by RGBImageVMatrix(), sample(), and width().


The documentation for this class was generated from the following files:
Generated on Tue Aug 17 16:23:08 2004 for PLearn by doxygen 1.3.7