00001 #ifndef Impala_Core_Test_TestDumpSmall_h
00002 #define Impala_Core_Test_TestDumpSmall_h
00003
00004 #include "Core/Test/TestImage.h"
00005 #include "Core/Array/PrintData.h"
00006 #include "Core/Array/Element/VecTem.h"
00007
00008 namespace Impala
00009 {
00010 namespace Core
00011 {
00012 namespace Test
00013 {
00014
00015
00016 class TestDumpSmall : public TestImage
00017 {
00018 public:
00019
00020 TestDumpSmall(String srcName)
00021 {
00022 mTestNameBase = "DumpSmall";
00023 mSrcName = srcName;
00024 }
00025
00026 virtual void
00027 Run()
00028 {
00029 std::cout << "src: " << std::endl;
00030 Array2dVec3UInt8* src = OpenSrcArray(mSrcName);
00031 std::cout << std::endl;
00032 PrintData(src, false);
00033
00034 typedef Array::Element::VecTem<Real64,5> Vec5Real64;
00035 typedef Array::Array2dTem<Real64, 5, Vec5Real64> Array2dVec5Real64;
00036
00037
00038
00039
00040
00041 Vec5Real64 d1(5);
00042 std::cout << "d1 = " << d1 << std::endl;
00043 Array::Vec3Int32 i1(9, 8, 7);
00044 std::cout << "i1 = " << i1 << std::endl;
00045 i1 = src->Value(0, 1);
00046 std::cout << "i1 = " << i1 << std::endl;
00047 std::cout << "src(0,1) " << src->Value(0, 1) << std::endl;
00048
00049 Array2dVec5Real64 v5(src->CW(), src->CH(), 0, 0);
00050
00051
00052 PrintData(&v5, false);
00053 std::cout << "Starting assignment" << std::endl << std::endl;
00054
00055 for (int y=0 ; y<src->CH() ; y++)
00056 for (int x=0 ; x<src->CW() ; x++)
00057 v5.Elem(x, y) = src->Value(x, y);
00058 std::cout << std::endl << "Done assignment" << std::endl;
00059 PrintData(&v5, false);
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074 delete src;
00075 }
00076
00077 virtual String
00078 Name() const
00079 {
00080 return FileNameCtor(mTestNameBase, mSrcName, "");
00081 }
00082
00083 private:
00084 String mTestNameBase;
00085 String mSrcName;
00086
00087 };
00088
00089
00090 static TestBase* gDumpSmallSuite[] =
00091 {
00092 new TestDumpSmall("uniq_v3uint8.raw"),
00093 (TestBase*)0
00094 };
00095
00096 }
00097 }
00098 }
00099
00100 #endif