ReactOS  0.4.15-dev-1374-g8d3e80e
transupp.c File Reference
#include "jinclude.h"
#include "jpeglib.h"
#include "transupp.h"
#include <ctype.h>
Include dependency graph for transupp.c:

Go to the source code of this file.

Macros

#define JPEG_INTERNALS
 

Functions

 jcopy_markers_setup (j_decompress_ptr srcinfo, JCOPY_OPTION option)
 
 jcopy_markers_execute (j_decompress_ptr srcinfo, j_compress_ptr dstinfo, JCOPY_OPTION option)
 

Macro Definition Documentation

◆ JPEG_INTERNALS

#define JPEG_INTERNALS

Definition at line 20 of file transupp.c.

Function Documentation

◆ jcopy_markers_execute()

jcopy_markers_execute ( j_decompress_ptr  srcinfo,
j_compress_ptr  dstinfo,
JCOPY_OPTION  option 
)

Definition at line 2392 of file transupp.c.

2394 {
2396 
2397  /* In the current implementation, we don't actually need to examine the
2398  * option flag here; we just copy everything that got saved.
2399  * But to avoid confusion, we do not output JFIF and Adobe APP14 markers
2400  * if the encoder library already wrote one.
2401  */
2402  for (marker = srcinfo->marker_list; marker != NULL; marker = marker->next) {
2403  if (dstinfo->write_JFIF_header &&
2404  marker->marker == JPEG_APP0 &&
2405  marker->data_length >= 5 &&
2406  GETJOCTET(marker->data[0]) == 0x4A &&
2407  GETJOCTET(marker->data[1]) == 0x46 &&
2408  GETJOCTET(marker->data[2]) == 0x49 &&
2409  GETJOCTET(marker->data[3]) == 0x46 &&
2410  GETJOCTET(marker->data[4]) == 0)
2411  continue; /* reject duplicate JFIF */
2412  if (dstinfo->write_Adobe_marker &&
2413  marker->marker == JPEG_APP0+14 &&
2414  marker->data_length >= 5 &&
2415  GETJOCTET(marker->data[0]) == 0x41 &&
2416  GETJOCTET(marker->data[1]) == 0x64 &&
2417  GETJOCTET(marker->data[2]) == 0x6F &&
2418  GETJOCTET(marker->data[3]) == 0x62 &&
2419  GETJOCTET(marker->data[4]) == 0x65)
2420  continue; /* reject duplicate Adobe */
2421 #ifdef NEED_FAR_POINTERS
2422  /* We could use jpeg_write_marker if the data weren't FAR... */
2423  {
2424  unsigned int i;
2425  jpeg_write_m_header(dstinfo, marker->marker, marker->data_length);
2426  for (i = 0; i < marker->data_length; i++)
2427  jpeg_write_m_byte(dstinfo, marker->data[i]);
2428  }
2429 #else
2430  jpeg_write_marker(dstinfo, marker->marker,
2431  marker->data, marker->data_length);
2432 #endif
2433  }
2434 }
boolean write_Adobe_marker
Definition: jpeglib.h:385
#define GETJOCTET(value)
Definition: jmorecfg.h:171
struct jpeg_marker_struct FAR * jpeg_saved_marker_ptr
Definition: jpeglib.h:207
boolean write_JFIF_header
Definition: jpeglib.h:375
jpeg_saved_marker_ptr marker_list
Definition: jpeglib.h:618
#define JPEG_APP0
Definition: jpeglib.h:1128
int marker
Definition: jpeglib.h:1030
jpeg_write_marker(j_compress_ptr cinfo, int marker, const JOCTET *dataptr, unsigned int datalen)
Definition: jcapimin.c:200
j_compress_ptr dstinfo
Definition: jpeglib.h:1100
GLsizei GLenum const GLvoid GLsizei GLenum GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLint GLint GLint GLshort GLshort GLshort GLubyte GLubyte GLubyte GLuint GLuint GLuint GLushort GLushort GLushort GLbyte GLbyte GLbyte GLbyte GLdouble GLdouble GLdouble GLdouble GLfloat GLfloat GLfloat GLfloat GLint GLint GLint GLint GLshort GLshort GLshort GLshort GLubyte GLubyte GLubyte GLubyte GLuint GLuint GLuint GLuint GLushort GLushort GLushort GLushort GLboolean const GLdouble const GLfloat const GLint const GLshort const GLbyte const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLdouble const GLfloat const GLfloat const GLint const GLint const GLshort const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort const GLdouble const GLfloat const GLint const GLshort GLenum GLenum GLenum GLfloat GLenum GLint GLenum GLenum GLenum GLfloat GLenum GLenum GLint GLenum GLfloat GLenum GLint GLint GLushort GLenum GLenum GLfloat GLenum GLenum GLint GLfloat const GLubyte GLenum GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLint GLint GLsizei GLsizei GLint GLenum GLenum const GLvoid GLenum GLenum const GLfloat GLenum GLenum const GLint GLenum GLenum const GLdouble GLenum GLenum const GLfloat GLenum GLenum const GLint GLsizei GLuint GLfloat GLuint GLbitfield GLfloat GLint GLuint GLboolean GLenum GLfloat GLenum GLbitfield GLenum GLfloat GLfloat GLint GLint const GLfloat GLenum GLfloat GLfloat GLint GLint GLfloat GLfloat GLint GLint const GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat GLint GLfloat GLfloat const GLdouble const GLfloat const GLdouble const GLfloat GLint i
Definition: glfuncs.h:248
jpeg_write_m_byte(j_compress_ptr cinfo, int val)
Definition: jcapimin.c:234
#define NULL
Definition: types.h:112
jpeg_write_m_header(j_compress_ptr cinfo, int marker, unsigned int datalen)
Definition: jcapimin.c:222

Referenced by main().

◆ jcopy_markers_setup()

jcopy_markers_setup ( j_decompress_ptr  srcinfo,
JCOPY_OPTION  option 
)

Definition at line 2367 of file transupp.c.

2368 {
2369 #ifdef SAVE_MARKERS_SUPPORTED
2370  int m;
2371 
2372  /* Save comments except under NONE option */
2373  if (option != JCOPYOPT_NONE) {
2374  jpeg_save_markers(srcinfo, JPEG_COM, 0xFFFF);
2375  }
2376  /* Save all types of APPn markers iff ALL option */
2377  if (option == JCOPYOPT_ALL) {
2378  for (m = 0; m < 16; m++)
2379  jpeg_save_markers(srcinfo, JPEG_APP0 + m, 0xFFFF);
2380  }
2381 #endif /* SAVE_MARKERS_SUPPORTED */
2382 }
const GLfloat * m
Definition: glext.h:10848
#define JPEG_APP0
Definition: jpeglib.h:1128
Definition: getopt.h:108
#define JPEG_COM
Definition: jpeglib.h:1129

Referenced by main().