djiparsetxt
Macros | Functions | Variables
parseRecord_JPEG.cpp File Reference
#include "RecordAndDetailsParser.hh"
#include <stdio.h>
#include <string.h>
Include dependency graph for parseRecord_JPEG.cpp:

Go to the source code of this file.

Macros

#define JPEG_SOI_BYTE   0xD8
 
#define JPEG_SOI   ((0xFF<<8)|JPEG_SOI_BYTE)
 
#define JPEG_EOI   0xFFD9
 

Functions

static FILE * openOutputJPGFile ()
 

Variables

int outputJPGFiles = 1
 
static char outputJPGFilenamePrefix [] = "embeddedImage"
 

Macro Definition Documentation

◆ JPEG_EOI

#define JPEG_EOI   0xFFD9

Definition at line 33 of file parseRecord_JPEG.cpp.

◆ JPEG_SOI

#define JPEG_SOI   ((0xFF<<8)|JPEG_SOI_BYTE)

Definition at line 32 of file parseRecord_JPEG.cpp.

◆ JPEG_SOI_BYTE

#define JPEG_SOI_BYTE   0xD8

Definition at line 31 of file parseRecord_JPEG.cpp.

Function Documentation

◆ openOutputJPGFile()

static FILE* openOutputJPGFile ( )
static

Definition at line 39 of file parseRecord_JPEG.cpp.

39  {
40  static unsigned jpgFileNumber = 0;
41  char outputFileName[strlen(outputJPGFilenamePrefix) + 100];
42  sprintf(outputFileName, "embedded%d.jpg", ++jpgFileNumber);
43  FILE* outputFid = fopen(outputFileName, "wb");
44  if (outputFid == NULL) {
45  fprintf(stderr, "Failed to open output JPG file \"%s\"\n", outputFileName);
46  } else {
47  fprintf(stderr, "\tOutputting embedded JPEG image to the file \"%s\"\n", outputFileName);
48 
49  // Begin by writing the initial JPEG SOI code:
50  fputc(JPEG_SOI>>8, outputFid); fputc(JPEG_SOI, outputFid);
51  }
52 
53  return outputFid;
54 }
static char outputJPGFilenamePrefix[]
#define JPEG_SOI

References JPEG_SOI, and outputJPGFilenamePrefix.

Referenced by RecordAndDetailsParser::parseRecord_JPEG().

Variable Documentation

◆ outputJPGFilenamePrefix

char outputJPGFilenamePrefix[] = "embeddedImage"
static

Definition at line 37 of file parseRecord_JPEG.cpp.

Referenced by openOutputJPGFile().

◆ outputJPGFiles

int outputJPGFiles = 1

Definition at line 35 of file parseRecord_JPEG.cpp.

Referenced by RecordAndDetailsParser::parseRecord_JPEG().