roentgen b75cab
roentgen b75cab
#include "tiffiop.h"
roentgen b75cab
roentgen b75cab
#if defined(JPEG_DUAL_MODE_8_12)
roentgen b75cab
roentgen b75cab
#  define TIFFInitJPEG TIFFInitJPEG_12
roentgen b75cab
roentgen b75cab
#  include LIBJPEG_12_PATH
roentgen b75cab
roentgen b75cab
#  include "tif_jpeg.c"
roentgen b75cab
roentgen b75cab
int TIFFReInitJPEG_12( TIFF *tif, int scheme, int is_encode )
roentgen b75cab
roentgen b75cab
{
roentgen b75cab
    JPEGState* sp;
roentgen b75cab
roentgen b75cab
    assert(scheme == COMPRESSION_JPEG);
roentgen b75cab
roentgen b75cab
    sp = JState(tif);
roentgen b75cab
    sp->tif = tif;				/* back link */
roentgen b75cab
roentgen b75cab
    /*
roentgen b75cab
     * Override parent get/set field methods.
roentgen b75cab
     */
roentgen b75cab
    tif->tif_tagmethods.vgetfield = JPEGVGetField; /* hook for codec tags */
roentgen b75cab
    tif->tif_tagmethods.vsetfield = JPEGVSetField; /* hook for codec tags */
roentgen b75cab
    tif->tif_tagmethods.printdir = JPEGPrintDir;   /* hook for codec tags */
roentgen b75cab
roentgen b75cab
    /*
roentgen b75cab
     * Install codec methods.
roentgen b75cab
     */
roentgen b75cab
    tif->tif_fixuptags = JPEGFixupTags;
roentgen b75cab
    tif->tif_setupdecode = JPEGSetupDecode;
roentgen b75cab
    tif->tif_predecode = JPEGPreDecode;
roentgen b75cab
    tif->tif_decoderow = JPEGDecode;
roentgen b75cab
    tif->tif_decodestrip = JPEGDecode;
roentgen b75cab
    tif->tif_decodetile = JPEGDecode;
roentgen b75cab
    tif->tif_setupencode = JPEGSetupEncode;
roentgen b75cab
    tif->tif_preencode = JPEGPreEncode;
roentgen b75cab
    tif->tif_postencode = JPEGPostEncode;
roentgen b75cab
    tif->tif_encoderow = JPEGEncode;
roentgen b75cab
    tif->tif_encodestrip = JPEGEncode;
roentgen b75cab
    tif->tif_encodetile = JPEGEncode;  
roentgen b75cab
    tif->tif_cleanup = JPEGCleanup;
roentgen b75cab
    tif->tif_defstripsize = JPEGDefaultStripSize;
roentgen b75cab
    tif->tif_deftilesize = JPEGDefaultTileSize;
roentgen b75cab
    tif->tif_flags |= TIFF_NOBITREV;	/* no bit reversal, please */
roentgen b75cab
roentgen b75cab
    sp->cinfo_initialized = FALSE;
roentgen b75cab
roentgen b75cab
    if( is_encode )
roentgen b75cab
        return JPEGSetupEncode(tif);
roentgen b75cab
    else
roentgen b75cab
        return JPEGSetupDecode(tif);
roentgen b75cab
}
roentgen b75cab
roentgen b75cab
#endif /* defined(JPEG_DUAL_MODE_8_12) */
roentgen b75cab
roentgen b75cab
/*
roentgen b75cab
 * Local Variables:
roentgen b75cab
 * mode: c
roentgen b75cab
 * c-basic-offset: 8
roentgen b75cab
 * fill-column: 78
roentgen b75cab
 * End:
roentgen b75cab
 */