SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
colortransformation.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#pragma once
5#include "transformer_def.hpp"
6#include "transformation.hpp"
7
8namespace slideio
9{
10 enum class ColorSpace
11 {
12 RGB,
13 GRAY,
14 HSV,
15 HLS,
16 YUV,
17 YCbCr,
18 XYZ,
19 LAB,
20 LUV,
21 };
22
23 class SLIDEIO_TRANSFORMER_EXPORTS ColorTransformation : public slideio::Transformation
24 {
25 public:
26 ColorTransformation() {
27 m_type = TransformationType::ColorTransformation;
28 m_colorSpace = ColorSpace::RGB;
29 }
30 ColorSpace getColorSpace() const {
31 return m_colorSpace;
32 }
33 void setColorSpace(ColorSpace colorSpace) {
34 m_colorSpace = colorSpace;
35 }
36
37 void applyTransformation(const cv::Mat& block, cv::OutputArray transformedBlock) const override;
38 std::vector<DataType> computeChannelDataTypes(const std::vector<DataType>& channels) const override;
39
40 private:
41 ColorSpace m_colorSpace;
42 };
43}
Definition: exceptions.hpp:12