1 /*
2  *
3  *  Copyright (C) 2001-2017, OFFIS e.V.
4  *  All rights reserved.  See COPYRIGHT file for details.
5  *
6  *  This software and supporting documentation were developed by
7  *
8  *    OFFIS e.V.
9  *    R&D Division Health
10  *    Escherweg 2
11  *    D-26121 Oldenburg, Germany
12  *
13  *
14  *  Module:  dcmjpeg
15  *
16  *  Author:  Marco Eichelberg, Norbert Olges
17  *
18  *  Purpose: Codec class for decoding JPEG Lossless (8/12/16-bit)
19  *
20  */
21 
22 #include "dcmtk/config/osconfig.h"
23 #include "dcmtk/dcmjpeg/djdeclol.h"
24 #include "dcmtk/dcmjpeg/djcparam.h"
25 #include "dcmtk/dcmjpeg/djrplol.h"
26 #include "dcmtk/dcmjpeg/djdijg8.h"
27 #include "dcmtk/dcmjpeg/djdijg12.h"
28 #include "dcmtk/dcmjpeg/djdijg16.h"
29 
DJDecoderLossless()30 DJDecoderLossless::DJDecoderLossless()
31 : DJCodecDecoder()
32 {
33 }
34 
35 
~DJDecoderLossless()36 DJDecoderLossless::~DJDecoderLossless()
37 {
38 }
39 
40 
supportedTransferSyntax() const41 E_TransferSyntax DJDecoderLossless::supportedTransferSyntax() const
42 {
43   return EXS_JPEGProcess14;
44 }
45 
isLosslessProcess() const46 OFBool DJDecoderLossless::isLosslessProcess() const
47 {
48   return OFTrue;
49 }
50 
createDecoderInstance(const DcmRepresentationParameter *,const DJCodecParameter * cp,Uint8 bitsPerSample,OFBool isYBR) const51 DJDecoder *DJDecoderLossless::createDecoderInstance(
52     const DcmRepresentationParameter * /* toRepParam */,
53     const DJCodecParameter *cp,
54     Uint8 bitsPerSample,
55     OFBool isYBR) const
56 {
57   if (bitsPerSample > 12) return new DJDecompressIJG16Bit(*cp, isYBR);
58   else if (bitsPerSample > 8) return new DJDecompressIJG12Bit(*cp, isYBR);
59   else return new DJDecompressIJG8Bit(*cp, isYBR);
60 }
61