4#ifndef OPENCV_slideio_scnscene_HPP
5#define OPENCV_slideio_scnscene_HPP
7#include "slideio/drivers/scn/scn_api_def.hpp"
8#include "slideio/core/cvscene.hpp"
9#include "slideio/imagetools/tifftools.hpp"
10#include "slideio/core/tools/tilecomposer.hpp"
11#include "slideio/drivers/scn/scnstruct.h"
12#include "slideio/imagetools/tiffkeeper.hpp"
20#pragma warning( push )
21#pragma warning(disable: 4251)
26 class SLIDEIO_SCN_EXPORTS SCNScene :
public CVScene,
public Tiler
34 SCNScene(
const std::string& filePath,
const tinyxml2::XMLElement* xmlImage);
38 std::string getFilePath()
const override {
41 std::string getName()
const override {
47 slideio::Resolution getResolution()
const override{
50 double getMagnification()
const override{
51 return m_magnification;
53 DataType getChannelDataType(
int channelIndex)
const override{
54 return m_channelDataType[channelIndex];
56 const std::vector<TiffDirectory>& getChannelDirectories(
int channelIndex)
const {
57 const int dirIndex = m_interleavedChannels ? 0 : channelIndex;
58 return m_channelDirectories[dirIndex];
60 cv::Rect getRect()
const override;
61 int getNumChannels()
const override;
62 void readResampledBlockChannels(
const cv::Rect& blockRect,
const cv::Size& blockSize,
63 const std::vector<int>& channelIndices, cv::OutputArray output)
override;
64 std::string getChannelName(
int channel)
const override;
65 int getTileCount(
void* userData)
override;
66 bool getTileRect(
int tileIndex, cv::Rect& tileRect,
void* userData)
override;
67 bool readTile(
int tileIndex,
const std::vector<int>& channelIndices, cv::OutputArray tileRaster,
68 void* userData)
override;
69 void initializeBlock(
const cv::Size& blockSize,
const std::vector<int>& channelIndices, cv::OutputArray output)
override;
70 const TiffDirectory& findZoomDirectory(
int channelIndex,
double zoom)
const;
72 void init(
const tinyxml2::XMLElement* xmlImage);
73 static std::vector<SCNDimensionInfo> parseDimensions(
const tinyxml2::XMLElement* xmlPixels);
74 void parseChannelNames(
const tinyxml2::XMLElement* xmlImage);
75 void parseGeometry(
const tinyxml2::XMLElement* xmlImage);
76 void parseMagnification(
const tinyxml2::XMLElement* xmlImage);
77 void defineChannelDataType();
78 void setupChannels(
const tinyxml2::XMLElement* xmlPixels);
79 libtiff::TIFF* getFileHandle() {
85 std::string m_filePath;
87 std::string m_reawMetadata;
89 Resolution m_resolution;
90 double m_magnification;
93 std::vector<std::string> m_channelNames;
94 std::vector<DataType> m_channelDataType;
95 std::vector<std::vector<TiffDirectory>> m_channelDirectories;
96 bool m_interleavedChannels;
101#pragma warning( pop )
Definition: exceptions.hpp:12
Compression
raster data compression enum
Definition: slideio_enums.hpp:12