dcmjpls/libsrc/djerror.h

00001 /*
00002  *
00003  *  Copyright (C) 1997-2010, OFFIS e.V.
00004  *  All rights reserved.  See COPYRIGHT file for details.
00005  *
00006  *  This software and supporting documentation were developed by
00007  *
00008  *    OFFIS e.V.
00009  *    R&D Division Health
00010  *    Escherweg 2
00011  *    D-26121 Oldenburg, Germany
00012  *
00013  *
00014  *  Module:  dcmjpls
00015  *
00016  *  Author:  Uli Schlachter
00017  *
00018  *  Purpose: Helper function than converts between CharLS and dcmjpgls errors
00019  *
00020  *  Last Update:      $Author: joergr $
00021  *  Update Date:      $Date: 2010-10-14 13:20:24 $
00022  *  CVS/RCS Revision: $Revision: 1.5 $
00023  *  Status:           $State: Exp $
00024  *
00025  *  CVS/RCS Log at end of file
00026  *
00027  */
00028 
00029 #ifndef DJERROR_H
00030 #define DJERROR_H
00031 
00032 #include "dcmtk/config/osconfig.h"
00033 #include "dcmtk/dcmjpls/djlsutil.h" /* For the OFCondition codes */
00034 #include "intrface.h" /* CharLS include */
00035 
00038 class DJLSError
00039 {
00040 private:
00042   DJLSError();
00043 
00044 public:
00045 
00050   static const OFCondition& convert(JLS_ERROR error)
00051   {
00052     switch (error)
00053     {
00054       case OK:
00055         return EC_Normal;
00056       case UncompressedBufferTooSmall:
00057         return EC_JLSUncompressedBufferTooSmall;
00058       case CompressedBufferTooSmall:
00059         return EC_JLSCompressedBufferTooSmall;
00060       case ImageTypeNotSupported:
00061         return EC_JLSCodecUnsupportedImageType;
00062       case InvalidJlsParameters:
00063         return EC_JLSCodecInvalidParameters;
00064       case ParameterValueNotSupported:
00065         return EC_JLSCodecUnsupportedValue;
00066       case InvalidCompressedData:
00067         return EC_JLSInvalidCompressedData;
00068       case UnsupportedBitDepthForTransform:
00069         return EC_JLSUnsupportedBitDepthForTransform;
00070       case UnsupportedColorTransform:
00071         return EC_JLSUnsupportedColorTransform;
00072       case TooMuchCompressedData:
00073         return EC_JLSTooMuchCompressedData;
00074       default:
00075         return EC_IllegalParameter;
00076     }
00077   }
00078 };
00079 
00080 #endif
00081 
00082 /*
00083  * CVS/RCS Log:
00084  * $Log: djerror.h,v $
00085  * Revision 1.5  2010-10-14 13:20:24  joergr
00086  * Updated copyright header. Added reference to COPYRIGHT file.
00087  *
00088  * Revision 1.4  2010-02-25 08:50:38  uli
00089  * Updated to latest CharLS version.
00090  *
00091  * Revision 1.3  2010-01-19 15:19:06  uli
00092  * Made file names fit into 8.3 format.
00093  *
00094  * Revision 1.2  2009-10-07 13:16:47  uli
00095  * Switched to logging mechanism provided by the "new" oflog module.
00096  *
00097  * Revision 1.1  2009-07-31 09:05:43  meichel
00098  * Added more detailed error messages, minor code clean-up
00099  *
00100  *
00101  */


Generated on 6 Jan 2011 for OFFIS DCMTK Version 3.6.0 by Doxygen 1.5.1