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

convert_Filter.cpp

Go to the documentation of this file.
00001 /* ---------------------------------------------------------------------------
00002     Phission :
00003         Realtime Vision Processing System
00004 
00005     Copyright (C) 2003-2005 Philip D.S. Thoren (pthoren@cs.uml.edu)
00006     University of Massachusetts at Lowell,
00007     Laboratory for Artificial Intelligence and Robotics
00008 
00009     This file is part of Phission.
00010 
00011     Phission is free software; you can redistribute it and/or modify
00012     it under the terms of the GNU Lesser General Public License as published by
00013     the Free Software Foundation; either version 2 of the License, or
00014     (at your option) any later version.
00015 
00016     Phission is distributed in the hope that it will be useful,
00017     but WITHOUT ANY WARRANTY; without even the implied warranty of
00018     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00019     GNU Lesser General Public License for more details.
00020 
00021     You should have received a copy of the GNU Lesser General Public License
00022     along with Phission; if not, write to the Free Software
00023     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA  02111-1307  USA
00024 
00025  ---------------------------------------------------------------------------*/
00026 #ifdef HAVE_CONFIG_H
00027     #include <phissionconfig.h>
00028 #endif
00029 
00030 #include <phStandard.h>
00031 
00032 #include <convert_Filter.h>
00033 
00034 #include <phError.h>
00035 #include <phMemory.h>
00036 #include <phPrint.h>
00037 
00038 /* ---------------------------------------------------------------------- */
00039 /* (int outformat) */
00040 /* ---------------------------------------------------------------------- */
00041 convert_Filter::convert_Filter(uint32_t outformat) :
00042     phFilter("convert_Filter")
00043 
00044 {
00045     /* Convert accepts all input formats */
00046     this->m_format = phImageValidFormatMask;
00047     this->set(outformat);
00048 }
00049 
00050 /* ---------------------------------------------------------------------- */
00051 convert_Filter::~convert_Filter()
00052 {
00053 }
00054 
00055 /* ------------------------------------------------------------------------ */
00056 phFilter *convert_Filter::cloneFilter()
00057 {
00058     phFUNCTION("convert_Filter::cloneFilter")
00059     int locked = 0;
00060     convert_Filter *conv = new convert_Filter();
00061 
00062     phTHIS_LOOSE_LOCK(locked);
00063     
00064     conv->set(this->m_outformat);
00065 
00066     phTHIS_LOOSE_UNLOCK(locked);
00067     
00068     return (phFilter *)conv;
00069 }
00070 
00071 /* ---------------------------------------------------------------------- */
00072 int convert_Filter::set(uint32_t outformat)
00073 {
00074     phFUNCTION("convert_Filter::set")
00075     int locked = 0;
00076 
00077     phTHIS_LOOSE_LOCK(locked);
00078     
00079     this->m_outformat = outformat;
00080 
00081     phTHIS_LOOSE_UNLOCK(locked);
00082     
00083     return phSUCCESS;
00084 }
00085 
00086 /* ---------------------------------------------------------------------- */
00087 int convert_Filter::filter()
00088 {
00089     phFUNCTION("convert_Filter::filter")
00090    
00091     /* defined before being called:
00092      *  width
00093      *  height
00094      *  depth
00095      *  Image
00096      */
00097     
00098     /* Begin Filter */
00099     rc = this->m_workspaceImage->convert(this->m_outformat);
00100     phPRINT_RC(rc,NULL,"Image->convert(outputFormat) failed.");
00101    
00102     DEBUG_PRINT("req_format:%s\toutput:%s\n",
00103       phImageFormatToString(this->m_outformat),
00104       phImageFormatToString(this->m_workspaceImage->getFormat()));
00105     
00106     /* End Filter */
00107     
00108     return phSUCCESS;
00109 /*
00110 error:
00111     
00112     return phFAIL;
00113 */
00114 }
00115 
00116 




Copyright (C) 2002 - 2007 Philip D.S. Thoren ( pthoren@users.sourceforge.net )
University Of Massachusetts at Lowell
Robotics Lab
SourceForge.net Logo

Generated on Sat Jun 16 02:44:09 2007 for phission by  doxygen 1.4.4