Main Page | Class List | File List | Class Members

clip::picture_of_< PEL > Class Template Reference

The main class in CLIP. A picture_of_ is a one-plane (greylevel) image. More...

#include <picture.h>

List of all members.

Public Member Functions

 picture_of_ (const char *pnmname, const int bord=DEFAULT_BORDER)
 picture_of_ (const int r, const int c, const int bord=DEFAULT_BORDER)
 picture_of_ (const int r, const int c, const PEL *in, const int bord=DEFAULT_BORDER)
 Creates a picture from a 1D array of the pels in scan order. Rarely used.
template<typename OTHERPEL>  picture_of_ (const picture_of_< OTHERPEL > &other)
 Conventional copy constructor.
template<typename OTHERPEL>  picture_of_ (const colour_picture_of_< OTHERPEL > &other)
 Create from a colour_picture_of_int (includes conversion to monochrome).
 picture_of_ (const picture_of_< PEL > &source, PEL(*f)(PEL &, const PEL &))
 picture_of_ (const picture_of_< PEL > &source, int(*f)(PEL &, const PEL **))
 picture_of_ (const char *text, const int fg, const int bg, const int size=1)
int read (const char *name)
int write (const char *pgmname)
 Write picture to a PGM file. PGM is CLIP's "native" file format.
int aptwrite (const char *aptname, const int quality=100)
 Write picture in APT format. 0 <= quality <= 100. 100=lossless.
int bmpwrite (const char *bmpname)
 Write picture in BMP format. If you must.
int loadascolour (const colour_picture_of_< PEL > &other)
 ~picture_of_ ()
 Destructor.
void dc_pad ()
void zero_border ()
 Set values in the border of the picture to zero.
void symmetric_extension (int hlength, int vlength)
int nrows () const
 Return number of rows in picture.
int ncols () const
 Return number of columns in picture.
int bordersize () const
 Return width of border.
PEL max (int &reti, int &retj) const
PEL min (int &reti, int &retj) const
PEL max () const
 Return maximum value in picture.
PEL min () const
 Return minimum value in picture.
void max (const PEL clipval)
 Clip picture at given maximum value.
void min (const PEL clipval)
 Clip picture at given minimum value.
PEL total () const
 Return total of all pel values.
int rerange (const PEL newlow, const PEL newhigh, const bool scale_even_if_inside_range=0)
int map (const int myx, const int myy, const picture_of_ &from, const double fromx, const double fromy, const int transparency)
int map (const int myx, const int myy, const picture_of_ &from, const int fromx, const int fromy, const int transparency)
picture_of_mask (const picture_of_ &rb, const PEL &thresh, const PEL &below, const PEL &equal, const PEL &above)
int operator== (PEL testval)
 Return 1 if and only if every pel in the picture equals testval.
PEL ** bufptr ()
PEL * rowptr (int i)
PEL * rowptr (int i) const
 const version of the above for read only cases.
int wait (const int milliseconds)
Sequence processing facilities
Sequence processing facilities for "standard" CLIP programs. Many CLIP programs consist of a processing loop that cycles over input pictures from a sequence of named files or from a camera.

 picture_of_ (int argc, char *argv[], const int def_nrows=240, const int def_ncols=320, const int bord=DEFAULT_BORDER)
int next ()
Picture display functions
Use these functions to show or reshow the current picture on the screen

int show (const char *comment, const bool normalize=1)
int show (const bool n=1)
 Display picture without a specific title.
int showat (const int Nx, const int Ny, const bool normalize, const picture_of_ *parent)
int showat (const int Nx, const int Ny, const bool normalize, const colour_picture_of_< PEL > *parent)
 Display without decorations, with colour_picture_of_int as parent.
int showat (const int Nx, const int Ny, const bool normalize)
 Display without decorations at screen coords Nx, Ny.
int showat (const int Nx, const int Ny)
 Display without decorations at screen coords Nx, Ny.
int reshow (const char *comment, const bool normalize=1)
int reshow (const bool n=1)
 Redisplay the picture without altering the title.
int rename (const char *comment)
 Change title of the displayed pic.
int unshow ()
 Stop showing the picture.
int showascolour (const char *comment)
int showascolour ()
 As above, without window title.
int reshowascolour (const char *comment)
int reshowascolour ()
 As above, without change in window title.
int showascolourat (const int Nx, const int Ny, const picture_of_ *parent)
int showascolourat (const int Nx, const int Ny, const colour_picture_of_< PEL > *parent)
 As above with colour_picture_of_ parent.
int showascolourat (const int Nx, const int Ny)
 As above with no parent, i.e. at screen coordinates Nx, Ny.
int closerequested ()
int pointx ()
 Return current pointer (mouse) x coord relative to left of picture window.
int pointy ()
 Return current pointer (mouse) y coord relative to top of picture window.
int pointleftbutton ()
 Return non-zero if the mouse's left button is pressed within the picture's window.
int pointmiddlebutton ()
 Returns non-zero if mid button down.
int pointrightbutton ()
 Returns non-zero if right button down.
int pointshiftbutton ()
 Returns non-zero if the shift key is held down while a mouse button is down.
int key ()
 Returns keycode of any key held down.
int clearkey ()
 Clears keystroke so that it will not be reprocessed.
int inspect ()
Dereferencing operators
The following operator[]s are used to dereference (i.e. index) pictures. They must always be appended to a picture_of_int in pairs, with the first [] specifying a row value or range and the second [] specifying a column value or range. E.g.: picture_of_int a(r,c); a[y][x] = 255; So when using []s, picture_of_int looks like a two dimensional array. The difference is it can be indexed by iranges and doubles as well as by ints.

picture_of_< PEL > operator[] (const irange &selector) const
PEL * operator[] (const int &selector)
PEL * operator[] (const int &selector) const
clip_internal::double_dereferenced_picture_of_<
PEL > 
operator[] (const double selector)
int paste_centred_on (const picture_of_< PEL > &from, const int x, const int y)
int paste_centred_on (const colour_picture_of_< PEL > &from, const int x, const int y)
 As above, for colour_picture_of_ pasting.
point and neighbourhood operators via callbacks
PEL point (PEL(*f)(PEL &))
 Apply callback point function *f() over picture, modifying itself.
PEL point (const picture_of_< PEL > &rb, PEL(*f)(PEL &, const PEL &))
PEL neigh (picture_of_< PEL > &rb, PEL(*f)(PEL &, const PEL **))
Assignment operators
template<typename OTHERPEL> picture_of_< PEL > & operator= (const colour_picture_of_< OTHERPEL > &rb)
 Set picture_of_ equal to colour_picture_of_. Does conversion to monochrome.
template<typename OTHERPEL> picture_of_operator= (const picture_of_< OTHERPEL > &rb)
picture_of_operator= (const picture_of_< PEL > &rb)
 Set this picture equal to source picture with same pel data type.
picture_of_operator= (PEL newval)
template<typename OTHERPEL> picture_of_operator+= (const picture_of_< OTHERPEL > &rb)
picture_of_operator+= (PEL newval)
 Add newval to every pel.
template<typename OTHERPEL> picture_of_operator-= (const picture_of_< OTHERPEL > &rb)
picture_of_operator-= (PEL newval)
 Subtract newval from every pel.
template<typename OTHERPEL> picture_of_operator *= (const picture_of_< OTHERPEL > &rb)
picture_of_operator *= (PEL newval)
 Multiply every pel by newval.
template<typename OTHERPEL> picture_of_operator/= (const picture_of_< OTHERPEL > &rb)
picture_of_operator/= (PEL newval)
 Divide every pel by newval (unless newval == 0).
template<typename OTHERPEL> picture_of_operator|= (const picture_of_< OTHERPEL > &rb)
picture_of_operator|= (PEL newval)
 Replace every pel with its absolute difference from newval.
template<typename OTHERPEL> picture_of_operator^= (const picture_of_< OTHERPEL > &rb)
picture_of_operator^= (PEL newval)
 Replace every pel with its squared difference from newval.
template<typename OTHERPEL> picture_of_operator &= (const picture_of_< OTHERPEL > &rb)
Operators combining pictures to give PEL results
PEL operator+ (const picture_of_ &rb)
PEL operator- (const picture_of_ &rb)
 Return the sum of all pelwise subtractions.
PEL operator * (const picture_of_ &rb)
PEL operator/ (const picture_of_ &rb)
PEL operator| (const picture_of_ &rb)
 Return the sum of all pelwise absolute differences. Can be used for block matching.
PEL operator^ (const picture_of_ &rb)
 Return the sum of all pelwise squared differences. Can be used for block matching.
Functions for interfacing to a local camera
int attach_camera ()
int request_frame ()
int request_frame (int shutterspeed, int gain)
int frame_delivered ()
int detach_camera ()
Miscellaneous matrix manipulation functions
int reaspect (const picture_of_< PEL > &source)
int mx_mul (picture_of_< PEL > &A, picture_of_< PEL > &B)
int mx_transform (picture_of_< PEL > &transform, picture_of_< PEL > &source, const int use_transpose=0)
int mx_transpose (picture_of_< PEL > &A)
 Make this picture into the transpose of the source picture.
int mx_inverse (picture_of_< PEL > &A)
 Make this picture into the matrix inverse of the source picture.
int mx_eigenvalues (picture_of_< PEL > &A)
int mx_eigensystem (picture_of_< PEL > &A, picture_of_< PEL > &evecs)
int mx_eigenvector (picture_of_< PEL > &A, PEL evalue)
int mx_solve (picture_of_< PEL > &transform, picture_of_< PEL > &b)
PEL mx_determinant ()
 Return the determinant of this picture, treated as a matrix.
Miscellaneous graphics functions
int hramp ()
 Fill the picture with a horizontal ramp.
int vramp ()
 Fill the picture with a vertical ramp.
int draw_line (int x0, int y0, int x1, int y1, PEL value)
 Draw line of shade value from (x0,y0) to (x1,y1).
int draw_graph (const int *yvals, const int numvals, const PEL drawshade, int minval=-1, int maxval=-1)
Miscellaneous image processing functions
int sepconv (picture_of_ &other, const int hsize, const PEL *hkernel, const int vsize, const PEL *vkernel, const bool do_symmetric_extension=false)
PEL hconv (const picture_of_ &rb, const int hsize, const PEL *hkernel)
PEL vconv (const picture_of_ &rb, const int vsize, const PEL *vkernel)
int gaussfilter (picture_of_ &other, const double stddev)


Detailed Description

template<typename PEL>
class clip::picture_of_< PEL >

The main class in CLIP. A picture_of_ is a one-plane (greylevel) image.

picture_of_s are the basic type in CLIP: colour_picture_of_s are made out of them and for greylevel processing, they are all you need.


Constructor & Destructor Documentation

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ const char *  pnmname,
const int  bord = DEFAULT_BORDER
[inline]
 

Instantiates a picture by reading it in from a file. E.g. picture_of_int in("goldhill256"); sets up in and reads in goldhill256. The following file formats are read: PGM, PPM, JPEG, APT and the most common BMP formats. If the file is in colour, it is read and converted to monochrome. The bord argument specifies how many pels border to add around the picture. You don't have to allow for the border when indexing the picture. Having a border allows you to do, e.g., in[-1][-1] without causing a segmentation fault. This is useful when writing local operators that slide over the picture: You don't have to treat the edges specially.

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ const int  r,
const int  c,
const int  bord = DEFAULT_BORDER
[inline]
 

Instantiates a zeroed pic of given dimensions. E.g. picture_of_int pic(240,320); creates a zeroed (black) picture of size 320 columns by 240 rows.

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ const picture_of_< PEL > &  source,
PEL(*  f)(PEL &, const PEL &)
[inline]
 

Modify-source constructor that applies callback point function (*f) over source to create new picture.

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ const picture_of_< PEL > &  source,
int(*  f)(PEL &, const PEL **)
[inline]
 

Modify-source constructor that applies callback neighbourhood function (*f) over source to create new picture.

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ const char *  text,
const int  fg,
const int  bg,
const int  size = 1
 

The ONLY way to create text (e.g. labels) in CLIP is to instantiate a picture_of_int with the appropriate text. This creates a picture with lettering level fg on a ground level bg. size is an integer scale. The result can be combined into your pictures as required.

template<typename PEL>
clip::picture_of_< PEL >::picture_of_ int  argc,
char *  argv[],
const int  def_nrows = 240,
const int  def_ncols = 320,
const int  bord = DEFAULT_BORDER
[inline]
 

Sequence processing constructor that interprets main()'s parameters. If the command line had no arguments, tries to attach a camera. If that fails, generates a default picture. If the command line had arguments, interprets these as picture files and sets up for reading these in sequence. See also member function next()


Member Function Documentation

template<typename PEL>
int clip::picture_of_< PEL >::attach_camera  ) 
 

If a camera exists, attach it to this picture. Returns negative value if the camera doesn't exist, could not be initialized, is already attached to another picture or the current picture is too small to have a camera attached.

template<typename PEL>
PEL** clip::picture_of_< PEL >::bufptr  )  [inline]
 

Returns the PEL * buffer pointer used internally by picture_of_int. THIS FUNCTION IS DANGEROUS. It providesno border management. Rarely used.

template<typename PEL>
int clip::picture_of_< PEL >::closerequested  ) 
 

Returns non-zero if the user has left-clicked in the close box of the window where the picture is being displayed.

template<typename PEL>
void clip::picture_of_< PEL >::dc_pad  )  [inline]
 

Set values in the border of the picture by copying the values on the edges of the picture outwards.

template<typename PEL>
int clip::picture_of_< PEL >::detach_camera  ) 
 

Call to detach the camera from the picture. You may need to do this in order to attach the camera to a different picture.

template<typename PEL>
int clip::picture_of_< PEL >::draw_graph const int *  yvals,
const int  numvals,
const PEL  drawshade,
int  minval = -1,
int  maxval = -1
 

Treat the picture as a drawing canvas for a time-series graph. There are numvals consecutive points to be plotted over the full width of the picture. The vertical values in yvals are scaled so that minval and maxval are the picture limits. If these are -1, minval and maxval are taken from the data.

template<typename PEL>
int clip::picture_of_< PEL >::frame_delivered  ) 
 

Immediately returns 0 if a requested frame is not yet available. If the frame is available does a buffer switch and returns 1. Because of the buffer switch within the function, immediately before the call the picture has its old contents; immediately after it has its the frame.

template<typename PEL>
int clip::picture_of_< PEL >::gaussfilter picture_of_< PEL > &  other,
const double  stddev
[inline]
 

Convolve picture other with a gaussian filter with standard deviation stddev and put the result in this. The kernel size adapts to the scale of the gaussian. The first argument is not const because gaussfilter does symmetric extension on the source image before convolution.

template<typename PEL>
PEL clip::picture_of_< PEL >::hconv const picture_of_< PEL > &  rb,
const int  hsize,
const PEL *  hkernel
[inline]
 

Convolve picture other with a horizontal impulse response and put the result in this. The kernel values are stored starting at hkernel and there are hsize of them. You may precede a convolution by a call to symmetric_extension to reflect appropriately at the boundaries if required. You may need to follow a convolution with division by the sum of the kernel coefficients to normalize the gain.

template<typename PEL>
int clip::picture_of_< PEL >::inspect  )  [inline]
 

Inspect a shown picture. Until the right button is clicked inside the picture, the program pauses and allows the user to left-click within the picture and inspect the values at that point.

template<typename PEL>
int clip::picture_of_< PEL >::loadascolour const colour_picture_of_< PEL > &  other  ) 
 

Load from a colour_picture_of_, stacking into a colour format that can be used by functions like showascolour().

template<typename PEL>
int clip::picture_of_< PEL >::map const int  myx,
const int  myy,
const picture_of_< PEL > &  from,
const int  fromx,
const int  fromy,
const int  transparency
 

This map operator is even faster than the double version above. This time fromx and fromy are both 256 times the actual values desired, so dest.map(50,76,source,64,384,0); is the same as dest.map(50,76,source,0.25,1.5,0); but faster. Rarely used.

template<typename PEL>
int clip::picture_of_< PEL >::map const int  myx,
const int  myy,
const picture_of_< PEL > &  from,
const double  fromx,
const double  fromy,
const int  transparency
 

The map operators provide a fast way of mapping a bilinearly interpolated value from one picture into another. transparency is a number from 0 (overwrite) to 255 (preserve almost all of what was there originally). So with two picture_of_int's source and dest, dest.map(50,76,source,5.3,99.99,0); is exactly equivalent to dest[76][50] = source[99.99][5.3]; but much faster.

template<typename PEL>
picture_of_& clip::picture_of_< PEL >::mask const picture_of_< PEL > &  rb,
const PEL &  thresh,
const PEL &  below,
const PEL &  equal,
const PEL &  above
[inline]
 

Set pels in this picture, according to their values in source picture rb: if source pel is below thresh, set dest pel to value below, if source pel is equal to thresh, set dest pel to value equal, if source pel is above thresh, set dest pel to int value above.

template<typename PEL>
PEL clip::picture_of_< PEL >::max int &  reti,
int &  retj
const [inline]
 

Return maximum value in picture and write its position into reti (row) and retj (column).

template<typename PEL>
PEL clip::picture_of_< PEL >::min int &  reti,
int &  retj
const [inline]
 

Return minimum value in picture and write its position into reti (row) and retj (column).

template<class T>
int clip::picture_of_< T >::mx_eigensystem picture_of_< PEL > &  A,
picture_of_< PEL > &  evecs
 

Make the first row of this picture into the eigenvalues of the symmetric matrix represented as source picture A and write the corresponding eigenvectors to evecs

template<class T>
int clip::picture_of_< T >::mx_eigenvalues picture_of_< PEL > &  A  ) 
 

Make the first row of this picture into the eigenvalues of the symmetric matrix represented as source picture A.

template<typename PEL>
int clip::picture_of_< PEL >::mx_eigenvector picture_of_< PEL > &  A,
PEL  evalue
 

Given a eigenvalue for the symmetric matrix represented as source source picture A, write the corresponding eigenvector into the first row of this picture

template<typename PEL>
int clip::picture_of_< PEL >::mx_mul picture_of_< PEL > &  A,
picture_of_< PEL > &  B
[inline]
 

Matrix multiply into this picture. The appropriate picture dimensions have to be correct. To just do a linear transform of a picture into another picture, see mx_transform below.

template<typename PEL>
int clip::picture_of_< PEL >::mx_solve picture_of_< PEL > &  transform,
picture_of_< PEL > &  b
 

Solve linear equations A.x = b without inverting A. this is x; both this and b should be one-row pictures.

template<typename PEL>
int clip::picture_of_< PEL >::mx_transform picture_of_< PEL > &  transform,
picture_of_< PEL > &  source,
const int  use_transpose = 0
[inline]
 

Apply picture transform as a linear transform to source and put the result in this. Essentially a matrix multiplication, but source and this are treated as vectors. This is a very liberal function, allowing sizes of vectors that are smaller than the transform.

template<typename PEL>
PEL clip::picture_of_< PEL >::neigh picture_of_< PEL > &  rb,
PEL(*  f)(PEL &, const PEL **)
[inline]
 

Apply callback neigh function *f() over source picture rb, putting result into this.

template<typename PEL>
int clip::picture_of_< PEL >::next  )  [inline]
 

Loads the next picture in the sequence into this picture that was constructed with the sequence processing constructor. Returns 1 if the picture has been seen before (if cycling back to the start of the argument list) and 0 if it has not. Returns -1 if the picture was not constructed using the sequence processing constructor.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator &= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

The &= operator does a pelwise conditional replacement, i.e. if (sourcepel < 0) destpel=destpel; else destpel = sourcepel;

template<typename PEL>
PEL clip::picture_of_< PEL >::operator * const picture_of_< PEL > &  rb  )  [inline]
 

Return the sum of all pelwise multiplications. Can convolve a picture with an operator by making the operator into a picture, then multiply operator and a moving block of the picture together.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator *= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

Multiply source picture with this picture. I.e. each pel value in rb is multiplied with the corresponding pel's value in this.

template<typename PEL>
PEL clip::picture_of_< PEL >::operator+ const picture_of_< PEL > &  rb  )  [inline]
 

When a picture is added to a picture the result is a PEL which is the sum of all pelwise additions.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator+= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

Add source picture to this picture. I.e. each pel value in rb is added to the corresponding pel's value in this.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator-= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

Subtract source picture from this picture. I.e. each pel value in rb is subtracted from the corresponding pel's value in this.

template<typename PEL>
PEL clip::picture_of_< PEL >::operator/ const picture_of_< PEL > &  rb  )  [inline]
 

Return the sum of all pelwise divisions. Uses divisor of 1 for any zero pel in rb.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator/= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

If a pel in rb is 0, divides the corresponding pel in this by 1, otherwise divides it by rb pel value.

template<typename PEL>
picture_of_& clip::picture_of_< PEL >::operator= PEL  newval  )  [inline]
 

Set every pel to newval. E.g.irange rg(0,8,256-8); picture_of_ a(256,256); a[rg][rg] = 255; sets every eighth pel horizontally and vertically to white.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

Set this picture equal to source picture with different data type. This and all assignments work with irange-referenced pictures.

template<typename PEL>
clip_internal::double_dereferenced_picture_of_<PEL> clip::picture_of_< PEL >::operator[] const double  selector  )  [inline]
 

When dereferenced (i.e. indexed) with a double, a PEL is returned which is the value bilinearly interpolated at the given double coords. E.g. val = a[20.5][31.435]; sets val to a weighted average of a[20][31], a[20][32], a[21][31] and a[21][32]. You cannot use double indexing on the left hand side of an expression because the pel at the given location doesn't really exist. I.e. saying a[20.5][31.435] = val; is illegal. (This works via the helper class double_dereferenced_picture_of_int which users do not access directly.)

template<typename PEL>
PEL* clip::picture_of_< PEL >::operator[] const int &  selector  )  [inline]
 

When dereferenced by an integer, just gives entry into pel buffer. No bounds checking. Same as rowptr(selector);

template<typename PEL>
picture_of_<PEL> clip::picture_of_< PEL >::operator[] const irange selector  )  const [inline]
 

When dereferenced (i.e. indexed) with irange operators, a subimage or block of the picture is returned as a picture. E.g. irange rg(0,1,7); picture_of_ pic(256,256); pic[rg][rg] = 255; sets the top left 8x8 square in pic to white.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator^= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

The ^= operator does a pelwise squared difference, i.e. destpel = sourcepel-destpel; destpel *= destpel; not a pelwise XOR.

template<typename PEL>
template<typename OTHERPEL>
picture_of_& clip::picture_of_< PEL >::operator|= const picture_of_< OTHERPEL > &  rb  )  [inline]
 

The |= operator does a pelwise absolute difference, i.e. destpel = abs(sourcepel-destpel) not a pelwise OR.

template<typename PEL>
int clip::picture_of_< PEL >::paste_centred_on const picture_of_< PEL > &  from,
const int  x,
const int  y
[inline]
 

We often want to paste one picture on another, centred at a particular location. Can do this with irange derefencings, but this way is easier.

template<typename PEL>
PEL clip::picture_of_< PEL >::point const picture_of_< PEL > &  rb,
PEL(*  f)(PEL &, const PEL &)
[inline]
 

Apply callback point function *f() over source picture rb, putting result into *this.

template<typename PEL>
int clip::picture_of_< PEL >::read const char *  name  ) 
 

Read picture from file into object. The picture_of_int object is NOT resized, so read only reads as much of the input file as will fit.

template<typename PEL>
int clip::picture_of_< PEL >::reaspect const picture_of_< PEL > &  source  )  [inline]
 

Pour the pels of the source picture into this picture which has the same number of pels but a different aspect ratio

template<typename PEL>
int clip::picture_of_< PEL >::request_frame int  shutterspeed,
int  gain
 

This version of request_frame() only works with Philips cameras on Linux. Will be extended to other cameras and platforms when possible.

template<typename PEL>
int clip::picture_of_< PEL >::request_frame  ) 
 

Initiate the request of a frame from the camera attached to this picture. Returns immediately; you must check frame_delivered() for arrival of the frame.

template<typename PEL>
int clip::picture_of_< PEL >::rerange const PEL  newlow,
const PEL  newhigh,
const bool  scale_even_if_inside_range = 0
[inline]
 

Reranges or normalizes picture values to fall in given range If scale_even_if_inside_range is false (default), then if all values are current between the give newlow and newhigh, they are unaltered. Otherwise, values are scaled so that the new max() will be newhigh and the new min() will be newmin.

template<typename PEL>
int clip::picture_of_< PEL >::reshow const char *  comment,
const bool  normalize = 1
 

Redisplay the picture (presumably because it has changed) and change title to the comment string.

template<typename PEL>
int clip::picture_of_< PEL >::reshowascolour const char *  comment  ) 
 

Redisplay a picture_of_int as if each integer pel were a colour vector of four unsigned chars in the order alpha-red-green-blue. Change title to comment string.

template<typename PEL>
PEL* clip::picture_of_< PEL >::rowptr int  i  )  [inline]
 

Returns the int buffer pointer used internally by picture_of_int for the row i. Use this function if you need direct access to the pel values to implement a fast row operation.

template<typename PEL>
int clip::picture_of_< PEL >::sepconv picture_of_< PEL > &  other,
const int  hsize,
const PEL *  hkernel,
const int  vsize,
const PEL *  vkernel,
const bool  do_symmetric_extension = false
[inline]
 

Convolve picture other with a separable point spread function and put the result in this. The horizontal component of the kernel is given by hsize=m values (h1 h2 .. hm) stored starting at hkernel. The vertical component is given by vsize=n values (v1 v2 .. vn), and the result is to be divided by divisor=k (scaling). All component values must be integers. The kernel is run across the whole picture, and may be preceded by reflection at the boundaries by setting do_symmetric_extension to true. The first argument is not const to allow symmetric extension to be done.

template<typename PEL>
int clip::picture_of_< PEL >::show const char *  comment,
const bool  normalize = 1
 

Display the picture on the screen in its own window, with the comment string as title. If normalize is true values are scaled to [0,255] for display. If false, it is assumed they already are in this range.

template<typename PEL>
int clip::picture_of_< PEL >::showascolour const char *  comment  ) 
 

Display a picture_of_int as if each integer pel were a colour vector of four unsigned chars in the order alpha (most significant) - red - green - blue. Use comment string as window title.

template<typename PEL>
int clip::picture_of_< PEL >::showascolourat const int  Nx,
const int  Ny,
const picture_of_< PEL > *  parent
 

Display a picture_of_ with showascolour() interpretation (see above), but without decorations at Nx,Ny. If parent==0, the coords are screen coordinates, and the window receives events (e.g. pointx()) as normal. If parent is a displayed picture, the coords are relative to that picture and a child window is displayed that does not receive events. As showascolour() but wihout decorations.

template<typename PEL>
int clip::picture_of_< PEL >::showat const int  Nx,
const int  Ny,
const bool  normalize,
const picture_of_< PEL > *  parent
 

Display without decorations at Nx,Ny. If parent==0, the coords are screen coordinates, and the window receives events (e.g. pointx()) as normal. If parent is a displayed picture, the coords are relative to that picture and a child window is displayed that does not receive events.

template<typename PEL>
void clip::picture_of_< PEL >::symmetric_extension int  hlength,
int  vlength
[inline]
 

Reflects picture at boundaries to prevent edge effects for a filter of horizontal length hlength and vertical length vlength. When convolving an image whose left hand side is a b c d e f ... with a filter with an odd number of taps, the picture should be 'reflected' in the boundary as: ... f e d c b | a b c d e f ... where | represents the boundary. Convolving with a filter with an even number of taps, requires reflecting: ... f e d c b a | a b c d e f ... symmetric_extension does the appropriate reflection based on given lengths.

template<typename PEL>
PEL clip::picture_of_< PEL >::vconv const picture_of_< PEL > &  rb,
const int  vsize,
const PEL *  vkernel
[inline]
 

Convolve picture other with a vertical impulse response and put the result in this. The kernel values are stored starting at vkernel and there are vsize of them. You may precede a convolution by a call to symmetric_extension to reflect appropriately at the boundaries if required. You may need to follow a convolution with division by the sum of the kernel coefficients to normalize the gain.

template<typename PEL>
int clip::picture_of_< PEL >::wait const int  milliseconds  )  [inline]
 

Waits for given number of milliseconds since last call to wait() on any picture_of_int or colour_picture_of_int. Returns actual number of milliseconds waited (negative if interval has already passed and therefore wait() returned immediately).


The documentation for this class was generated from the following file:
Generated on Sun Mar 13 20:59:22 2005 for clip by doxygen 1.3.8