OFFIS DCMTK  Version 3.6.0
djerror.h
1 /*
2  *
3  * Copyright (C) 1997-2010, 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: dcmjpls
15  *
16  * Author: Uli Schlachter
17  *
18  * Purpose: Helper function than converts between CharLS and dcmjpgls errors
19  *
20  * Last Update: $Author: joergr $
21  * Update Date: $Date: 2010-10-14 13:20:24 $
22  * CVS/RCS Revision: $Revision: 1.5 $
23  * Status: $State: Exp $
24  *
25  * CVS/RCS Log at end of file
26  *
27  */
28 
29 #ifndef DJERROR_H
30 #define DJERROR_H
31 
32 #include "dcmtk/config/osconfig.h"
33 #include "dcmtk/dcmjpls/djlsutil.h" /* For the OFCondition codes */
34 #include "CharLS/interface.h" /* CharLS include */
35 
38 class DJLSError
39 {
40 private:
42  DJLSError();
43 
44 public:
45 
50  static const OFCondition& convert(JLS_ERROR error)
51  {
52  switch (error)
53  {
54  case OK:
55  return EC_Normal;
56  case UncompressedBufferTooSmall:
57  return EC_JLSUncompressedBufferTooSmall;
58  case CompressedBufferTooSmall:
59  return EC_JLSCompressedBufferTooSmall;
60  case ImageTypeNotSupported:
61  return EC_JLSCodecUnsupportedImageType;
62  case InvalidJlsParameters:
63  return EC_JLSCodecInvalidParameters;
64  case ParameterValueNotSupported:
65  return EC_JLSCodecUnsupportedValue;
66  case InvalidCompressedData:
67  return EC_JLSInvalidCompressedData;
68  case UnsupportedBitDepthForTransform:
69  return EC_JLSUnsupportedBitDepthForTransform;
70  case UnsupportedColorTransform:
71  return EC_JLSUnsupportedColorTransform;
72  case TooMuchCompressedData:
73  return EC_JLSTooMuchCompressedData;
74  default:
75  return EC_IllegalParameter;
76  }
77  }
78 };
79 
80 #endif
81 
82 /*
83  * CVS/RCS Log:
84  * $Log: djerror.h,v $
85  * Revision 1.5 2010-10-14 13:20:24 joergr
86  * Updated copyright header. Added reference to COPYRIGHT file.
87  *
88  * Revision 1.4 2010-02-25 08:50:38 uli
89  * Updated to latest CharLS version.
90  *
91  * Revision 1.3 2010-01-19 15:19:06 uli
92  * Made file names fit into 8.3 format.
93  *
94  * Revision 1.2 2009-10-07 13:16:47 uli
95  * Switched to logging mechanism provided by the "new" oflog module.
96  *
97  * Revision 1.1 2009-07-31 09:05:43 meichel
98  * Added more detailed error messages, minor code clean-up
99  *
100  *
101  */


Generated on Thu Dec 20 2012 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.8.2