template<class ArrayT>
Definition at line 148 of file WriteRaw.h. References Endian(), Impala::Util::IOBuffer::NativeTypeWrite(), Impala::Util::IOBuffer::Puts(), and Impala::Util::IOBuffer::Write(). Referenced by WriteRawList(). 00149 { 00150 typedef typename ArrayT::StorType StorT; 00151 00152 String typeStr = Element::TypeString<StorT>(0); 00153 String formatStr = "version: 1, binary: %d, type: " + typeStr + 00154 ", elemSize: %lld, width: %lld, height: %lld, nr: %lld"; 00155 Int64 width = list[0]->CW(); 00156 Int64 height = list[0]->CH(); 00157 Int64 elemSize = ArrayT::ElemSize(); 00158 Int64 nrA = list.size(); 00159 char buf[200]; 00160 memset(buf, 0, 200); 00161 sprintf(buf, formatStr.c_str(), binary, elemSize, width, height, nrA); 00162 00163 if (binary) 00164 { // write binary data 00165 buffer->Write(buf, 200); 00166 for (Int64 n=0 ; n<nrA ; n++) 00167 { 00168 Endian(list[n], list[n]); 00169 for (Int64 y=0 ; y<height ; y++) 00170 { 00171 StorT* srcPtr = list[n]->CPB(0, y); 00172 buffer->Write(srcPtr, sizeof(StorT) * width * elemSize); 00173 } 00174 } 00175 } 00176 else 00177 { // write text data 00178 buffer->Puts(buf); 00179 for (Int64 n=0 ; n<nrA ; n++) 00180 { 00181 for(Int64 i=0 ; i<height ; i++) 00182 { 00183 StorT* srcPtr = list[n]->CPB(0, i); 00184 for(Int64 j=0 ; j<width ; j++) 00185 for (Int64 k=0 ; k<elemSize ; k++) 00186 buffer->NativeTypeWrite(*srcPtr++); 00187 buffer->Puts(""); // adds newline 00188 } 00189 } 00190 } 00191 }
Here is the call graph for this function:
|