FloatImage.h
Go to the documentation of this file.
1 // ****************************************************************************
2 // This file is part of the Integrating Vision Toolkit (IVT).
3 //
4 // The IVT is maintained by the Karlsruhe Institute of Technology (KIT)
5 // (www.kit.edu) in cooperation with the company Keyetech (www.keyetech.de).
6 //
7 // Copyright (C) 2014 Karlsruhe Institute of Technology (KIT).
8 // All rights reserved.
9 //
10 // Redistribution and use in source and binary forms, with or without
11 // modification, are permitted provided that the following conditions are met:
12 //
13 // 1. Redistributions of source code must retain the above copyright
14 // notice, this list of conditions and the following disclaimer.
15 //
16 // 2. Redistributions in binary form must reproduce the above copyright
17 // notice, this list of conditions and the following disclaimer in the
18 // documentation and/or other materials provided with the distribution.
19 //
20 // 3. Neither the name of the KIT nor the names of its contributors may be
21 // used to endorse or promote products derived from this software
22 // without specific prior written permission.
23 //
24 // THIS SOFTWARE IS PROVIDED BY THE KIT AND CONTRIBUTORS “AS IS” AND ANY
25 // EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
26 // WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
27 // DISCLAIMED. IN NO EVENT SHALL THE KIT OR CONTRIBUTORS BE LIABLE FOR ANY
28 // DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
29 // (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
30 // LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
31 // ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
32 // (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
33 // THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
34 // ****************************************************************************
35 // ****************************************************************************
36 // Filename: FloatImage.h
37 // Author: Jan Issac
38 // Date: 2011
39 // ****************************************************************************
40 
41 #ifndef __FLOAT_IMAGE_H__
42 #define __FLOAT_IMAGE_H__
43 
44 
45 // ****************************************************************************
46 // CFloatImage
47 // ****************************************************************************
48 
63 {
64 public:
72  CFloatImage();
73 
88  CFloatImage(int nImageWidth, int nImageHeight, int nNumberOfChannels, bool bHeaderOnly = false);
89 
102  CFloatImage(const CFloatImage *pImage, bool bHeaderOnly = false);
103 
116  CFloatImage(const CFloatImage &image, bool bHeaderOnly = false);
117 
121  ~CFloatImage();
122 
123 
124  // public methods
125 
132  bool IsCompatible(const CFloatImage *pImage) const;
133 
145  bool LoadFromFile(const char *pFileName);
146 
159  bool SaveToFile(const char *pFileName) const;
160 
161 
162 
163 private:
164  // private methods
165  void FreeMemory();
166 
167 public:
168  // public attributes - not clean OOP design but easy access
169 
177  int width;
178 
184  int height;
185 
194 
203  float *pixels;
204 
213 
222 };
223 
224 
225 
226 #endif /* __FLOAT_IMAGE_H__ */
void FreeMemory()
Definition: FloatImage.cpp:148
bool SaveToFile(const char *pFileName) const
Saves an image to a file.
Definition: FloatImage.cpp:200
float * pixels
The pointer to the the pixels.
Definition: FloatImage.h:203
bool IsCompatible(const CFloatImage *pImage) const
Checks whether two images are compatible or not.
Definition: FloatImage.cpp:160
GLenum GLsizei GLenum GLenum const GLvoid * image
Definition: glext.h:3131
bool LoadFromFile(const char *pFileName)
Loads an image from a file.
Definition: FloatImage.cpp:166
int numberOfChannels
Number of channels per pixel.
Definition: FloatImage.h:212
~CFloatImage()
The destructor.
Definition: FloatImage.cpp:138
int width
The width of the image in pixels.
Definition: FloatImage.h:177
int height
The height of the image in pixels.
Definition: FloatImage.h:184
int bytesPerPixel
The number of bytes used for encoding one pixel.
Definition: FloatImage.h:193
bool m_bOwnMemory
Flag signaling if memory is to be freed or not.
Definition: FloatImage.h:221
CFloatImage()
The default constructor.
Definition: FloatImage.cpp:70
Data structure for the representation of any image type (arbitrary number of channels) using the data...
Definition: FloatImage.h:62


asr_ivt
Author(s): Allgeyer Tobias, Hutmacher Robin, Kleinert Daniel, Meißner Pascal, Scholz Jonas, Stöckle Patrick
autogenerated on Mon Dec 2 2019 03:47:27