Commit a93aa26e authored by Will Schroeder's avatar Will Schroeder
Browse files

Initial revision

parent cb304d42
/*=========================================================================
Program: Visualization Library
Module: ByteSwap.hh
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
//
// Class for performing common math operations (e.g., dot, cross products)
//
#ifndef __vlByteSwap_hh
#define __vlByteSwap_hh
class vlByteSwap
{
public:
Swap4(char *c);
Swap4(float *p) {Swap4((char *)p);};
Swap4(int *i) {Swap4((char *)i);};
Swap4(unsigned long *i) {Swap4((char *)i);};
};
#endif
/*=========================================================================
Program: Visualization Library
Module: ByteSwap.cc
Language: C++
Date: $Date$
Version: $Revision$
Description:
---------------------------------------------------------------------------
This file is part of the Visualization Library. No part of this file
or its contents may be copied, reproduced or altered in any way
without the express written consent of the authors.
Copyright (c) Ken Martin, Will Schroeder, Bill Lorensen 1993, 1994
=========================================================================*/
#include "ByteSwap.hh"
vlByteSwap::Swap4(char *mem_ptr1)
{
char one_byte;
one_byte = mem_ptr1[0];
mem_ptr1[0] = mem_ptr1[3];
mem_ptr1[3] = one_byte;
one_byte = mem_ptr1[1];
mem_ptr1[1] = mem_ptr1[2];
mem_ptr1[2] = one_byte;
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment