Image.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Rainer Kartmann (rainer dot kartmann at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 // STD / STL
27 #include <memory>
28 #include <string>
29 
30 // Base Class
31 #include "../detail/NDArrayVariant.h"
32 
33 namespace armarx::aron::type
34 {
35  /**
36  * @brief The Image class. It represents the image type.
37  * The code generation manages, which code will be generated for this type object, e.g. c++ generates opencv code.
38  */
39  class Image : public detail::NDArrayVariant<type::dto::Image, Image>
40  {
41  public:
42  // constructors
43  Image(const Path& path = {});
44  Image(const type::dto::Image&, const Path& path);
45 
47 
48  /// Get the pixel type.
49  image::PixelType getPixelType() const;
50  void setPixelType(const image::PixelType type) const;
51 
52  // virtual implementations
53  std::string getShortName() const override;
54  std::string getFullName() const override;
55 
56  static const std::map<image::PixelType, std::string> Pixeltype2String;
57  static const std::map<std::string, image::PixelType> String2Pixeltype;
58  };
59 } // namespace armarx::aron::type
armarx::aron::type::ImagePtr
std::shared_ptr< class Image > ImagePtr
Definition: forward_declarations.h:22
armarx::aron::type::Image::toImageDTO
type::dto::ImagePtr toImageDTO() const
Definition: Image.cpp:51
armarx::aron::type::Image::getShortName
std::string getShortName() const override
get a short name of this specific type
Definition: Image.cpp:70
armarx::aron::Path
The Path class.
Definition: Path.h:36
armarx::aron::type::Image::getFullName
std::string getFullName() const override
get the full name of this specific type
Definition: Image.cpp:76
armarx::aron::type::detail::NDArrayVariant
Definition: NDArrayVariant.h:39
armarx::aron::type
A convenience header to include all aron files (full include, not forward declared)
Definition: aron_conversions.cpp:9
armarx::aron::type::Image::setPixelType
void setPixelType(const image::PixelType type) const
Definition: Image.cpp:63
armarx::aron::type::Image::getPixelType
image::PixelType getPixelType() const
Get the pixel type.
Definition: Image.cpp:57
armarx::aron::type::Image::Pixeltype2String
static const std::map< image::PixelType, std::string > Pixeltype2String
Definition: Image.h:56
armarx::aron::type::Variant::path
const Path path
Definition: Variant.h:139
armarx::aron::type::Image
The Image class.
Definition: Image.h:39
armarx::aron::type::Image::Image
Image(const Path &path={})
Definition: Image.cpp:40
armarx::aron::type::Image::String2Pixeltype
static const std::map< std::string, image::PixelType > String2Pixeltype
Definition: Image.h:57