/usr/include/dcmtk/dcmjpeg/djcparam.h is in libdcmtk-dev 3.6.2-3build3.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 347 348 349 350 351 352 353 354 355 356 357 358 359 360 361 362 363 364 365 366 367 368 369 370 371 372 373 374 375 376 377 378 379 380 381 382 383 384 385 386 387 388 389 390 391 392 393 394 395 396 397 398 399 400 401 402 403 404 405 406 407 408 409 410 411 412 413 414 415 416 417 418 419 | /*
*
* Copyright (C) 1997-2016, OFFIS e.V.
* All rights reserved. See COPYRIGHT file for details.
*
* This software and supporting documentation were developed by
*
* OFFIS e.V.
* R&D Division Health
* Escherweg 2
* D-26121 Oldenburg, Germany
*
*
* Module: dcmjpeg
*
* Author: Norbert Olges, Marco Eichelberg
*
* Purpose: codec parameter class for dcmjpeg codecs
*
*/
#ifndef DJCPARAM_H
#define DJCPARAM_H
#include "dcmtk/config/osconfig.h"
#include "dcmtk/dcmdata/dccodec.h" /* for DcmCodecParameter */
#include "dcmtk/dcmjpeg/djutils.h" /* for enums */
/** codec parameter for IJG codecs
*/
class DCMTK_DCMJPEG_EXPORT DJCodecParameter: public DcmCodecParameter
{
public:
/** constructor.
* @param pCompressionCSConversion color conversion mode for compression
* @param pDecompressionCSConversion color conversion mode for decompression
* @param pCreateSOPInstanceUID mode for SOP Instance UID creation
* @param pPlanarConfiguration flag describing how planar configuration of
* decompressed color images should be handled
* @param predictor6WorkaroundEnable enable workaround for buggy lossless compressed images with
* overflow in predictor 6 for images with 16 bits/pixel
* @param pForceSingleFragmentPerFrame while decompressing a multiframe image,
* assume one fragment per frame even if the JPEG data for some frame is incomplete
* @param pOptimizeHuffman perform huffman table optimization for 8 bits/pixel compression?
* @param pSmoothingFactor smoothing factor for image compression, 0..100
* @param pForcedBitDepth forced bit depth for image compression, 0 (auto) or 8/12/16
* @param pFragmentSize maximum fragment size (in kbytes) for compression, 0 for unlimited.
* @param pCreateOffsetTable create offset table during image compression?
* @param pSampleFactors subsampling mode for color image compression
* @param pWriteYBR422 flag indicating whether a compressed YBR color stream should
* be marked as YBR_FULL or YBR_FULL_422 on DICOM level
* @param pConvertToSC flag indicating whether image should be converted to
* Secondary Capture upon compression
* @param pWindowType mode for VOI transformation of monochrome images
* @param pWindowParameter parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6
* @param pVoiCenter VOI window center for mode 5
* @param pVoiWidth VOI window width for mode 5
* @param pRoiLeft Region of Interest left corner for for VOI transform of monochrome images, mode 7
* @param pRoiTop Region of Interest upper corner for for VOI transform of monochrome images, mode 7
* @param pRoiWidth Region of Interest width for for VOI transform of monochrome images, mode 7
* @param pRoiHeight Region of Interest height for for VOI transform of monochrome images, mode 7
* @param pUsePixelValues check smallest and largest pixel value and optimize compression, mode 0 only
* @param pUseModalityRescale create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only
* @param pAcceptWrongPaletteTags accept wrong palette attribute tags (only "pseudo lossless" encoder)
* @param pAcrNemaCompatibility accept old ACR-NEMA images without photometric interpretation
* (only "pseudo" lossless encoder)
* @param pTrueLosslessMode Enables true lossless compression (replaces old "pseudo lossless" encoder)
*/
DJCodecParameter(
E_CompressionColorSpaceConversion pCompressionCSConversion,
E_DecompressionColorSpaceConversion pDecompressionCSConversion,
E_UIDCreation pCreateSOPInstanceUID,
E_PlanarConfiguration pPlanarConfiguration,
OFBool predictor6WorkaroundEnable = OFFalse,
OFBool pForceSingleFragmentPerFrame = OFFalse,
OFBool pOptimizeHuffman = OFFalse,
int pSmoothingFactor = 0,
int pForcedBitDepth = 0,
Uint32 pFragmentSize = 0,
OFBool pCreateOffsetTable = OFTrue,
E_SubSampling pSampleFactors = ESS_444,
OFBool pWriteYBR422 = OFFalse,
OFBool pConvertToSC = OFFalse,
size_t pWindowType = 0,
size_t pWindowParameter = 0,
double pVoiCenter = 0.0,
double pVoiWidth = 0.0,
size_t pRoiLeft = 0,
size_t pRoiTop = 0,
size_t pRoiWidth = 0,
size_t pRoiHeight = 0,
OFBool pUsePixelValues = OFTrue,
OFBool pUseModalityRescale = OFFalse,
OFBool pAcceptWrongPaletteTags = OFFalse,
OFBool pAcrNemaCompatibility = OFFalse,
OFBool pTrueLosslessMode = OFTrue);
/// copy constructor
DJCodecParameter(const DJCodecParameter& arg);
/// destructor
virtual ~DJCodecParameter();
/** this methods creates a copy of type DcmCodecParameter *
* it must be overweritten in every subclass.
* @return copy of this object
*/
virtual DcmCodecParameter *clone() const;
/** returns the class name as string.
* can be used as poor man's RTTI replacement.
*/
virtual const char *className() const;
/** returns huffman table optimization flag for 8 bits/pixel compression
* @return huffman table optimization flag for 8 bits/pixel compression
*/
OFBool getOptimizeHuffmanCoding() const
{
return optimizeHuffman;
}
/** returns smoothing factor for image compression, 0..100
* @return smoothing factor for image compression, 0..100
*/
int getSmoothingFactor() const
{
return smoothingFactor;
}
/** returns forced bit depth for image compression, 0 (auto) or 8/12/16
* @return forced bit depth for image compression
*/
int getForcedBitDepth() const
{
return forcedBitDepth;
}
/** returns maximum fragment size (in kbytes) for compression, 0 for unlimited.
* @returnmaximum fragment size for compression
*/
Uint32 getFragmentSize() const
{
return fragmentSize;
}
/** returns offset table creation flag
* @return offset table creation flag
*/
OFBool getCreateOffsetTable() const
{
return createOffsetTable;
}
/** returns subsampling mode for color image compression
* @return subsampling mode for color image compression
*/
E_SubSampling getSampleFactors() const
{
return sampleFactors;
}
/** returns flag indicating whether a compressed YBR color stream should be marked
* as YBR_FULL or YBR_FULL_422 on DICOM level
* @return YBR422 flag
*/
OFBool getWriteYBR422() const
{
return writeYBR422;
}
/** returns secondary capture conversion flag
* @return secondary capture conversion flag
*/
OFBool getConvertToSC() const
{
return convertToSC;
}
/** returns mode for SOP Instance UID creation
* @return mode for SOP Instance UID creation
*/
E_UIDCreation getUIDCreation() const
{
return uidCreation;
}
/** returns mode for VOI transformation of monochrome images.
* @return mode for VOI transformation of monochrome images
*/
size_t getWindowType() const
{
return windowType;
}
/** returns parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6
* @return parameter for VOI transform of monochrome images, used in VOI modes 1, 2, 4, 6
*/
size_t getWindowParameter() const
{
return windowParameter;
}
/** returns VOI window center and width for VOI mode 5
* @param center VOI center returned in this parameter
* @param width VOI width returned in this parameter
*/
void getVOIWindow(double& center, double& width) const
{
center = voiCenter;
width = voiWidth;
}
/** returns ROI coordinates for VOI mode 7
* @param left_pos ROI left edge returned in this parameter
* @param top_pos ROI top edge returned in this parameter
* @param width ROI width returned in this parameter
* @param height ROI height returned in this parameter
*/
void getROI(
size_t& left_pos,
size_t& top_pos,
size_t& width,
size_t& height) const
{
left_pos = roiLeft;
top_pos = roiTop;
width = roiWidth;
height = roiHeight;
}
/** returns planar configuration flag
* @return planar configuration flag
*/
E_PlanarConfiguration getPlanarConfiguration() const
{
return planarConfiguration;
}
/** returns color conversion mode for compression
* @return color conversion mode for compression
*/
E_CompressionColorSpaceConversion getCompressionColorSpaceConversion() const
{
return compressionCSConversion;
}
/** returns color conversion mode for compression
* @return color conversion mode for compression
*/
E_DecompressionColorSpaceConversion getDecompressionColorSpaceConversion() const
{
return decompressionCSConversion;
}
/** returns flag indicating if compression to be optimized for real pixel values
* @return flag indicating if compression to be optimized for real pixel values
*/
OFBool getUsePixelValues() const
{
return usePixelValues;
}
/** returns flag indicating if compression should compute Rescale Slope/Intercept
* @return flag indicating if compression should compute Rescale Slope/Intercept
*/
OFBool getUseModalityRescale() const
{
return useModalityRescale;
}
/** Returns flag indicating if incorrect palette attribute tags should be accepted
* @return flag indicating if incorrect palette attribute tags should be accepted
*/
OFBool getAcceptWrongPaletteTags() const
{
return acceptWrongPaletteTags;
}
/** Returns flag indicating if compatibility to old ACR-NEMA images without
* photometric interpretation is enabled.
* @return flag indicating if ACR-NEMA compatibility is enabled
*/
OFBool getAcrNemaCompatibility() const
{
return acrNemaCompatibility;
}
/** returns flag indicating if real lossless mode is enabled
* @return flag indicating if real lossless mode is enabled
*/
OFBool getTrueLosslessMode() const
{
return trueLosslessMode;
}
/** returns flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
* @return flag indicating whether the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
*/
OFBool predictor6WorkaroundEnabled() const
{
return predictor6WorkaroundEnabled_;
}
/** returns flag indicating whether one fragment per frame should be enforced while decoding
* @return flag indicating whether one fragment per frame should be enforced while decoding
*/
OFBool getForceSingleFragmentPerFrame() const
{
return forceSingleFragmentPerFrame;
}
private:
/// private undefined copy assignment operator
DJCodecParameter& operator=(const DJCodecParameter&);
/// color conversion mode for compression
E_CompressionColorSpaceConversion compressionCSConversion;
/// color conversion mode for decompression
E_DecompressionColorSpaceConversion decompressionCSConversion;
/// flag describing how planar configuration of decompressed color images should be handled
E_PlanarConfiguration planarConfiguration;
/// perform huffman table optimization for 8 bits/pixel compression?
OFBool optimizeHuffman;
/// smoothing factor for image compression, 0..100
int smoothingFactor;
/// forced bit depth for image compression, 0 (auto) or 8/12/16
int forcedBitDepth;
/// maximum fragment size (in kbytes) for compression, 0 for unlimited.
Uint32 fragmentSize;
/// create offset table during image compression
OFBool createOffsetTable;
/// subsampling mode for color image compression
E_SubSampling sampleFactors;
/** flag indicating whether a compressed YBR color stream should be marked
* as YBR_FULL or YBR_FULL_422 on DICOM level
*/
OFBool writeYBR422;
/// flag indicating whether image should be converted to Secondary Capture upon compression
OFBool convertToSC;
/// mode for SOP Instance UID creation
E_UIDCreation uidCreation;
/** mode for VOI transformation of monochrome images. possible values:
0: no VOI transformation (default). See also variables
usePixelValues (default) or useModalityRescale denoting two
further variables tweaking compression behaviour.
1: use the n-th VOI window from the image file (see variable windowType)
2: use the n-th VOI look up table from the image file (see variable windowType)
3: compute VOI window using min-max algorithm
4: compute VOI window using Histogram algorithm, ignoring n percent
5: compute VOI window using center r and width s
6: compute VOI window using min-max algorithm ignoring extremes
7: compute region of interest VOI window
*/
size_t windowType;
/// parameter for VOI transform of monochrome images, used in modes 1, 2, 4, 6
size_t windowParameter;
/// VOI window center for mode 5
double voiCenter;
/// VOI window width for mode 5
double voiWidth;
/// Region of Interest left corner for for VOI transform of monochrome images, mode 7
size_t roiLeft;
/// Region of Interest upper corner for for VOI transform of monochrome images, mode 7
size_t roiTop;
/// Region of Interest width for for VOI transform of monochrome images, mode 7
size_t roiWidth;
/// Region of Interest height for for VOI transform of monochrome images, mode 7
size_t roiHeight;
/// Check smallest and largest pixel value and optimize compression, mode 0 only
OFBool usePixelValues;
/// Create Rescale Slope/Intercept to scale back to original pixel range, mode 0 only
OFBool useModalityRescale;
/// Accept wrong palette attribute tags
OFBool acceptWrongPaletteTags;
/// Compatibility with old ACR-NEMA images without photometric interpretation
OFBool acrNemaCompatibility;
/// True losless mode, replaces old "pseudo" lossless encoders, when true (default)
OFBool trueLosslessMode;
/// flag indicating that the workaround for buggy JPEG lossless images with incorrect predictor 6 is enabled
OFBool predictor6WorkaroundEnabled_;
/** flag indicating that while decompressing a multiframe image one fragment per frame
* should be assumed even if the JPEG data for some frame is incomplete
*/
OFBool forceSingleFragmentPerFrame;
};
#endif
|