FACT++  1.0
void CompressedFitsWriter::copyTransposeTile ( uint32_t  index)
private

Copy and transpose (or semi-transpose) one tile of data.

Definition at line 1167 of file fitsCompressor.cc.

References CompressedFitsFile::_buffer, CompressedFitsFile::_columns, CompressedFitsFile::_numRowsPerTile, CompressedFitsFile::_rowWidth, CompressedFitsFile::_totalNumRows, CompressedFitsFile::_transposedBuffer, i, FITS::kOrderByCol, and FITS::kOrderByRow.

Referenced by close(), and writeBinaryRow().

1168 {
1170 
1171  //copy the tile and transpose it
1172  uint32_t offset = 0;
1173  for (uint32_t i=0;i<_columns.size();i++)
1174  {
1175  switch (_columns[i].getColumnOrdering())//getCompression())
1176  {
1177  case FITS::kOrderByRow:
1178  for (uint32_t k=0;k<thisRoundNumRows;k++)
1179  {//regular, "semi-transposed" copy
1180  memcpy(&(_transposedBuffer[index][offset]), &_buffer[k*_rowWidth + _columns[i].offset()], _columns[i].sizeOfElems()*_columns[i].numElems());
1181  offset += _columns[i].sizeOfElems()*_columns[i].numElems();
1182  }
1183  break;
1184 
1185  case FITS::kOrderByCol :
1186  for (int j=0;j<_columns[i].numElems();j++)
1187  for (uint32_t k=0;k<thisRoundNumRows;k++)
1188  {//transposed copy
1189  memcpy(&(_transposedBuffer[index][offset]), &_buffer[k*_rowWidth + _columns[i].offset() + _columns[i].sizeOfElems()*j], _columns[i].sizeOfElems());
1190  offset += _columns[i].sizeOfElems();
1191  }
1192  break;
1193  default:
1194  cout << "Error: unknown column ordering: " << _columns[i].getColumnOrdering() << endl;
1195 
1196  };
1197  }
1198 }
int i
Definition: db_dim_client.c:21
uint32_t _totalNumRows
Total number of raws.
vector< char * > _transposedBuffer
Memory buffer to store rows while they are transposed.
uint32_t _rowWidth
Total number of bytes in one row.
char * _buffer
Memory buffer to store rows while they are not compressed.
vector< ColumnEntry > _columns
Columns in the file.
uint32_t _numRowsPerTile
Number of rows per tile.

+ Here is the caller graph for this function: