TLIB documentation
 

tlMask.h

Go to the documentation of this file.
00001 /////////////////////////////////////////////////////////////////////////////////
00002 //
00003 //  This file is part of the TLIB computer vision library.
00004 //  Copyright (C) 2003-2008 Sebastien Grange
00005 //  Copyright (C) 2003-2007 VRAI Group, EPFL
00006 //  All rights reserved.
00007 // 
00008 //  This library is free software; you can redistribute it and/or modify
00009 //  it under the terms of the GNU General Public License("GPL") version 2
00010 //  as published by the Free Software Foundation.
00011 // 
00012 //  <http://www.tuyphon.com/tlib>
00013 //
00014 /////////////////////////////////////////////////////////////////////////////////
00015 
00016 
00017 #ifndef __TLMASK_H__
00018 #define __TLMASK_H__
00019 
00020 
00021 #include "tlVision.h"
00022 #include "tlPixelArray.h"
00023 
00024 
00025 
00026 class tlMask : public tlPixelArray
00027 {
00028 public:
00029 
00030   int       cx;
00031   int       cy;
00032   int       area;
00033 
00034 
00035   // constructors
00036   tlMask  ();
00037   tlMask  (int cx, int cy, int width, int height);
00038   tlMask  (tlMask *mask);
00039   tlMask  (tlImage *image);
00040         virtual ~tlMask ();
00041 
00042   // mask management
00043   int set         ();
00044   int set         (int width, int height);
00045   int set         (tlMask *mask);
00046   int set         (char *mask, int width, int height);
00047   int set         (char *mask, int width, int height, tlRect *rect);
00048   int set         (tlPixel *mask, int width, int height);
00049   int set         (tlPixel *mask, int width, int height, tlRect *rect);
00050   int set         (tlObject *object);
00051   int set         (tlImage *image);
00052   int set         (tlImage *image, tlRect *rect);
00053   int invert      ();
00054   int invert      (tlRect *rect);
00055         int setCenter   ();
00056   int setCenter   (int cx, int cy);
00057   int clear       ();
00058   int clear       (int width, int height);
00059 
00060   // mask operations
00061   int fill        ();
00062   int crop        (int val);
00063 
00064   // interaction with other masks
00065   int merge       (tlMask *mask);
00066 
00067         // adjust to a rectangular component
00068         int adjust      (tlRect *rect);
00069 
00070         // set to minimal size
00071         int minimize    ();
00072 
00073   // misc
00074   int copy        (tlMask *mask);
00075   int copyTo      (tlMask *mask);
00076 };
00077 
00078 
00079 
00080 #endif
00081 


TLIB documentation - generated on 7 May 2008
Please address any questions to seb@tuyphon.com
(C) 2001-2008 - S. Grange
(C) 2001-2007 - VRAI Group, EPFL
All Rights Reserved.