ITK
4.13.0
Insight Segmentation and Registration Toolkit
|
#include <itkByteSwapper.h>
Perform machine dependent byte swapping.
ByteSwapper is used by I/O classes to perform machine dependent byte swapping. Byte swapping is often used when reading or writing binary files. Files can either be Big Endian (BE) or Little Endian (LE).
Definition at line 50 of file itkByteSwapper.h.
Public Types | |
typedef SizeValueType | BufferSizeType |
typedef SmartPointer< const Self > | ConstPointer |
typedef std::ostream | OStreamType |
typedef SmartPointer< Self > | Pointer |
typedef ByteSwapper | Self |
typedef Object | Superclass |
Public Types inherited from itk::Object | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef Object | Self |
typedef LightObject | Superclass |
Public Types inherited from itk::LightObject | |
typedef SmartPointer< const Self > | ConstPointer |
typedef SmartPointer< Self > | Pointer |
typedef LightObject | Self |
Public Member Functions | |
virtual const char * | GetNameOfClass () const |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *) |
unsigned long | AddObserver (const EventObject &event, Command *) const |
virtual LightObject::Pointer | CreateAnother () const override |
virtual void | DebugOff () const |
virtual void | DebugOn () const |
Command * | GetCommand (unsigned long tag) |
bool | GetDebug () const |
MetaDataDictionary & | GetMetaDataDictionary () |
const MetaDataDictionary & | GetMetaDataDictionary () const |
virtual ModifiedTimeType | GetMTime () const |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
virtual void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) |
void | SetDebug (bool debugFlag) const |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
virtual void | SetReferenceCount (int) override |
virtual void | UnRegister () const noexceptoverride |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
virtual void | Delete () |
virtual int | GetReferenceCount () const |
itkCloneMacro (Self) | |
void | Print (std::ostream &os, Indent indent=0) const |
Static Public Member Functions | |
static void | SwapFromSystemToBigEndian (T *p) |
static void | SwapFromSystemToLittleEndian (T *p) |
static void | SwapRangeFromSystemToBigEndian (T *p, BufferSizeType num) |
static void | SwapRangeFromSystemToLittleEndian (T *p, BufferSizeType num) |
static bool | SystemIsBE () |
static bool | SystemIsBigEndian () |
static bool | SystemIsLE () |
static bool | SystemIsLittleEndian () |
static void | SwapWriteRangeFromSystemToBigEndian (T *p, int num, OStreamType *fp) |
static void | SwapWriteRangeFromSystemToLittleEndian (T *p, int num, OStreamType *fp) |
Static Public Member Functions inherited from itk::Object | |
static bool | GetGlobalWarningDisplay () |
static void | GlobalWarningDisplayOff () |
static void | GlobalWarningDisplayOn () |
static Pointer | New () |
static void | SetGlobalWarningDisplay (bool flag) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
ByteSwapper () | |
~ByteSwapper () override | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
virtual void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetTimeStamp (const TimeStamp &time) |
virtual | ~Object () override |
Protected Member Functions inherited from itk::LightObject | |
virtual LightObject::Pointer | InternalClone () const |
LightObject () | |
virtual void | PrintHeader (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Static Protected Member Functions | |
static void | Swap2 (void *p) |
static void | Swap2Range (void *p, BufferSizeType num) |
static void | Swap4 (void *p) |
static void | Swap4Range (void *p, BufferSizeType num) |
static void | Swap8 (void *p) |
static void | Swap8Range (void *p, BufferSizeType num) |
static void | SwapWrite2Range (void *p, BufferSizeType num, OStreamType *fp) |
static void | SwapWrite4Range (void *p, BufferSizeType num, OStreamType *fp) |
static void | SwapWrite8Range (void *p, BufferSizeType num, OStreamType *fp) |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
AtomicInt< int > | m_ReferenceCount |
typedef SizeValueType itk::ByteSwapper< T >::BufferSizeType |
Type for representing large buffers, including those in 64bits architectures
Definition at line 82 of file itkByteSwapper.h.
typedef SmartPointer< const Self > itk::ByteSwapper< T >::ConstPointer |
Definition at line 57 of file itkByteSwapper.h.
typedef std::ostream itk::ByteSwapper< T >::OStreamType |
Work around MSVC bug (including ByteSwapper.h in a templated class).
Definition at line 60 of file itkByteSwapper.h.
typedef SmartPointer< Self > itk::ByteSwapper< T >::Pointer |
Definition at line 56 of file itkByteSwapper.h.
typedef ByteSwapper itk::ByteSwapper< T >::Self |
Standard class typedefs.
Definition at line 54 of file itkByteSwapper.h.
typedef Object itk::ByteSwapper< T >::Superclass |
Definition at line 55 of file itkByteSwapper.h.
|
inlineprotected |
Definition at line 128 of file itkByteSwapper.h.
|
inlineoverrideprotected |
Definition at line 129 of file itkByteSwapper.h.
|
virtual |
Run-time type information (and related methods).
Reimplemented from itk::Object.
|
staticprotected |
Swap 2 bytes.
|
staticprotected |
Swap a range of two-byte words. Num is the number of two-byte words to swap.
|
staticprotected |
Swap four bytes.
|
staticprotected |
Swap a range of four-byte words. Num is the number of four-byte words to swap.
|
staticprotected |
Swap 8 bytes.
|
staticprotected |
Swap a range of 8-byte words. Num is the number of four-byte words to swap.
|
static |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.
Referenced by itk::DCMTKFileReader::GetElementDSorOB().
|
static |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.
Referenced by itk::DCMTKFileReader::GetElementDSorOB().
|
static |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.
Referenced by itk::MeshIOBase::ReadBufferAsBinary(), itk::VTKPolyDataMeshIO::ReadCellDataBufferAsBINARY(), itk::VTKPolyDataMeshIO::ReadPointDataBufferAsBINARY(), itk::VTKPolyDataMeshIO::ReadPointsBufferAsBINARY(), and itk::MeshIOBase::WriteBufferAsBinary().
|
static |
Generic swap method handles type T. The swapping is done in-place. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.
Referenced by itk::MeshIOBase::ReadBufferAsBinary(), and itk::MeshIOBase::WriteBufferAsBinary().
|
staticprotected |
Swap and write a range of two-byte words. Num is the number of two-byte words to swap and write.
|
staticprotected |
Swap and write a range of four-byte words. Num is the number of four-byte words to swap and write.
|
staticprotected |
Swap and write a range of 8-byte words. Num is the number of four-byte words to swap and write.
|
static |
Generic swap method handles type T. The data is swapped and written (in binary) to the ostream given. A total of num values of type T are written and swapped. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Big Endian.
Referenced by itk::VTKPolyDataMeshIO::WriteCellDataBufferAsBINARY(), itk::FreeSurferBinaryMeshIO::WriteCells(), itk::VTKPolyDataMeshIO::WriteCellsBufferAsBINARY(), itk::FreeSurferBinaryMeshIO::WritePointData(), itk::VTKPolyDataMeshIO::WritePointDataBufferAsBINARY(), itk::FreeSurferBinaryMeshIO::WritePoints(), and itk::VTKPolyDataMeshIO::WritePointsBufferAsBINARY().
|
static |
Generic swap method handles type T. The data is swapped and written (in binary) to the ostream given. A total of num values of type T are written and swapped. 2, 4 and 8 byte swapping can be handled. Single byte types are not swapped; others raise an exception. The method is used to swap to and from Little Endian.
|
inlinestatic |
Definition at line 68 of file itkByteSwapper.h.
|
static |
Query the machine Endian-ness.
|
inlinestatic |
Definition at line 71 of file itkByteSwapper.h.
|
static |