comparison ViewerPlugin/RawTile.h @ 260:35c241231af2 iiif

reorganization
author Sebastien Jodogne <s.jodogne@gmail.com>
date Mon, 10 Jul 2023 08:31:50 +0200
parents
children c72fbdecdc38
comparison
equal deleted inserted replaced
259:3e511f10896c 260:35c241231af2
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 * Copyright (C) 2017-2023 Osimis S.A., Belgium
6 * Copyright (C) 2021-2023 Sebastien Jodogne, ICTEAM UCLouvain, Belgium
7 *
8 * This program is free software: you can redistribute it and/or
9 * modify it under the terms of the GNU Affero General Public License
10 * as published by the Free Software Foundation, either version 3 of
11 * the License, or (at your option) any later version.
12 *
13 * This program is distributed in the hope that it will be useful, but
14 * WITHOUT ANY WARRANTY; without even the implied warranty of
15 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 * Affero General Public License for more details.
17 *
18 * You should have received a copy of the GNU Affero General Public License
19 * along with this program. If not, see <http://www.gnu.org/licenses/>.
20 **/
21
22
23 #pragma once
24
25 #include "../Framework/Enumerations.h"
26 #include "../Framework/Inputs/ITiledPyramid.h"
27
28 #include <orthanc/OrthancCPlugin.h>
29
30
31 class RawTile : public boost::noncopyable
32 {
33 private:
34 Orthanc::PixelFormat format_;
35 unsigned int tileWidth_;
36 unsigned int tileHeight_;
37 Orthanc::PhotometricInterpretation photometric_;
38 std::string tile_;
39 OrthancWSI::ImageCompression compression_;
40
41 Orthanc::ImageAccessor* DecodeInternal();
42
43 static void EncodeInternal(std::string& encoded,
44 const Orthanc::ImageAccessor& decoded,
45 Orthanc::MimeType transcodingType);
46
47 public:
48 RawTile(OrthancWSI::ITiledPyramid& pyramid,
49 unsigned int level,
50 unsigned int tileX,
51 unsigned int tileY);
52
53 void Answer(OrthancPluginRestOutput* output,
54 Orthanc::MimeType transcodingType);
55
56 Orthanc::ImageAccessor* Decode();
57
58 static void Encode(std::string& encoded,
59 const Orthanc::ImageAccessor& decoded,
60 Orthanc::MimeType transcodingType);
61
62 // This semaphore is used to implement throttling for the
63 // decoding/encoding of tiles
64 static void InitializeTranscoderSemaphore(unsigned int maxThreads);
65
66 static void FinalizeTranscoderSemaphore();
67 };