LCOV - code coverage report
Current view: top level - frmts/gtiff/libtiff - tif_jpeg_12.c (source / functions) Hit Total Coverage
Test: gdal_filtered.info Lines: 12 14 85.7 %
Date: 2024-05-04 12:52:34 Functions: 1 1 100.0 %

          Line data    Source code
       1             : 
       2             : #include "tiffiop.h"
       3             : 
       4             : #if defined(HAVE_JPEGTURBO_DUAL_MODE_8_12)
       5             : #define JPEG_DUAL_MODE_8_12
       6             : #endif
       7             : 
       8             : #if defined(JPEG_DUAL_MODE_8_12)
       9             : 
      10             : #define FROM_TIF_JPEG_12
      11             : 
      12             : #ifdef TIFFInitJPEG
      13             : #undef TIFFInitJPEG
      14             : #endif
      15             : #define TIFFInitJPEG TIFFInitJPEG_12
      16             : 
      17             : #ifdef TIFFJPEGIsFullStripRequired
      18             : #undef TIFFJPEGIsFullStripRequired
      19             : #endif
      20             : #define TIFFJPEGIsFullStripRequired TIFFJPEGIsFullStripRequired_12
      21             : 
      22             : int TIFFInitJPEG_12(TIFF *tif, int scheme);
      23             : 
      24             : #if !defined(HAVE_JPEGTURBO_DUAL_MODE_8_12)
      25             : #include LIBJPEG_12_PATH
      26             : #endif
      27             : 
      28             : #include "tif_jpeg.c"
      29             : 
      30        1188 : int TIFFReInitJPEG_12(TIFF *tif, const JPEGOtherSettings *otherSettings,
      31             :                       int scheme, int is_encode)
      32             : {
      33             :     JPEGState *sp;
      34             :     uint8_t *new_tif_data;
      35             : 
      36             :     (void)scheme;
      37        1188 :     assert(scheme == COMPRESSION_JPEG);
      38             : 
      39             :     new_tif_data =
      40        1188 :         (uint8_t *)_TIFFreallocExt(tif, tif->tif_data, sizeof(JPEGState));
      41             : 
      42        1188 :     if (new_tif_data == NULL)
      43             :     {
      44           0 :         TIFFErrorExtR(tif, "TIFFReInitJPEG_12",
      45             :                       "No space for JPEG state block");
      46           0 :         return 0;
      47             :     }
      48             : 
      49        1188 :     tif->tif_data = new_tif_data;
      50        1188 :     _TIFFmemset(tif->tif_data, 0, sizeof(JPEGState));
      51             : 
      52        1188 :     TIFFInitJPEGCommon(tif);
      53             : 
      54        1188 :     sp = JState(tif);
      55        1188 :     sp->otherSettings = *otherSettings;
      56             : 
      57        1188 :     if (is_encode)
      58        1180 :         return JPEGSetupEncode(tif);
      59             :     else
      60           8 :         return JPEGSetupDecode(tif);
      61             : }
      62             : 
      63             : #endif /* defined(JPEG_DUAL_MODE_8_12) */

Generated by: LCOV version 1.14