Skip to content
Snippets Groups Projects
Commit 130beaa6 authored by Andrea Bulgarelli's avatar Andrea Bulgarelli
Browse files

example with iteration on blocks and fields

parent 17389509
No related branches found
No related tags found
No related merge requests found
......@@ -73,19 +73,21 @@ int main(int argc, char* argv[])
//get each single pixel as a 1-dimensional array
cout << "packet->sdf()->getNumberOfBlocks() " << packet->sdf()->getNumberOfBlocks() << endl;
for(unsigned int j=0; j<npixels; j++) {
//continue;
for(unsigned int j=0; j<packet->sdf()->getNumberOfBlocks(); j++) {
uint16_t* pix = (uint16_t*) packet->sdf()->getBlock(j)->getBytes();
for(uint16_t sample=0; sample<nsamples; sample++)
for(uint16_t sample=0; sample<packet->sdf()->getBlock(j)->getNumberOfFields(); sample++)
cout << pix[sample] << " ";
cout << endl;
}
//access to each single sample
for(uint16_t pixel=0; pixel<npixels; pixel++) {
for(uint16_t sample=0; sample<nsamples; sample++) {
for(uint16_t pixel=0; pixel<packet->sdf()->getNumberOfBlocks(); pixel++) {
for(uint16_t sample=0; sample<packet->sdf()->getBlock(pixel)->getNumberOfFields(); sample++) {
cout << packet->sdf()->getBlock(pixel)->getFieldValue(sample) << " ";
}
cout << endl;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment