template<class ArrayT>
Definition at line 100 of file WriteRaw.h. References Endian(), Impala::Util::IOBuffer::NativeTypeWrite(), Impala::Util::IOBuffer::Puts(), and Impala::Util::IOBuffer::Write(). Referenced by WriteRawList(). 00101 { 00102 typedef typename ArrayT::StorType StorT; 00103 00104 String typeStr = Element::TypeString<StorT>(0); 00105 String formatStr = "version: 1, binary: %d, type: " + typeStr + 00106 ", elemSize: %lld, width: %lld, height: %lld, nr: %lld"; 00107 Int64 width = list[0]->CW(); 00108 Int64 height = list[0]->CH(); 00109 Int64 elemSize = ArrayT::ElemSize(); 00110 Int64 nrA = list.size(); 00111 char buf[200]; 00112 memset(buf, 0, 200); 00113 sprintf(buf, formatStr.c_str(), binary, elemSize, width, height, nrA); 00114 00115 if (binary) 00116 { // write binary data 00117 buffer->Write(buf, 200); 00118 for (Int64 n=0 ; n<nrA ; n++) 00119 { 00120 Endian(list[n], list[n]); 00121 for (Int64 y=0 ; y<height ; y++) 00122 { 00123 StorT* srcPtr = list[n]->CPB(0, y); 00124 buffer->Write(srcPtr, sizeof(StorT) * width * elemSize); 00125 } 00126 } 00127 } 00128 else 00129 { // write text data 00130 buffer->Puts(buf); 00131 for (Int64 n=0 ; n<nrA ; n++) 00132 { 00133 for(Int64 i=0 ; i<height ; i++) 00134 { 00135 StorT* srcPtr = list[n]->CPB(0, i); 00136 for(Int64 j=0 ; j<width ; j++) 00137 for (Int64 k=0 ; k<elemSize ; k++) 00138 buffer->NativeTypeWrite(*srcPtr++); 00139 buffer->Puts(""); // adds newline 00140 } 00141 } 00142 } 00143 }
Here is the call graph for this function:
|