33 #include "dcmtk/config/osconfig.h"
34 #include "dcmtk/ofstd/ofstring.h"
35 #include "dcmtk/ofstd/ofcast.h"
37 #include "dcmtk/dcmimgle/diutils.h"
44 #define MIN_TABLE_ENTRY_SIZE 8
45 #define MAX_TABLE_ENTRY_SIZE 16
46 #define MAX_TABLE_ENTRY_COUNT 65536
66 const Uint16 bits = 0);
139 return OFstatic_cast(Sint32, OFstatic_cast(Sint16,
FirstEntry)) +
Count - 1;
176 return Data[pos - OFstatic_cast(Sint32, OFstatic_cast(Sint16,
FirstEntry))];
270 const Uint32 count = 0,
271 const Uint16 bits = 0);
const Uint16 * getData() const
get pointer to LUT data
Uint16 getMinValue() const
get minimum value of the LUT.
Base class to handle look-up tables.
OFBool empty() const
return true if the string is empty, false otherwise.
OFString Explanation
LUT explanation string.
Uint16 getValue(const Sint32 pos) const
get value of specified LUT entry.
Uint32 getAbsMaxRange() const
get absolute value range of the LUT entries.
Uint32 Count
number of LUT entries
Uint32 getCount() const
get number of LUT entries
Uint16 Bits
number of bits per entry
DiBaseLUT(const Uint32 count=0, const Uint16 bits=0)
constructor
Uint16 getLastValue() const
get value of last LUT entry.
Uint16 FirstEntry
first input value mapped (FIV)
Uint16 getFirstValue() const
get value of first LUT entry.
Uint16 * DataBuffer
pointer to data buffer (will be deleted in the destructor)
const Uint16 * Data
pointer to lookup table data
Uint16 getValue(const Uint32 pos) const
get value of specified LUT entry.
Sint32 getFirstEntry(const Sint32) const
get index of first LUT entry.
Uint16 getBits() const
get number of bits per entry
Sint32 getLastEntry(const Sint32) const
get index of last LUT entry.
static unsigned long maxval(const int mv_bits, const unsigned long mv_pos=1)
calculate maximum value which could be stored in the specified number of bits
Uint16 getMaxValue() const
get maximum value of the LUT.
int compare(const DiBaseLUT *lut)
compares current LUT with specified LUT
Uint16 MaxValue
maximum LUT value
int isValid() const
check whether LUT is valid
a simple string class that implements a subset of std::string.
const char * getExplanation() const
get LUT explanation string
Uint16 MinValue
minimum LUT value
virtual OFBool operator==(const DiBaseLUT &lut)
compares current LUT with specified LUT
virtual ~DiBaseLUT()
destructor
Uint16 getValue(const Uint16 pos) const
get value of specified LUT entry
const char * c_str() const
returns a pointer to the initial element of an array of length size()+1 whose first size() elements e...
int Valid
status code, indicating whether LUT is valid
Uint32 getLastEntry(const Uint32=0) const
get index of last LUT entry.
Uint32 getFirstEntry(const Uint32=0) const
get index of first LUT entry.