noisegen.hh
Go to the documentation of this file.
/* -*- mia-c++ -*-
*
* This file is part of MIA - a toolbox for medical image analysis
* Copyright (c) Leipzig, Madrid 1999-2017 Gert Wollny
*
* MIA is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation; either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with MIA; if not, see <http://www.gnu.org/licenses/>.
*
*/
#ifndef __mia_core_noisegen_hh
#define __mia_core_noisegen_hh
#include <mia/core/defines.hh>
#include <mia/core/factory.hh>
#include <mia/core/handler.hh>
NS_MIA_BEGIN
struct EXPORT_CORE grayscale_noise_data {
static const char *data_descr;
};
struct EXPORT_CORE generator_type {
static const char *type_descr;
};
class EXPORT_CORE CNoiseGenerator : public CProductBase
{
public:
typedef grayscale_noise_data plugin_data;
typedef generator_type plugin_type;
CNoiseGenerator(unsigned int seed);
virtual ~CNoiseGenerator();
double operator ()()const;
protected:
double ranf() const;
private:
virtual double get() const = 0;
};
typedef std::shared_ptr<CNoiseGenerator> PNoiseGenerator;
typedef TFactory<CNoiseGenerator> CNoiseGeneratorPlugin;
typedef THandlerSingleton<TFactoryPluginHandler<CNoiseGeneratorPlugin>>
CNoiseGeneratorPluginHandler;
FACTORY_TRAIT(CNoiseGeneratorPluginHandler);
NS_MIA_END
#endif
CNoiseGenerator::~CNoiseGenerator
virtual ~CNoiseGenerator()
CNoiseGenerator::CNoiseGenerator
CNoiseGenerator(unsigned int seed)
CNoiseGenerator::plugin_data
grayscale_noise_data plugin_data
typedef helber for plugin search path
Definition noisegen.hh:50
CNoiseGenerator::ranf
double ranf() const
CNoiseGenerator::plugin_type
generator_type plugin_type
typedef helber for plugin search path
Definition noisegen.hh:53
CProductBase
The base class for all plug-in created object.
Definition product_base.hh:41
TFactory
This is tha base of all plugins that create "things", like filters, cost functions time step operator...
Definition factory.hh:51
THandlerSingleton
the singleton that a plug-in handler really is
Definition handler.hh:159
defines.hh
NS_MIA_BEGIN
#define NS_MIA_BEGIN
conveniance define to start the mia namespace
Definition defines.hh:33
EXPORT_CORE
#define EXPORT_CORE
Macro to manage Visual C++ style dllimport/dllexport.
Definition defines.hh:101
NS_MIA_END
#define NS_MIA_END
conveniance define to end the mia namespace
Definition defines.hh:36
factory.hh
FACTORY_TRAIT
#define FACTORY_TRAIT(F)
Definition factory_trait.hh:69
handler.hh
CNoiseGeneratorPluginHandler
THandlerSingleton< TFactoryPluginHandler< CNoiseGeneratorPlugin > > CNoiseGeneratorPluginHandler
The noise generator plugin handler.
Definition noisegen.hh:84
CNoiseGeneratorPlugin
TFactory< CNoiseGenerator > CNoiseGeneratorPlugin
Base class for al noise generator plugins.
Definition noisegen.hh:80
PNoiseGenerator
std::shared_ptr< CNoiseGenerator > PNoiseGenerator
Definition noisegen.hh:77
generator_type
Definition noisegen.hh:35
generator_type::type_descr
static const char * type_descr
Definition noisegen.hh:36
grayscale_noise_data
Definition noisegen.hh:30
grayscale_noise_data::data_descr
static const char * data_descr
Definition noisegen.hh:31