ocssw
V2022
|
HawkeyeDecode.c
Go to the documentation of this file.
87 uint32_t FindHeader(uint8_t *stream, uint32_t streamLength, uint32_t startPos, HeaderInfo *header)
98 if (uc == HAWKEYE_HEADER_START[0]) { //does it match the fisrt byte of the header start sequence?
99 for (j = 1; j < sizeof(HAWKEYE_HEADER_START); j++) { //check the full header start sequence length
139 static int DecodeImageParams(uint8_t *stream, uint32_t blockLen, uint32_t startPos, HawkeyeImageInfo *pImgInfo)
264 static int DecodeTelemetry(uint8_t *stream, uint32_t blockLen, uint32_t startPos, HawkeyeTelemetryInfo *pTelem)
299 static int DecodeMissionLog(uint8_t *stream, uint32_t blockLen, uint32_t startPos, uint8_t *dest)
401 HAWKEYE_STREAM_ERROR HawkeyeScanStream(uint8_t *stream, uint32_t streamLength, HawkeyeStreamInfo *streamInfo)
430 memset(finderscopeOffsets, 0, sizeof(finderscopeOffsets)); //and where we found each finderscope image
445 streamPos = headerPos + sizeof(HAWKEYE_HEADER_START)+HEADER_DATA_LEN; //skip passed this recordheader
447 if (blockType != EBT_EOF && nextPos - headerPos != blockLen) { //is the next headr at the right position or is this an EOF
453 if ((blockRes = DecodeImageParams(stream, blockLen, streamPos, &imgInfo)) == 0) { //if so decode it
474 streamPos = headerPos + sizeof(HAWKEYE_HEADER_START)+HEADER_DATA_LEN; // sko passed this recordheader
476 if (blockType != EBT_EOF && nextPos - headerPos != blockLen) { //is the next headr at the right position or is this an EOF
508 streamInfo->finderscopeInfo[noFSI].width = rowInfo.width; //if not record it and the electronic gain
515 streamInfo->finderscopeInfo[noFSI].height = rowInfo.rowNumber + 1; // if so add it to the height
528 streamInfo->spectralInfo[band].timeStamp = rowInfo.timeStamp; //and the timestamp and electronic gain
546 if ((blockRes = DecodeImageParams(stream, blockLen, streamPos, &imgInfo)) == 0) { //if so decode it
564 if ((blockRes = DecodeMissionLog(stream, blockLen, streamPos, missionLog)) == 0) { //if so Decode it
632 if (scannedStreamInfo.imageInfo.compression == DC_PACKED) { //is the data jsut packed (no delta compression)
681 pixels[i] = (uint16_t)(lvid > 65535 ? 65535 : lvid); //finally clip and save the decoded pixel value
698 HAWKEYE_STREAM_ERROR HawkeyeDecodeSpectralImage(uint16_t bandNo, uint16_t *pixels, uint32_t pixelLength,
716 headerPos = FindHeader(scannedStream, scannedStreamInfo.streamLength, streamPos, &header); //find the first record header
720 streamPos = headerPos + sizeof(HAWKEYE_HEADER_START)+HEADER_DATA_LEN; //move passed this record header
721 nextPos = FindHeader(scannedStream, scannedStreamInfo.streamLength, streamPos, &header); //and find the next
731 if ( blockType== EBT_UNCOMPRESSED || blockType == EBT_COMPRESSED ) { //did we find a Pixel Data record?
733 if (rowInfo.isSpectral && rowInfo.ls5Bits - 1 == bandNo) { //is it Spectral Data and the correct Band?
735 if (averageDarkPixels != 0 && !darkStored) { //is there a buffer and have we not stored it already?
769 if (blockType == EBT_UNCOMPRESSED || rowInfo.dataLen == 2 * rowInfo.width) {// is the data uncompressed
801 HAWKEYE_STREAM_ERROR HawkeyeDecodeFinderscopeImage(uint16_t imageNo, uint16_t *pixels, uint32_t pixelLength)
820 headerPos = FindHeader(scannedStream, scannedStreamInfo.streamLength, streamPos, &header); //and fid the first record header
825 nextPos = FindHeader(scannedStream, scannedStreamInfo.streamLength, streamPos, &header); //and find the next
827 if (headerPos == FindHeader(scannedStream, scannedStreamInfo.streamLength, finderscopeOffsets[imageNo], &header)) {
HAWKEYE_STREAM_ERROR HawkeyeScanStream(uint8_t *stream, uint32_t streamLength, HawkeyeStreamInfo *streamInfo)
Definition: HawkeyeDecode.c:401
Definition: HawkeyeDecode.c:31
HAWKEYE_STREAM_ERROR HawkeyeDecodeSpectralImage(uint16_t bandNo, uint16_t *pixels, uint32_t pixelLength, uint16_t *averageDarkPixels, uint16_t averageDarkPixelLength)
Definition: HawkeyeDecode.c:698
PARAM_TYPE_NONE Default value No parameter is buried in the product name name_prefix is case insensitive string compared to the product name PARAM_TYPE_VIS_WAVE The visible wavelength bands from the sensor are buried in the product name The product name is compared by appending and name_suffix ie aph_412_giop where prod_ix will be set to PARAM_TYPE_IR_WAVE same search method as PARAM_TYPE_VIS_WAVE except only wavelength above are looped through but prod_ix is still based ie aph_2_giop for the second band
Definition: HOWTO_Add_a_product.txt:42
Definition: HawkeyeDecode.h:46
HAWKEYE_STREAM_ERROR HawkeyeDecodeFinderscopeImage(uint16_t imageNo, uint16_t *pixels, uint32_t pixelLength)
Definition: HawkeyeDecode.c:801
HawkeyeBandInfo finderscopeInfo[MAX_FINDERSCOPE_IMAGES]
Definition: HawkeyeDecode.h:86
uint32_t FindHeader(uint8_t *stream, uint32_t streamLength, uint32_t startPos, HeaderInfo *header)
Definition: HawkeyeDecode.c:87
Definition: HawkeyeDecode.h:40
HawkeyeTelemetryInfo telemetryInfo[MAX_TELEMETRY_RECORDS]
Definition: HawkeyeDecode.h:88
Definition: HawkeyeDecode.h:75
Definition: HawkeyeDecode.h:26