5#include "slideio/core/slideio_core_def.hpp"
6#include <opencv2/core.hpp>
10#pragma warning( push )
11#pragma warning(disable: 4251)
16 class SLIDEIO_CORE_EXPORTS LevelInfo
19 friend std::ostream& operator<<(std::ostream& os,
const slideio::LevelInfo& levelInfo)
21 os <<
"Level: " << levelInfo.getLevel() << std::endl;
22 os <<
"Size: " << levelInfo.getSize().width <<
"x" << levelInfo.getSize().height << std::endl;
23 os <<
"Scale: " << levelInfo.getScale() << std::endl;
24 os <<
"Magnification: " << levelInfo.getMagnification() << std::endl;
25 os <<
"Tile Size: " << levelInfo.getTileSize().width <<
"x" << levelInfo.getTileSize().height << std::endl;
29 LevelInfo() =
default;
31 LevelInfo(
int level,
const cv::Size& size,
double scale,
double magnification,
const cv::Size& tileSize)
32 : m_level(level), m_size(size), m_scale(scale), m_magnification(magnification), m_tileSize(tileSize) {}
34 LevelInfo(
const LevelInfo& other) {
35 m_level = other.m_level;
36 m_size = other.m_size;
37 m_scale = other.m_scale;
38 m_magnification = other.m_magnification;
39 m_tileSize = other.m_tileSize;
42 LevelInfo& operator=(
const LevelInfo& other) {
44 m_level = other.m_level;
45 m_size = other.m_size;
46 m_scale = other.m_scale;
47 m_magnification = other.m_magnification;
48 m_tileSize = other.m_tileSize;
53 bool operator==(
const LevelInfo& other)
const {
54 return m_level == other.m_level &&
55 m_size.width == other.m_size.width &&
56 m_size.height == other.m_size.height &&
57 fabs(m_scale - other.m_scale) < 1.e-2 &&
58 fabs(m_magnification - other.m_magnification) < 1.e-2 &&
59 m_tileSize.width == other.m_tileSize.width &&
60 m_tileSize.height == other.m_tileSize.height;
63 int getLevel()
const {
return m_level; }
64 void setLevel(
int level) { m_level = level; }
66 cv::Size getSize()
const {
return m_size; }
67 void setSize(
const cv::Size& size) { m_size = size; }
69 double getScale()
const {
return m_scale; }
70 void setScale(
double scale) { m_scale = scale; }
72 double getMagnification()
const {
return m_magnification; }
73 void setMagnification(
double magnification) { m_magnification = magnification; }
75 cv::Size getTileSize()
const {
return m_tileSize; }
76 void setTileSize(
const cv::Size& tileSize) { m_tileSize = tileSize; }
78 std::string toString()
const {
88 double m_magnification = 0.0;
Definition: exceptions.hpp:12