15 #ifndef GDCMPIXELFORMAT_H
16 #define GDCMPIXELFORMAT_H
60 unsigned short samplesperpixel = 1,
61 unsigned short bitsallocated = 8,
62 unsigned short bitsstored = 8,
63 unsigned short highbit = 7,
64 unsigned short pixelrepresentation = 0 ) :
65 SamplesPerPixel(samplesperpixel),
66 BitsAllocated(bitsallocated),
67 BitsStored(bitsstored),
69 PixelRepresentation(pixelrepresentation) {}
79 unsigned short GetSamplesPerPixel()
const;
83 SamplesPerPixel = spp;
84 assert( SamplesPerPixel == 1 || SamplesPerPixel == 3 || SamplesPerPixel == 4 );
98 HighBit = (
unsigned short)(ba - 1);
103 PixelRepresentation = 0;
110 assert( BitsStored <= BitsAllocated );
115 if( bs <= BitsAllocated && bs )
118 SetHighBit( (
unsigned short) (bs - 1) );
125 assert( HighBit < BitsStored );
130 if( hb < BitsStored )
137 return (
unsigned short)(PixelRepresentation ? 1 : 0);
141 PixelRepresentation = (
unsigned short)(pr ? 1 : 0);
145 ScalarType GetScalarType()
const;
149 void SetScalarType(ScalarType st);
150 const char *GetScalarTypeAsString()
const;
157 uint8_t GetPixelSize()
const;
160 void Print(std::ostream &os)
const;
163 int64_t GetMin()
const;
166 int64_t GetMax()
const;
169 bool IsValid()
const;
173 return GetScalarType() == st;
177 return GetScalarType() != st;
182 SamplesPerPixel == pf.SamplesPerPixel &&
183 BitsAllocated == pf.BitsAllocated &&
184 BitsStored == pf.BitsStored &&
185 HighBit == pf.HighBit &&
186 PixelRepresentation == pf.PixelRepresentation;
191 SamplesPerPixel != pf.SamplesPerPixel ||
192 BitsAllocated != pf.BitsAllocated ||
193 BitsStored != pf.BitsStored ||
194 HighBit != pf.HighBit ||
195 PixelRepresentation != pf.PixelRepresentation;
204 unsigned short SamplesPerPixel;
206 unsigned short BitsAllocated;
208 unsigned short BitsStored;
210 unsigned short HighBit;
212 unsigned short PixelRepresentation;
223 #endif //GDCMPIXELFORMAT_H
#define GDCM_EXPORT
Definition: gdcmWin32.h:34
std::ostream & operator<<(std::ostream &os, const Directory &d)
Definition: gdcmDirectory.h:92
Bitmap class A bitmap based image. Used as parent for both IconImage and the main Pixel Data Image It...
Definition: gdcmBitmap.h:38
#define gdcmAssertMacro(arg)
Assert.
Definition: gdcmTrace.h:186
Validate class.
Definition: gdcmValidate.h:25