/*------------------------------------------------------------------------------
 src/plugin/djImageIoJpeg/base.h
 
 Copyright (c) 2004-2006 Darby Johnston.
 All rights reserved.
 Use is subject to license terms.

 Requirements:
 
 * libjpeg, http://www.ijg.org

 Supported:
 
 * Channels: l, rgb.
 * Bit depths: u8.
 * Attributes: data compression.
------------------------------------------------------------------------------*/

#ifndef DJ_IMAGE_IO_JPEG_BASE_H
#define DJ_IMAGE_IO_JPEG_BASE_H
#include <djBase.h>
#include <stdio.h>
extern "C" {
#include <jpeglib.h>
}
#include <setjmp.h>

namespace djImageIoJpeg {
using namespace dj;

// Plugin name.
//
inline const Str name() { return "JPEG"; }

// File extensions.
//
inline const StrList extensionList()
  { return StrList() + Str(".jpeg") + Str(".jpg") + Str(".jfif"); }

// Error handling.
//
struct Error {
  struct jpeg_error_mgr pub;
  jmp_buf jump;
};
extern "C" {
void jpegError(j_common_ptr);
void jpegWarning(j_common_ptr, int);
}

}

#endif
