Commit 6b85fb1c authored by Tyler Wilson's avatar Tyler Wilson
Browse files

Merge branch 'dev' into allspice

parents 4146d81d a27e9b2e
Loading
Loading
Loading
Loading
+9 −11
Original line number Original line Diff line number Diff line
@@ -7,7 +7,10 @@
# Unignore all dirs
# Unignore all dirs
!*/
!*/


# Unignore Makefiles, and TestPreferences
!Makefile
!Makefile
!TestPreferences
!*/3rdParty/Makefile


*.cub
*.cub
*.o
*.o
@@ -18,27 +21,22 @@ moc_*
*.pb.*
*.pb.*
*.lbl
*.lbl
*.img
*.img

*.kate-swp
!TestPreferences

print.prt

object_script.*.Release
object_script.*.Release
object_script.*.Debug
object_script.*.Debug
*_plugin_import.cpp
*_plugin_import.cpp
*.moc
*.moc
ui_*.h
ui_*.h


*/3rdParty/*
# ignore all files created by squish coco
!*/3rdParty/Makefile
*csmes


*/inc/*
print.prt


*/3rdParty/*
*/inc/*
*/bin/*
*/bin/*

*/lib/*
*/lib/*

*/tsts/*/input/*
*/tsts/*/input/*
*/tsts/*/truth/*
*/tsts/*/truth/*
*/tsts/*/output/*
*/tsts/*/output/*
+22 −1
Original line number Original line Diff line number Diff line
@@ -138,6 +138,28 @@ namespace Isis {
    return result;
    return result;
  }
  }


  /**
   * Swaps a 32bit unsigned integer.
   *
   * @param buf Input uint32 integer value to swap.
   */
  uint32_t EndianSwapper::Uint32_t(void *buf) {
    uint32_t result = *(uint32_t *)buf;

    if(p_needSwap) {
      char *ptr = (char *)buf + (sizeof(uint32_t) - 1) * p_needSwap;

      for(unsigned int i = 0; i < sizeof(uint32_t); i++) {
        p_swapper.p_char[i] = *ptr;
        ptr += p_swapDirection;
      }

      result = p_swapper.p_uint32;
    }

    return result;
  }

  /**
  /**
   * Swaps an 8 byte integer value.
   * Swaps an 8 byte integer value.
   *
   *
@@ -203,4 +225,3 @@ namespace Isis {
    return result;
    return result;
  }
  }
}
}
+4 −0
Original line number Original line Diff line number Diff line
@@ -50,6 +50,7 @@ namespace Isis {
   *            not added because it is 4 bytes on 32-bit linux and 8 bytes on
   *            not added because it is 4 bytes on 32-bit linux and 8 bytes on
   *            64-bit linux.
   *            64-bit linux.
   *   @history 2016-04-21 Makayla Shepherd - Added UnsignedWord pixel type handling.
   *   @history 2016-04-21 Makayla Shepherd - Added UnsignedWord pixel type handling.
   *   @history 2018-01-29 Adam Goins - Added uint32_t behavior to EndianSwapper.
   */
   */
  class EndianSwapper {
  class EndianSwapper {
    private:
    private:
@@ -67,6 +68,8 @@ namespace Isis {
       * byte format - all with swapped bytes.
       * byte format - all with swapped bytes.
       */
       */
      union {
      union {
        //! Union containing the output uint32_t value with swapped bytes.
        uint32_t p_uint32;
        //! Union containing the output double precision value with swapped bytes.
        //! Union containing the output double precision value with swapped bytes.
        double p_double;
        double p_double;
        //! Union containing the output floating point value with swapped bytes.
        //! Union containing the output floating point value with swapped bytes.
@@ -93,6 +96,7 @@ namespace Isis {
      float Float(void *buf);
      float Float(void *buf);
      int ExportFloat(void *buf);
      int ExportFloat(void *buf);
      int Int(void *buf);
      int Int(void *buf);
      uint32_t Uint32_t(void *buf);
      long long int LongLongInt(void *buf);
      long long int LongLongInt(void *buf);
      short int ShortInt(void *buf);
      short int ShortInt(void *buf);
      unsigned short int UnsignedShortInt(void *buf);
      unsigned short int UnsignedShortInt(void *buf);
+1 −0
Original line number Original line Diff line number Diff line
Size of Double:  8   Double 0x12345678 to HOST:  3.0542e+08
Size of Double:  8   Double 0x12345678 to HOST:  3.0542e+08
Size of Float:  4   Float 0x1234 to HOST:  4660
Size of Float:  4   Float 0x1234 to HOST:  4660
Size of Uint32_t:  4   Uint32_t 0x1234 to HOST:  4660
Size of Short Int:  2   Short Int 0x1234 to HOST:  4660
Size of Short Int:  2   Short Int 0x1234 to HOST:  4660
Size of Unsigned Short Int:  2   Unsigned Short Int 0x1234 to HOST:  4660
Size of Unsigned Short Int:  2   Unsigned Short Int 0x1234 to HOST:  4660
Size of Double:  8   Double 0x12345678 to HOST:  2.55354e-312
Size of Double:  8   Double 0x12345678 to HOST:  2.55354e-312
+6 −0
Original line number Original line Diff line number Diff line
@@ -12,6 +12,7 @@ int main(int argc, char *argv[]) {


  double DoubleValue;
  double DoubleValue;
  float FloatValue;
  float FloatValue;
  uint32_t UIntValue;
  short int ShortIntValue;
  short int ShortIntValue;
  unsigned short int UShortIntValue;
  unsigned short int UShortIntValue;
  int IntValue;
  int IntValue;
@@ -19,6 +20,7 @@ int main(int argc, char *argv[]) {


  DoubleValue = 0x12345678;
  DoubleValue = 0x12345678;
  FloatValue = 0x1234;
  FloatValue = 0x1234;
  UIntValue = 0x1234;
  ShortIntValue = 0x1234;
  ShortIntValue = 0x1234;
  UShortIntValue = 0x1234;
  UShortIntValue = 0x1234;
  IntValue = 0x12345678;
  IntValue = 0x12345678;
@@ -30,6 +32,8 @@ int main(int argc, char *argv[]) {
    cout << "   Double 0x12345678 to HOST:  " << lsb.Double(&DoubleValue) << endl;
    cout << "   Double 0x12345678 to HOST:  " << lsb.Double(&DoubleValue) << endl;
    cout << "Size of Float:  " << sizeof(float);
    cout << "Size of Float:  " << sizeof(float);
    cout << "   Float 0x1234 to HOST:  " << lsb.Float(&FloatValue) << endl;
    cout << "   Float 0x1234 to HOST:  " << lsb.Float(&FloatValue) << endl;
    cout << "Size of Uint32_t:  " << sizeof(uint32_t);
    cout << "   Uint32_t 0x1234 to HOST:  " << lsb.Uint32_t(&UIntValue) << endl;
    cout << "Size of Short Int:  " << sizeof(short int);
    cout << "Size of Short Int:  " << sizeof(short int);
    cout << "   Short Int 0x1234 to HOST:  " << lsb.ShortInt(&ShortIntValue) << endl;
    cout << "   Short Int 0x1234 to HOST:  " << lsb.ShortInt(&ShortIntValue) << endl;
    cout << "Size of Unsigned Short Int:  " << sizeof(unsigned short int);
    cout << "Size of Unsigned Short Int:  " << sizeof(unsigned short int);
@@ -74,6 +78,8 @@ int main(int argc, char *argv[]) {
    cout << "   Double 0x12345678 to HOST:  " << msb.Double(&DoubleValue) << endl;
    cout << "   Double 0x12345678 to HOST:  " << msb.Double(&DoubleValue) << endl;
    cout << "Size of Float:  " << sizeof(float);
    cout << "Size of Float:  " << sizeof(float);
    cout << "   Float 0x1234 to HOST:  " << msb.Float(&FloatValue) << endl;
    cout << "   Float 0x1234 to HOST:  " << msb.Float(&FloatValue) << endl;
    cout << "Size of Uint32_t:  " << sizeof(uint32_t);
    cout << "   Uint32_t 0x1234 to HOST:  " << msb.Uint32_t(&UIntValue) << endl;
    cout << "Size of Short Int:  " << sizeof(short int);
    cout << "Size of Short Int:  " << sizeof(short int);
    cout << "   Short Int 0x1234 to HOST:  " << msb.ShortInt(&ShortIntValue) << endl;
    cout << "   Short Int 0x1234 to HOST:  " << msb.ShortInt(&ShortIntValue) << endl;
    cout << "Size of Unsigned Short Int:  " << sizeof(unsigned short int);
    cout << "Size of Unsigned Short Int:  " << sizeof(unsigned short int);
Loading