OB.DAAC Logo
NASA Logo
Ocean Color Science Software

ocssw V2022
FlagsDSR.cpp
Go to the documentation of this file.
1 /*
2  * FlagsDSR.cpp
3  *
4  * Created on: Jan 7, 2013
5  * Author: dshea
6  */
7 
8 #include "FlagsDSR.h"
9 
10 #include <stdio.h>
11 #include <stdlib.h>
12 #include <stdint.h>
13 
16 
17  // 12 bytes for time
18  // 1 byte for quality indicator
19  // 1 bytes needed for each pixel quality
20  // 2 bytes needed for each pixel Detector Index
21  pixelSize = 1;
22  numPixels = (size - arrayOffset) / 3;
23  if (numPixels * 3 + arrayOffset != size) {
24  printf("Error %s:%s:%d size does not divide evenly into pixels\n",
25  __FILE__, __func__, __LINE__);
26  exit(1);
27  }
28 }
29 
31  // TODO Auto-generated destructor stub
32 }
33 
34 void FlagsDSR::setRange(int offset, int count, int val) {
35  if (offset < 0)
36  return;
37  if (offset + count > numPixels)
39 
40  uint8_t* ptr = (uint8_t*) (getBuffer() + arrayOffset + offset);
41  int i;
42  for (i = 0; i < count; i++) {
43  *ptr = val;
44  ptr++;
45  }
46 }
47 
50  printf("\nFlagsDSR-----\n");
51 }
int numPixels
Definition: EnvsatDSR.h:46
virtual void print()
virtual char * getBuffer()
Definition: EnvsatDSR.h:24
FlagsDSR(int size)
Definition: FlagsDSR.cpp:14
virtual ~FlagsDSR()
Definition: FlagsDSR.cpp:30
int pixelSize
Definition: EnvsatDSR.h:44
virtual void print()
Definition: FlagsDSR.cpp:48
l2prod offset
int arrayOffset
Definition: EnvsatDSR.h:42
int i
Definition: decode_rs.h:71
msiBandIdx val
Definition: l1c_msi.cpp:34
virtual void setRange(int offset, int count, int val)
Definition: FlagsDSR.cpp:34
int count
Definition: decode_rs.h:79