15#ifndef GDCMPIXELFORMAT_H
16#define GDCMPIXELFORMAT_H
73 unsigned short samplesperpixel,
74 unsigned short bitsallocated = 8,
75 unsigned short bitsstored = 8,
76 unsigned short highbit = 7,
77 unsigned short pixelrepresentation = 0 ) :
78 SamplesPerPixel(samplesperpixel),
79 BitsAllocated(bitsallocated),
80 BitsStored(bitsstored),
82 PixelRepresentation(pixelrepresentation) {}
95 SamplesPerPixel = spp;
96 assert( SamplesPerPixel == 1 || SamplesPerPixel == 3 || SamplesPerPixel == 4 );
102 return BitsAllocated;
113 case 0xffff: ba = 16;
break;
114 case 0x0fff: ba = 12;
break;
115 case 0x00ff: ba = 8;
break;
119 HighBit = (
unsigned short)(ba - 1);
124 PixelRepresentation = 0;
131 assert( BitsStored <= BitsAllocated );
140 case 0xffff: bs = 16;
break;
141 case 0x0fff: bs = 12;
break;
142 case 0x00ff: bs = 8;
break;
144 if( bs <= BitsAllocated && bs )
147 SetHighBit( (
unsigned short) (bs - 1) );
154 assert( HighBit < BitsStored );
164 case 0xfffe: hb = 15;
break;
165 case 0x0ffe: hb = 11;
break;
166 case 0x00fe: hb = 7;
break;
168 if( hb < BitsStored )
175 return (
unsigned short)(PixelRepresentation ? 1 : 0);
179 PixelRepresentation = (
unsigned short)(pr ? 1 : 0);
211 return GetScalarType() == st;
215 return GetScalarType() != st;
220 SamplesPerPixel == pf.SamplesPerPixel &&
221 BitsAllocated == pf.BitsAllocated &&
222 BitsStored == pf.BitsStored &&
223 HighBit == pf.HighBit &&
224 PixelRepresentation == pf.PixelRepresentation;
229 SamplesPerPixel != pf.SamplesPerPixel ||
230 BitsAllocated != pf.BitsAllocated ||
231 BitsStored != pf.BitsStored ||
232 HighBit != pf.HighBit ||
233 PixelRepresentation != pf.PixelRepresentation;
243 unsigned short SamplesPerPixel;
245 unsigned short BitsAllocated;
247 unsigned short BitsStored;
249 unsigned short HighBit;
251 unsigned short PixelRepresentation;
Bitmap class.
Definition gdcmBitmap.h:39
Class to manipulate Transfer Syntax.
Definition gdcmTransferSyntax.h:40
#define gdcmAssertMacro(arg)
Assert.
Definition gdcmTrace.h:189
#define GDCM_EXPORT
Definition gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition gdcmDirectory.h:88