devilimagereader.h 4.12 KB
Newer Older
schultezub's avatar
schultezub committed
1
2
3
4
// ================================================================================================
// 
// This file is part of the CAMPVis Software Framework.
// 
5
// If not explicitly stated otherwise: Copyright (C) 2012-2015, all rights reserved,
schultezub's avatar
schultezub committed
6
7
//      Christian Schulte zu Berge <christian.szb@in.tum.de>
//      Chair for Computer Aided Medical Procedures
8
9
//      Technische Universitaet Muenchen
//      Boltzmannstr. 3, 85748 Garching b. Muenchen, Germany
10
// 
schultezub's avatar
schultezub committed
11
12
// For a full list of authors and contributors, please refer to the file "AUTHORS.txt".
// 
13
14
15
16
// Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file 
// except in compliance with the License. You may obtain a copy of the License at
// 
// http://www.apache.org/licenses/LICENSE-2.0
schultezub's avatar
schultezub committed
17
// 
18
19
20
21
// Unless required by applicable law or agreed to in writing, software distributed under the 
// License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, 
// either express or implied. See the License for the specific language governing permissions 
// and limitations under the License.
schultezub's avatar
schultezub committed
22
23
24
25
26
27
28
29
30
31
// 
// ================================================================================================

#ifndef DEVILIMAGEREADER_H__
#define DEVILIMAGEREADER_H__

#include <string>

#include "core/properties/datanameproperty.h"
#include "core/properties/genericproperty.h"
32
#include "core/properties/optionproperty.h"
33
#include "core/properties/stringproperty.h"
34
#include "core/properties/numericproperty.h"
schultezub's avatar
schultezub committed
35

36
#include "modules/modulesapi.h"
Hossain Mahmud's avatar
Hossain Mahmud committed
37
38
#include "modules/io/processors/abstractimagereader.h"

39
namespace cgt {
40
    class Shader;
schultezub's avatar
schultezub committed
41
42
43
44
45
46
47
48
49
}

namespace campvis {
    /**
     * Reads an image file into the pipeline using the DevIL library.
     * DevIL supports most common 2D image formats. 
     *
     * \note    Full list of supported formats: http://openil.sourceforge.net/features.php
     */
50
    class CAMPVIS_MODULES_API DevilImageReader : public AbstractImageReader {
schultezub's avatar
schultezub committed
51
    public:
52
53
54
55
        enum class DevILFilterType {
            NONE, BLUR_AVG, BLUR_GAUSSIAN, EDGEDETECT_P, EDGEDETECT_S, EMBOSS, GAMMACORRECT, NEGATIVE, NOISE, PIXELIZE, SHARPEN, EQUALIZE
        };

schultezub's avatar
schultezub committed
56
57
58
        /**
         * Constructs a new DevilImageReader Processor
         **/
59
        DevilImageReader();
schultezub's avatar
schultezub committed
60
61
62
63
64
65
66

        /**
         * Destructor
         **/
        virtual ~DevilImageReader();


67
68
69
70
71
72
        /// \see AbstractProcessor::init
        virtual void init();

        /// \see AbstractProcessor::deinit
        virtual void deinit();

73
74
75
76
77
        /**
        * To be used in ProcessorFactory static methods
        */
        static const std::string getId() { return "DevILImageReader"; };

schultezub's avatar
schultezub committed
78
        /// \see AbstractProcessor::getName()
79
        virtual const std::string getName() const override { return "DevilImageReader"; };
schultezub's avatar
schultezub committed
80
        /// \see AbstractProcessor::getDescription()
81
        virtual const std::string getDescription() const override { return "Reads an image file into the pipeline using the DevIL library."; };
82
        /// \see AbstractProcessor::getAuthor()
83
        virtual const std::string getAuthor() const override { return "Christian Schulte zu Berge <christian.szb@in.tum.de>"; };
84
        /// \see AbstractProcessor::getProcessorState()
85
        virtual ProcessorState getProcessorState() const override { return AbstractProcessor::EXPERIMENTAL; };
schultezub's avatar
schultezub committed
86

87
        GenericOptionProperty<std::string> p_importType;
Hossain Mahmud's avatar
Hossain Mahmud committed
88
        BoolProperty p_importSimilar;
89
        Vec3Property p_voxelSpacing;
schultezub's avatar
schultezub committed
90

91
92
93
94
95
96
97
98

        GenericOptionProperty<DevILFilterType> p_imageFilter;

        IntProperty p_iterations;
        FloatProperty p_gamma;
        IntProperty p_pixelizationSize;
        FloatProperty p_sharpeningFactor;

schultezub's avatar
schultezub committed
99
    protected:
100
        /// \see AbstractProcessor::updateResult
101
102
103
        virtual void updateResult(DataContainer& dataContainer) override;

        void applyFilter(DevILFilterType filterType);
104

105
106
        /// \see AbstractProcessor::updateProperties
        virtual void updateProperties(DataContainer& dataContainer) override;
schultezub's avatar
schultezub committed
107
108
109
110
111
112

        static const std::string loggerCat_;
    };

}

113
#endif // DEVILIMAGEREADER_H__