ITK
6.0.0
Insight 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 | |
using | BufferSizeType = SizeValueType |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = ByteSwapper |
using | Superclass = Object |
Public Types inherited from itk::Object | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = Object |
using | Superclass = LightObject |
Public Types inherited from itk::LightObject | |
using | ConstPointer = SmartPointer< const Self > |
using | Pointer = SmartPointer< Self > |
using | Self = LightObject |
Public Member Functions | |
const char * | GetNameOfClass () const override |
Public Member Functions inherited from itk::Object | |
unsigned long | AddObserver (const EventObject &event, Command *cmd) const |
unsigned long | AddObserver (const EventObject &event, std::function< void(const EventObject &)> function) const |
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 |
const char * | GetNameOfClass () const override |
virtual const TimeStamp & | GetTimeStamp () const |
bool | HasObserver (const EventObject &event) const |
void | InvokeEvent (const EventObject &) |
void | InvokeEvent (const EventObject &) const |
virtual void | Modified () const |
void | Register () const override |
void | RemoveAllObservers () |
void | RemoveObserver (unsigned long tag) const |
void | SetDebug (bool debugFlag) const |
void | SetReferenceCount (int) override |
void | UnRegister () const noexcept override |
void | SetMetaDataDictionary (const MetaDataDictionary &rhs) |
void | SetMetaDataDictionary (MetaDataDictionary &&rrhs) |
virtual void | SetObjectName (std::string _arg) |
virtual const std::string & | GetObjectName () const |
Public Member Functions inherited from itk::LightObject | |
Pointer | Clone () const |
virtual Pointer | CreateAnother () const |
virtual void | Delete () |
virtual const char * | GetNameOfClass () const |
virtual int | GetReferenceCount () const |
void | Print (std::ostream &os, Indent indent=0) const |
virtual void | Register () const |
virtual void | SetReferenceCount (int) |
virtual void | UnRegister () const noexcept |
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 constexpr bool | SystemIsBE () |
static constexpr bool | SystemIsBigEndian () |
static constexpr bool | SystemIsLE () |
static constexpr bool | SystemIsLittleEndian () |
static void | SwapWriteRangeFromSystemToBigEndian (const T *p, int num, std::ostream *fp) |
static void | SwapWriteRangeFromSystemToLittleEndian (const T *p, int num, std::ostream *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 val) |
Static Public Member Functions inherited from itk::LightObject | |
static void | BreakOnError () |
static Pointer | New () |
Protected Member Functions | |
ByteSwapper ()=default | |
~ByteSwapper () override=default | |
Protected Member Functions inherited from itk::Object | |
Object () | |
bool | PrintObservers (std::ostream &os, Indent indent) const |
void | PrintSelf (std::ostream &os, Indent indent) const override |
virtual void | SetTimeStamp (const TimeStamp &timeStamp) |
~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 | PrintSelf (std::ostream &os, Indent indent) const |
virtual void | PrintTrailer (std::ostream &os, Indent indent) const |
virtual | ~LightObject () |
Static Private Member Functions | |
static void | SwapBytes (T &) |
static void | SwapWriteRange (const T *ptr, SizeValueType numberOfElements, std::ostream &outputStream) |
Static Private Attributes | |
static constexpr bool | m_SystemIsBigEndian |
Additional Inherited Members | |
Protected Attributes inherited from itk::LightObject | |
std::atomic< int > | m_ReferenceCount {} |
using itk::ByteSwapper< T >::BufferSizeType = SizeValueType |
Type for representing large buffers, including those in 64bits architectures
Definition at line 106 of file itkByteSwapper.h.
using itk::ByteSwapper< T >::ConstPointer = SmartPointer<const Self> |
Definition at line 59 of file itkByteSwapper.h.
using itk::ByteSwapper< T >::Pointer = SmartPointer<Self> |
Definition at line 58 of file itkByteSwapper.h.
using itk::ByteSwapper< T >::Self = ByteSwapper |
Standard class type aliases.
Definition at line 56 of file itkByteSwapper.h.
using itk::ByteSwapper< T >::Superclass = Object |
Definition at line 57 of file itkByteSwapper.h.
|
protecteddefault |
|
overrideprotecteddefault |
|
overridevirtual |
Reimplemented from itk::LightObject.
|
staticprivate |
Swaps the bytes of the specified argument in-place. Assumes that its number of bytes is either 2, 4, or 8. Otherwise, it throws an exception.
|
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.
|
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.
|
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().
|
staticprivate |
Swaps and writes the specified elements to the specified output stream.
|
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.
|
inlinestaticconstexpr |
Definition at line 80 of file itkByteSwapper.h.
|
inlinestaticconstexpr |
Query the machine Endian-ness.
std::endian
. Definition at line 74 of file itkByteSwapper.h.
Referenced by itk::MeshIOBase::ReadBufferAsBinary().
|
inlinestaticconstexpr |
Definition at line 91 of file itkByteSwapper.h.
|
inlinestaticconstexpr |
Definition at line 85 of file itkByteSwapper.h.
Referenced by itk::MeshIOBase::ReadBufferAsBinary(), itk::VTKPolyDataMeshIO::ReadCellDataBufferAsBINARY(), itk::VTKPolyDataMeshIO::ReadPointDataBufferAsBINARY(), and itk::VTKPolyDataMeshIO::ReadPointsBufferAsBINARY().
|
staticconstexprprivate |
Definition at line 168 of file itkByteSwapper.h.