00001 #ifndef Impala_Core_Array_PrintData_h
00002 #define Impala_Core_Array_PrintData_h
00003
00004 #include "Core/Array/Array2dTem.h"
00005
00006 namespace Impala
00007 {
00008 namespace Core
00009 {
00010 namespace Array
00011 {
00012
00013
00014 template<class ArrayT>
00015 inline void
00016 PrintData(ArrayT* array, bool printBorder, int bx, int by, int width, int height)
00017 {
00018 typedef typename ArrayT::StorType StorT;
00019
00020 std::cout << "Array sizes: cw = " << array->CW() << ", ch = "
00021 << array->CH() << ", bw = " << array->BW() << ", bh = "
00022 << array->BH() << std::endl;
00023
00024
00025 for (int y=0 ; y<height ; y++)
00026 {
00027 std::cout << " Y = " << y << " :- ";
00028 for (int x=0 ; x<width ; x++)
00029 {
00030
00031
00032 StorT* p = (printBorder) ? array->PB(bx + x, by + y)
00033 : array->CPB(bx + x, by + y);
00034 ArrayPrintElem(std::cout, array, p);
00035 std::cout << ", ";
00036 }
00037 std::cout << std::endl;
00038 }
00039 }
00040
00041 template<class ArrayT>
00042 inline void
00043 PrintData(ArrayT* array, bool printBorder=false)
00044 {
00045 int width = (printBorder) ? array->W() : array->CW();
00046 int height = (printBorder) ? array->H() : array->CH();
00047 PrintData(array, printBorder, 0, 0, width, height);
00048 }
00049
00050 }
00051 }
00052 }
00053
00054 #endif