DCMTK  Version 3.6.1 20170228
OFFIS DICOM Toolkit
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes | List of all members
DcmCodecList Class Reference

singleton that keeps list of registered codecs for dcmdata. More...

Public Member Functions

virtual ~DcmCodecList ()
 destructor
 

Static Public Member Functions

static OFCondition registerCodec (const DcmCodec *aCodec, const DcmRepresentationParameter *aDefaultRepParam, const DcmCodecParameter *aCodecParameter)
 registers a codec object in the global list of codecs consulted by dcmdata whenever conversion to/from compressed transfer syntaxes is requested. More...
 
static OFCondition deregisterCodec (const DcmCodec *aCodec)
 deregisters a codec and it's parameter objects from the global list. More...
 
static OFCondition updateCodecParameter (const DcmCodec *aCodec, const DcmCodecParameter *aCodecParameter)
 updates the codec parameters object for a codec that has been registered before. More...
 
static OFCondition decode (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmPolymorphOBOW &uncompressedPixelData, DcmStack &pixelStack)
 looks for a codec that is able to decode from the given transfer syntax and calls the decode() method of the codec. More...
 
static OFCondition decodeFrame (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmItem *dataset, Uint32 frameNo, Uint32 &startFragment, void *buffer, Uint32 bufSize, OFString &decompressedColorModel)
 looks for a codec that is able to decode from the given transfer syntax and calls the decodeFrame() method of the codec. More...
 
static OFCondition encode (const E_TransferSyntax fromRepType, const Uint16 *pixelData, const Uint32 length, const E_TransferSyntax toRepType, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&pixSeq, DcmStack &pixelStack)
 looks for a codec that is able to encode from the given transfer syntax and calls the encode() method of the codec. More...
 
static OFCondition encode (const E_TransferSyntax fromRepType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, const E_TransferSyntax toRepType, const DcmRepresentationParameter *toRepParam, DcmPixelSequence *&toPixSeq, DcmStack &pixelStack)
 looks for a codec that is able to transcode (re-compresses) from the given transfer syntax to the given transfer syntax and calls the encode() method of the codec. More...
 
static OFBool canChangeCoding (const E_TransferSyntax fromRepType, const E_TransferSyntax toRepType)
 looks for a codec that claims to be able to convert between the given transfer syntaxes. More...
 
static OFCondition determineDecompressedColorModel (const DcmXfer &fromType, const DcmRepresentationParameter *fromParam, DcmPixelSequence *fromPixSeq, DcmItem *dataset, OFString &decompressedColorModel)
 determine color model of the decompressed image More...
 

Private Member Functions

 DcmCodecList (const DcmCodec *aCodec, const DcmRepresentationParameter *aDefaultRepParam, const DcmCodecParameter *aCodecParameter)
 constructor More...
 
 DcmCodecList (const DcmCodecList &)
 private undefined copy constructor
 
DcmCodecListoperator= (const DcmCodecList &)
 private undefined copy assignment operator
 

Private Attributes

const DcmCodeccodec
 pointer to codec object
 
const DcmRepresentationParameterdefaultRepParam
 pointer to default representation parameter
 
const DcmCodecParametercodecParameter
 pointer to codec parameter set
 

Static Private Attributes

static OFList< DcmCodecList * > registeredCodecs
 singleton list of registered codecs
 
static OFReadWriteLock codecLock
 read/write lock guarding access to singleton list
 

Detailed Description

singleton that keeps list of registered codecs for dcmdata.

All operations on the list are protected by a read/write lock and, therefore, are safe for multi-thread applications.

Constructor & Destructor Documentation

DcmCodecList::DcmCodecList ( const DcmCodec aCodec,
const DcmRepresentationParameter aDefaultRepParam,
const DcmCodecParameter aCodecParameter 
)
private

constructor

Parameters
aCodecpointer to codec object.
aDefaultRepParamdefault representation parameter.
aCodecParametercodec parameter.

Member Function Documentation

static OFBool DcmCodecList::canChangeCoding ( const E_TransferSyntax  fromRepType,
const E_TransferSyntax  toRepType 
)
static

looks for a codec that claims to be able to convert between the given transfer syntaxes.

A read lock on the list of codecs is acquired until this method returns.

Parameters
fromRepTypecurrent transfer syntax
toRepTypedesired new transfer syntax
Returns
true if transformation is supported by a codec, false otherwise.
static OFCondition DcmCodecList::decode ( const DcmXfer fromType,
const DcmRepresentationParameter fromParam,
DcmPixelSequence fromPixSeq,
DcmPolymorphOBOW uncompressedPixelData,
DcmStack pixelStack 
)
static

looks for a codec that is able to decode from the given transfer syntax and calls the decode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters
fromTypetransfer syntax to decode from
fromParamrepresentation parameter of current compressed representation, may be NULL.
fromPixSeqcompressed pixel sequence
uncompressedPixelDatauncompressed pixel data stored in this element
pixelStackstack pointing to the location of the pixel data element in the current dataset.
Returns
EC_Normal if successful, an error code otherwise.
static OFCondition DcmCodecList::decodeFrame ( const DcmXfer fromType,
const DcmRepresentationParameter fromParam,
DcmPixelSequence fromPixSeq,
DcmItem dataset,
Uint32  frameNo,
Uint32 &  startFragment,
void *  buffer,
Uint32  bufSize,
OFString decompressedColorModel 
)
static

looks for a codec that is able to decode from the given transfer syntax and calls the decodeFrame() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters
fromTypetransfer syntax to decode from
fromParamrepresentation parameter of current compressed representation, may be NULL.
fromPixSeqcompressed pixel sequence
datasetpointer to dataset in which pixel data element is contained
frameNonumber of frame, starting with 0 for the first frame
startFragmentindex of the compressed fragment that contains all or the first part of the compressed bitstream for the given frameNo. Upon successful return this parameter is updated to contain the index of the first compressed fragment of the next frame. When unknown, zero should be passed. In this case the decompression algorithm will try to determine the index by itself, which will always work if frames are decompressed in increasing order from first to last, but may fail if frames are decompressed in random order, multiple fragments per frame and multiple frames are present in the dataset, and the offset table is empty.
bufferpointer to buffer where frame is to be stored
bufSizesize of buffer in bytes
decompressedColorModelupon successful return, the color model of the decompressed image (which may be different from the one used in the compressed images) is returned in this parameter.
Returns
EC_Normal if successful, an error code otherwise.
static OFCondition DcmCodecList::deregisterCodec ( const DcmCodec aCodec)
static

deregisters a codec and it's parameter objects from the global list.

This call is safe in multi-thread operations.

Parameters
aCodecpointer to registered codec
Returns
EC_Normal if successful, an error code otherwise
static OFCondition DcmCodecList::determineDecompressedColorModel ( const DcmXfer fromType,
const DcmRepresentationParameter fromParam,
DcmPixelSequence fromPixSeq,
DcmItem dataset,
OFString decompressedColorModel 
)
static

determine color model of the decompressed image

Parameters
fromTypetransfer syntax to decode from
fromParamrepresentation parameter of current compressed representation, may be NULL
fromPixSeqcompressed pixel sequence
datasetpointer to dataset in which pixel data element is contained
decompressedColorModelupon successful return, the color model of the decompressed image (which may be different from the one used in the compressed images) is returned in this parameter
Returns
EC_Normal if successful, an error code otherwise
static OFCondition DcmCodecList::encode ( const E_TransferSyntax  fromRepType,
const Uint16 *  pixelData,
const Uint32  length,
const E_TransferSyntax  toRepType,
const DcmRepresentationParameter toRepParam,
DcmPixelSequence *&  pixSeq,
DcmStack pixelStack 
)
static

looks for a codec that is able to encode from the given transfer syntax and calls the encode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters
fromRepTypetransfer syntax to encode from
pixelDatapointer to the uncompressed image data in OW format and local byte order
lengthof the pixel data field in bytes
toRepTypetransfer syntax to compress to
toRepParamrepresentation parameter describing the desired compressed representation (e.g. JPEG quality)
pixSeqcompressed pixel sequence (pointer to new DcmPixelSequence object allocated on heap) returned in this parameter upon success.
pixelStackstack pointing to the location of the pixel data element in the current dataset.
Returns
EC_Normal if successful, an error code otherwise.
static OFCondition DcmCodecList::encode ( const E_TransferSyntax  fromRepType,
const DcmRepresentationParameter fromParam,
DcmPixelSequence fromPixSeq,
const E_TransferSyntax  toRepType,
const DcmRepresentationParameter toRepParam,
DcmPixelSequence *&  toPixSeq,
DcmStack pixelStack 
)
static

looks for a codec that is able to transcode (re-compresses) from the given transfer syntax to the given transfer syntax and calls the encode() method of the codec.

A read lock on the list of codecs is acquired until this method returns.

Parameters
fromRepTypecurrent transfer syntax of the compressed image
fromParamcurrent representation parameter of compressed data, may be NULL
fromPixSeqcompressed pixel sequence
toRepTypetransfer syntax to compress to
toRepParamrepresentation parameter describing the desired new compressed representation (e.g. JPEG quality)
toPixSeqcompressed pixel sequence (pointer to new DcmPixelSequence object allocated on heap) returned in this parameter upon success.
pixelStackstack pointing to the location of the pixel data element in the current dataset.
Returns
EC_Normal if successful, an error code otherwise.
static OFCondition DcmCodecList::registerCodec ( const DcmCodec aCodec,
const DcmRepresentationParameter aDefaultRepParam,
const DcmCodecParameter aCodecParameter 
)
static

registers a codec object in the global list of codecs consulted by dcmdata whenever conversion to/from compressed transfer syntaxes is requested.

This function must not be called before main() is started, e.g. from a constructor of a global object. This call is safe in multi-thread operations.

Parameters
aCodecpointer to codec object. Must remain unmodified and valid until the codec has been deregistered.
aDefaultRepParamdefault representation parameter. Must remain unmodified and valid until the codec has been deregistered.
aCodecParametercodec parameter. Must remain unmodified and valid until the codec has been deregistered or the parameter has been replaced by a call to updateCodecParameter()
Returns
EC_Normal if successful, an error code otherwise
static OFCondition DcmCodecList::updateCodecParameter ( const DcmCodec aCodec,
const DcmCodecParameter aCodecParameter 
)
static

updates the codec parameters object for a codec that has been registered before.

This call is safe in multi-thread operations.

Parameters
aCodecpointer to codec object that has been registered before
aCodecParametercodec parameter. Must remain unmodified and valid until the codec has been deregistered or the parameter has been replaced by another call to updateCodecParameter()
Returns
EC_Normal if successful, an error code otherwise

The documentation for this class was generated from the following file:


Generated on Tue Feb 28 2017 for DCMTK Version 3.6.1 20170228 by Doxygen 1.8.8