SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
gdalscene.hpp
1// This file is part of slideio 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://slideio.com/license.html.
4#ifndef OPENCV_slideio_gdalscene_HPP
5#define OPENCV_slideio_gdalscene_HPP
6
7#include "slideio/drivers/gdal/gdal_api_def.hpp"
8#include "slideio/core/cvscene.hpp"
9#include "slideio/base/slideio_enums.hpp"
10#include <opencv2/core.hpp>
11#include "slideio/imagetools/gdal_lib.hpp"
12
13#if defined(_MSC_VER)
14#pragma warning( push )
15#pragma warning(disable: 4251)
16#endif
17
18namespace slideio
19{
20 class SLIDEIO_GDAL_EXPORTS GDALScene : public slideio::CVScene
21 {
22 public:
23 GDALScene(const std::string& filePath);
24 GDALScene(GDALDatasetH ds, const std::string& filePath);
25 virtual ~GDALScene();
26 std::string getFilePath() const override;
27 int getNumChannels() const override;
28 slideio::DataType getChannelDataType(int channel) const override;
29 slideio::Resolution getResolution() const override;
30 double getMagnification() const override;
31 static GDALDatasetH openFile(const std::string& filePath);
32 static void closeFile(GDALDatasetH hfile);
33 static slideio::DataType dataTypeFromGDALDataType(GDALDataType dt);
34 std::string getName() const override;
35 cv::Rect getRect() const override;
36 void readResampledBlockChannels(const cv::Rect& blockRect, const cv::Size& blockSize, const std::vector<int>& channelIndices, cv::OutputArray output) override;
37 Compression getCompression() const override{
38 return m_compression;
39 }
40 private:
41 void init();
42 private:
43 GDALDatasetH m_hFile;
44 std::string m_filePath;
45 Compression m_compression;
46 };
47}
48
49#if defined(_MSC_VER)
50#pragma warning( pop )
51#endif
52
53#endif
54
class CVScene represents a base class for opencv based representations of raster images contained in ...
Definition: cvscene.hpp:37
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12