Main Page   Namespace List   Class Hierarchy   Alphabetical List   Compound List   File List   Namespace Members   Compound Members   File Members  

igtl_util.h

Go to the documentation of this file.
00001 /*=========================================================================
00002 
00003   Program:   Open ITK Link Library
00004   Module:    $HeadURL: http://svn.na-mic.org/NAMICSandBox/trunk/OpenIGTLink/Source/igtlutil/igtl_util.h $
00005   Language:  C
00006   Date:      $Date: 2008-12-22 19:05:42 -0500 (Mon, 22 Dec 2008) $
00007   Version:   $Revision: 3460 $
00008 
00009   Copyright (c) Insight Software Consortium. All rights reserved.
00010 
00011   This software is distributed WITHOUT ANY WARRANTY; without even
00012   the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
00013   PURPOSE.  See the above copyright notices for more information.
00014 
00015 =========================================================================*/
00016 
00017 #ifndef __IGTL_UTIL_H
00018 #define __IGTL_UTIL_H
00019 
00020 #include "igtl_win32header.h"
00021 #include "igtl_types.h"
00022 
00023 #ifdef __cplusplus
00024 extern "C" {
00025 #endif
00026 
00027 /*
00028  * Byte order conversion macros
00029  *
00030  */
00031 
00032 #define BYTE_SWAP_INT16(S) (((S) & 0xFF) << 8 \
00033                             | (((S) >> 8) & 0xFF))
00034 #define BYTE_SWAP_INT32(L) ((BYTE_SWAP_INT16 ((L) & 0xFFFF) << 16) \
00035                             | BYTE_SWAP_INT16 (((L) >> 16) & 0xFFFF))
00036 #define BYTE_SWAP_INT64(LL) ((BYTE_SWAP_INT32 ((LL) & 0xFFFFFFFF) << 32) \
00037                              | BYTE_SWAP_INT32 (((LL) >> 32) & 0xFFFFFFFF))
00038 
00039 /*
00040  * Test endian of the host
00041  */
00042 int igtl_export igtl_is_little_endian();
00043 igtl_uint64 igtl_export crc64(unsigned char *data, int len, igtl_uint64 crc);
00044 
00045 
00046 /*
00047  * Convert nanosecond to fraction / fraction to nanosec
00048  */
00049 
00050 igtl_uint32 igtl_export igtl_nanosec_to_frac(igtl_uint32 nanosec);
00051 igtl_uint32 igtl_export igtl_frac_to_nanosec(igtl_uint32 frac);
00052 
00053 #ifdef __cplusplus
00054 }
00055 #endif
00056 
00057 #endif  /*__IGTL_UTIL_H*/
00058 
00059 

Generated at Sat May 9 04:47:22 2009 for OpenIGTLink by doxygen 1.5.9 written by Dimitri van Heesch, © 1997-2000