# E:/DevIL/src-IL/src/il_jpeg.c File Reference

`#include "il_internal.h"`
`#include "jpeglib.h"`
`#include "il_jpeg.h"`
`#include "il_manip.h"`
`#include <setjmp.h>`

## Data Structures

struct | iread_mgr
struct | iwrite_mgr

## Defines

#define | RGB_RED 0
#define | RGB_GREEN 1
#define | RGB_BLUE 2
#define | INPUT_BUF_SIZE 4096
#define | OUTPUT_BUF_SIZE 4096

## Typedefs

typedef iread_mgr * | iread_ptr
typedef iwrite_mgr * | iwrite_ptr

## Functions

ILboolean | ilLoadFromJpegStruct (void *_JpegInfo)
void | iGetJpgHead (ILubyte *Header)
ILboolean | iCheckJpg (ILubyte Header[2])
ILboolean | iIsValidJpeg ()
ILboolean | ilIsValidJpeg (ILconst_string FileName)
| Checks if the file specified in FileName is a valid .jpg file.
ILboolean | ilIsValidJpegF (ILHANDLE File)
| Checks if the ILHANDLE contains a valid .jpg file at the current position.
ILboolean | ilIsValidJpegL (const void *Lump, ILuint Size)
void | ExitErrorHandle (struct jpeg_common_struct *JpegInfo)
void | OutputMsg (struct jpeg_common_struct *JpegInfo)
ILboolean | ilLoadJpeg (ILconst_string FileName)
| Reads a jpeg file.
ILboolean | ilLoadJpegF (ILHANDLE File)
| Reads an already-opened jpeg file.
ILboolean | ilLoadJpegL (const void *Lump, ILuint Size)
| init_source (j_decompress_ptr cinfo)
| fill_input_buffer (j_decompress_ptr cinfo)
| skip_input_data (j_decompress_ptr cinfo, long num_bytes)
| term_source (j_decompress_ptr cinfo)
| devil_jpeg_read_init (j_decompress_ptr cinfo)
ILboolean | iLoadJpegInternal ()
| init_destination (j_compress_ptr cinfo)
| empty_output_buffer (j_compress_ptr cinfo)
| term_destination (j_compress_ptr cinfo)
| devil_jpeg_write_init (j_compress_ptr cinfo)
ILboolean | ilSaveJpeg (const ILstring FileName)
| Writes a Jpeg file.
ILuint | ilSaveJpegF (ILHANDLE File)
| Writes a Jpeg to an already-opened file.
ILuint | ilSaveJpegL (void *Lump, ILuint Size)
| Writes a Jpeg to a memory "lump".
ILboolean | iSaveJpegInternal ()
ILboolean | ilSaveFromJpegStruct (void *_JpegInfo)

## Variables

jmp_buf | JpegJumpBuffer

## Define Documentation

#define INPUT_BUF_SIZE 4096

Referenced by devil_jpeg_read_init(), and fill_input_buffer().

#define OUTPUT_BUF_SIZE 4096

Referenced by empty_output_buffer(), init_destination(), and term_destination().

#define RGB_BLUE 2

#define RGB_GREEN 1

#define RGB_RED 0

## Typedef Documentation

typedef iread_mgr* iread_ptr

typedef iwrite_mgr* iwrite_ptr

## Function Documentation

devil_jpeg_read_init | ( | j_decompress_ptr | cinfo | ) |

Referenced by iLoadJpegInternal().

devil_jpeg_write_init | ( | j_compress_ptr | cinfo | ) |

Referenced by iSaveJpegInternal().

empty_output_buffer | ( | j_compress_ptr | cinfo | ) |

Referenced by devil_jpeg_write_init().

void ExitErrorHandle | ( | struct jpeg_common_struct * | JpegInfo | ) |

Referenced by ilSaveFromJpegStruct().

fill_input_buffer | ( | j_decompress_ptr | cinfo | ) |

Referenced by devil_jpeg_read_init(), and skip_input_data().

ILboolean iCheckJpg | ( | ILubyte | Header[2] | ) |

Referenced by iIsValidJpeg().

void iGetJpgHead | ( | ILubyte * | Header | ) |

Referenced by iIsValidJpeg().

ILboolean iIsValidJpeg | ( |  | ) |

Referenced by ilIsValidJpegF(), and ilIsValidJpegL().

ILboolean ilIsValidJpeg | ( | ILconst_string | FileName | ) |

Checks if the file specified in FileName is a valid .jpg file.

Referenced by ilIsValid().

ILboolean ilIsValidJpegF | ( | ILHANDLE | File | ) |

Checks if the ILHANDLE contains a valid .jpg file at the current position.

Referenced by ilDetermineTypeF(), ilIsValidF(), and ilIsValidJpeg().

ILboolean ilIsValidJpegL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Referenced by ilDetermineTypeL(), and ilIsValidL().

ILboolean ilLoadFromJpegStruct | ( | void * | _JpegInfo | ) |

Referenced by iLoadJpegInternal().

ILboolean ilLoadJpeg | ( | ILconst_string | FileName | ) |

Reads a jpeg file.

Referenced by ilLoad(), and ilLoadImage().

ILboolean ilLoadJpegF | ( | ILHANDLE | File | ) |

Reads an already-opened jpeg file.

Referenced by ilLoadF(), and ilLoadJpeg().

ILboolean ilLoadJpegL | ( | const void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Referenced by ilLoadL().

ILboolean iLoadJpegInternal | ( | void |  | ) |

Referenced by ilLoadJpegF(), and ilLoadJpegL().

ILboolean ilSaveFromJpegStruct | ( | void * | _JpegInfo | ) |

ILboolean ilSaveJpeg | ( | const ILstring | FileName | ) |

Writes a Jpeg file.

Referenced by ilSave(), and ilSaveImage().

ILuint ilSaveJpegF | ( | ILHANDLE | File | ) |

Writes a Jpeg to an already-opened file.

Referenced by ilSaveF(), and ilSaveJpeg().

ILuint ilSaveJpegL | ( | void * | Lump,
|  | ILuint | Size |
| ) |  |  |

Writes a Jpeg to a memory "lump".

Referenced by ilDetermineSize(), and ilSaveL().

init_destination | ( | j_compress_ptr | cinfo | ) |

Referenced by devil_jpeg_write_init().

init_source | ( | j_decompress_ptr | cinfo | ) |

Referenced by devil_jpeg_read_init().

ILboolean iSaveJpegInternal | ( | void |  | ) |

Referenced by ilSaveJpegF(), and ilSaveJpegL().

void OutputMsg | ( | struct jpeg_common_struct * | JpegInfo | ) |

Referenced by iLoadJpegInternal().

skip_input_data | ( | j_decompress_ptr | cinfo,
|  | long | num_bytes |
| ) |  |  |

Referenced by devil_jpeg_read_init().

term_destination | ( | j_compress_ptr | cinfo | ) |

Referenced by devil_jpeg_write_init().

term_source | ( | j_decompress_ptr | cinfo | ) |

Referenced by devil_jpeg_read_init().

## Variable Documentation

jmp_buf JpegJumpBuffer

Referenced by iLoadJpegInternal().