comparison Framework/Inputs/DecodedTiledPyramid.h @ 0:4a7a53257c7d

initial commit
author Sebastien Jodogne <s.jodogne@gmail.com>
date Sat, 22 Oct 2016 21:48:33 +0200
parents
children 91fc9583b2de
comparison
equal deleted inserted replaced
-1:000000000000 0:4a7a53257c7d
1 /**
2 * Orthanc - A Lightweight, RESTful DICOM Store
3 * Copyright (C) 2012-2016 Sebastien Jodogne, Medical Physics
4 * Department, University Hospital of Liege, Belgium
5 *
6 * This program is free software: you can redistribute it and/or
7 * modify it under the terms of the GNU Affero General Public License
8 * as published by the Free Software Foundation, either version 3 of
9 * the License, or (at your option) any later version.
10 *
11 * This program is distributed in the hope that it will be useful, but
12 * WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
14 * Affero General Public License for more details.
15 *
16 * You should have received a copy of the GNU Affero General Public License
17 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 **/
19
20
21 #pragma once
22
23 #include "ITiledPyramid.h"
24
25
26 namespace OrthancWSI
27 {
28 /**
29 * This class acts as a wrapper for "cropped" tiled images, where
30 * the tiles at the right or at the bottom might not have the same
31 * dimensions of the other slides.
32 **/
33 class DecodedTiledPyramid : public ITiledPyramid
34 {
35 private:
36 uint8_t backgroundColor_[3];
37
38 protected:
39 // Subclasses can assume that the requested region is fully inside
40 // the image, and that target has the proper size to store the
41 // region. Pay attention to implement mutual exclusion in subclasses.
42 virtual void ReadRegion(Orthanc::ImageAccessor& target,
43 unsigned int level,
44 unsigned int x,
45 unsigned int y) = 0;
46
47 public:
48 DecodedTiledPyramid();
49
50 void SetBackgroundColor(uint8_t red,
51 uint8_t green,
52 uint8_t blue);
53
54 void GetBackgroundColor(uint8_t& red,
55 uint8_t& green,
56 uint8_t& blue) const;
57
58 virtual Orthanc::ImageAccessor* DecodeTile(unsigned int level,
59 unsigned int tileX,
60 unsigned int tileY);
61
62 virtual ImageCompression GetImageCompression() const
63 {
64 return ImageCompression_None;
65 }
66
67 virtual bool ReadRawTile(std::string& tile,
68 unsigned int level,
69 unsigned int tileX,
70 unsigned int tileY)
71 {
72 return false; // No access to the raw tiles
73 }
74 };
75 }