SlideIO 2.0.0
Open-source library for reading of medical images
Loading...
Searching...
No Matches
jp2decoder.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 "dcmtk/dcmdata/dccodec.h"
6
7namespace slideio
8{
9
10 class Jp2Decoder : public DcmCodec
11 {
12 public:
13 enum Photometric
14 {
15 DVPI_Unknown,
16 DVPI_Monochrome1,
17 DVPI_Monochrome2,
18 DVPI_PaletteColor,
19 DVPI_RGB,
20 DVPI_HSV,
21 DVPI_ARGB,
22 DVPI_CMYK,
23 DVPI_YBR_Full,
24 DVPI_YBR_Full_422,
25 DVPI_YBR_Partial_422,
26 DVPI_YBR_RCT,
27 DVPI_YBR_ICT,
28 };
29
30 static Photometric DVPhotometricFromDCMTKString(const char* szName);
31 public:
32 Jp2Decoder(void);
33 ~Jp2Decoder(void);
34
35 virtual OFCondition decode(
36 const DcmRepresentationParameter* fromRepParam,
37 DcmPixelSequence* pixSeq,
38 DcmPolymorphOBOW& uncompressedPixelData,
39 const DcmCodecParameter* cp,
40 const DcmStack& objStack) const;
41
42 OFCondition encode(const Uint16* pixelData, const Uint32 length, const DcmRepresentationParameter* toRepParam,
43 DcmPixelSequence*& pixSeq, const DcmCodecParameter* cp, DcmStack& objStack,
44 OFBool& removeOldRep) const override;
45
46 OFCondition encode(const E_TransferSyntax fromRepType, const DcmRepresentationParameter* fromRepParam,
47 DcmPixelSequence* fromPixSeq, const DcmRepresentationParameter* toRepParam, DcmPixelSequence*& toPixSeq,
48 const DcmCodecParameter* cp, DcmStack& objStack, OFBool& removeOldRep) const override;
49
50 virtual OFBool canChangeCoding(
51 const E_TransferSyntax oldRepType,
52 const E_TransferSyntax newRepType) const override;
53
54 OFCondition decode(const DcmRepresentationParameter* fromRepParam, DcmPixelSequence* pixSeq,
55 DcmPolymorphOBOW& uncompressedPixelData, const DcmCodecParameter* cp, const DcmStack& objStack,
56 OFBool& removeOldRep) const override;
57
58 OFCondition decodeFrame(const DcmRepresentationParameter* fromParam, DcmPixelSequence* fromPixSeq,
59 const DcmCodecParameter* cp, DcmItem* dataset, Uint32 frameNo, Uint32& startFragment, void* buffer,
60 Uint32 bufSize, std::string& decompressedColorModel) const override;
61
62 OFCondition determineDecompressedColorModel(const DcmRepresentationParameter* fromParam,
63 DcmPixelSequence* fromPixSeq, const DcmCodecParameter* cp, DcmItem* dataset,
64 std::string& decompressedColorModel) const override;
65 };
66
67}
Definition: exceptions.hpp:12