Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/imgcodecs/src/grfmt_pfm.hpp
16337 views
1
// This file is part of OpenCV project.
2
// It is subject to the license terms in the LICENSE file found in the top-level directory
3
// of this distribution and at http://opencv.org/license.html.
4
5
#ifndef _GRFMT_PFM_H_
6
#define _GRFMT_PFM_H_
7
8
#include "grfmt_base.hpp"
9
#include "bitstrm.hpp"
10
11
#ifdef HAVE_IMGCODEC_PFM
12
namespace cv
13
{
14
15
class PFMDecoder CV_FINAL : public BaseImageDecoder
16
{
17
public:
18
PFMDecoder();
19
virtual ~PFMDecoder() CV_OVERRIDE;
20
21
bool readData( Mat& img ) CV_OVERRIDE;
22
bool readHeader() CV_OVERRIDE;
23
void close();
24
25
size_t signatureLength() const CV_OVERRIDE;
26
bool checkSignature( const String& signature ) const CV_OVERRIDE;
27
ImageDecoder newDecoder() const CV_OVERRIDE
28
{
29
return makePtr<PFMDecoder>();
30
}
31
32
private:
33
RLByteStream m_strm;
34
double m_scale_factor;
35
bool m_swap_byte_order;
36
};
37
38
class PFMEncoder CV_FINAL : public BaseImageEncoder
39
{
40
public:
41
PFMEncoder();
42
virtual ~PFMEncoder() CV_OVERRIDE;
43
44
bool isFormatSupported( int depth ) const CV_OVERRIDE;
45
bool write( const Mat& img, const std::vector<int>& params ) CV_OVERRIDE;
46
47
ImageEncoder newEncoder() const CV_OVERRIDE
48
{
49
return makePtr<PFMEncoder>();
50
}
51
};
52
53
}
54
55
#endif // HAVE_IMGCODEC_PXM
56
57
#endif/*_GRFMT_PFM_H_*/
58