ImageFilterDescriptor.h

Go to the documentation of this file.
00001 /*
00002  * The information in this file is
00003  * Copyright(c) 2007 Ball Aerospace & Technologies Corporation
00004  * and is subject to the terms and conditions of the
00005  * GNU Lesser General Public License Version 2.1
00006  * The license text is available from   
00007  * http://www.gnu.org/licenses/lgpl.html
00008  */
00009 
00010 #ifndef IMAGE_FILTER_DESCRIPTOR_H
00011 #define IMAGE_FILTER_DESCRIPTOR_H
00012 
00013 #include "EnumWrapper.h"
00014 #include <string>
00015 #include <vector>
00016 
00017 class DataVariant;
00018 class DynamicObject;
00019 
00020 class GpuProgramDescriptor;
00021 
00022 /**
00023  * Provides information on image filter.
00024  *
00025  * This class provides information on a specific image filter, which 
00026  * is implemented via Graphical Processor Unit (GPU) programs. It
00027  * provides the name, description, GPU programs, and parameters
00028  * for the image filter.
00029  *
00030  */
00031 class ImageFilterDescriptor
00032 {
00033 public:
00034    /**
00035     * This type specifies how the shader program will be treated by the application.
00036     */
00037    enum ImageProcessTypeEnum
00038    {
00039       GPU_PROCESS,      /**< Generic process running on Gpu. */
00040       IMAGE_FILTER,     /**< Image filter process running on Gpu. */
00041       FEEDBACK_FILTER   /**< Recursive filter process running on Gpu. */
00042    };
00043 
00044    /**
00045    * @EnumWrapper ::ImageProcessTypeEnum.
00046    */
00047    typedef EnumWrapper<ImageProcessTypeEnum> ImageProcessType;
00048 
00049    /**
00050     *  Gets the name of the image filter.
00051     *
00052     *  @return   Name of the image filter.
00053     *           
00054     */
00055    virtual const std::string& getName() const = 0;
00056 
00057    /**
00058     *  Gets the description of the image filter.
00059     *
00060     *  @return  Description of the image filter.
00061     *
00062     */
00063    virtual const std::string& getDescription() const = 0;
00064 
00065    /**
00066     *  Gets the type of the image filter.
00067     *
00068     *  @return   Type of the image filter.
00069     */
00070    virtual ImageProcessType getType() const = 0;
00071 
00072    /**
00073     *  Queries for one of the image filter's GPU programs in the list.
00074     *
00075     *  @param   gpuDescriptor
00076     *           GPU Program descriptor.
00077     *
00078     *  @return  True if GPU program is in image filter descriptor list, 
00079     *           otherwise false.
00080     *
00081     *  @see     addGpuProgram()
00082     */
00083    virtual bool hasGpuProgram(const GpuProgramDescriptor& gpuDescriptor) const = 0;
00084 
00085    /**
00086     *  Gets the image filter's GPU programs list.
00087     *
00088     *  @return  The image filter's GPU programs.
00089     */
00090    virtual const std::vector<GpuProgramDescriptor*>& getGpuPrograms() const = 0;
00091 
00092    /**
00093     *  Sets the value of a parameter in this filter's parameter specification.
00094     *
00095     *  @param   name
00096     *           The name of the parameter to set.
00097     *  @param   value
00098     *           The new value of the parameter.
00099     *
00100     *  @return  Returns \c true if the parameter's value was set or \c false if
00101     *           the parameter does not exist.
00102     */
00103    virtual bool setParameter(const std::string& name, const DataVariant& value) = 0;
00104 
00105    /**
00106     *  Gets the value of a parameter in this filter's parameter specification.
00107     *
00108     *  @param   name
00109     *           The name of the parameter to get.
00110     *
00111     *  @return  The value of the parameter.  If the parameter does not exist,
00112     *           this will be an invalid DataVariant.
00113     */
00114    virtual const DataVariant& getParameter(const std::string& name) const = 0;
00115 
00116    /**
00117     *  Gets all the parameters and values in this filter's parameter
00118     *  specification.
00119     *
00120     *  @return  A DynamicObject containing the parameter names and values.
00121     */
00122    virtual const DynamicObject* getParameters() const = 0;
00123 
00124    /**
00125     *  Removes a parameter from this filter's parameter specification.
00126     *
00127     *  @param   name
00128     *           The name of the parameter to remove.
00129     *
00130     *  @return  Returns \c true if successful or \c false if the parameter does
00131     *           not exist.
00132     */
00133    virtual bool removeParameter(const std::string& name) = 0;
00134 
00135 protected:
00136    /**
00137     * This is automatically destroyed by the application.
00138     */
00139    virtual ~ImageFilterDescriptor() {}
00140 };
00141 
00142 #endif

Software Development Kit - Opticks 4.9.0 Build 16218