The Machine Perception Toolbox

[Introduction]- [News]- [Download]- [Screenshots]- [Manual (pdf)]- [Forums]- [API Reference]- [Repository ]

 

Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

MPColorResults.h

Go to the documentation of this file.
00001 /*
00002  *  MPColorResults.h
00003  *  
00004  *
00005  *  Created by Josh Susskind 2003.
00006  *  Copyright (c) 2003 Machine Perception Laboratory
00007  *  University of California San Diego.
00008  *  Please read the disclaimer and notes about redistribution
00009  *  at the end of this file.
00010  *
00011  *  Authors: Josh Susskind
00012  */
00013 #ifndef __MPCOLORRESULTS_H__
00014 #define __MPCOLORRESULTS_H__
00015 
00016 #include "preprocessor.h"
00017 
00018 /* ================================================================ */
00019 
00020 struct MPColorResults {
00021         int x1;
00022         int y1;
00023         int x2;
00024         int y2;
00025         
00026         MPColorResults() {
00027                 x1 = y1 = 0;
00028                 x2 = y2 = -1;
00029         }
00030 
00031         inline int getMeanX() {
00032                 return (x1+x2)>>1;
00033         }
00034 
00035         inline int getMeanY() {
00036                 return (y1+y2)>>1;
00037         }
00038 
00039         inline int getWidth() {
00040                 return (x2 - x1);
00041         }
00042 
00043         inline int getHeight() {
00044                 return (y2 - y1);
00045         }
00046 
00047 /*      inline int getWidth() {
00048                 return (x2 - x1 + 1);
00049         }
00050 
00051         inline int getHeight() {
00052                 return (y2 - y1 + 1);
00053         }*/
00054 };
00055 
00056 /* ================================================================ */
00057 
00058 #endif //__MPCOLORRESULTS_H__
00059 
00060 
00061 
00062 /*
00063  * 
00064  * Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
00065  * 
00066  *    1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
00067  *    2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
00068  *    3. The name of the author may not be used to endorse or promote products derived from this software without specific prior written permission.
00069  * 
00070  * THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00071  * 
00072  */

Generated on Mon Nov 8 17:07:42 2004 for MPT by  doxygen 1.3.9.1