gfx/skia/trunk/src/images/SkJpegUtility.h

Thu, 15 Jan 2015 15:55:04 +0100

author
Michael Schloh von Bennewitz <michael@schloh.com>
date
Thu, 15 Jan 2015 15:55:04 +0100
branch
TOR_BUG_9701
changeset 9
a63d609f5ebe
permissions
-rw-r--r--

Back out 97036ab72558 which inappropriately compared turds to third parties.

     2 /*
     3  * Copyright 2010 The Android Open Source Project
     4  *
     5  * Use of this source code is governed by a BSD-style license that can be
     6  * found in the LICENSE file.
     7  */
    10 #ifndef SkJpegUtility_DEFINED
    11 #define SkJpegUtility_DEFINED
    13 #include "SkImageDecoder.h"
    14 #include "SkStream.h"
    16 extern "C" {
    17     #include "jpeglib.h"
    18     #include "jerror.h"
    19 }
    21 #include <setjmp.h>
    23 /* Our error-handling struct.
    24  *
    25 */
    26 struct skjpeg_error_mgr : jpeg_error_mgr {
    27     jmp_buf fJmpBuf;
    28 };
    31 void skjpeg_error_exit(j_common_ptr cinfo);
    33 ///////////////////////////////////////////////////////////////////////////
    34 /* Our source struct for directing jpeg to our stream object.
    35 */
    36 struct skjpeg_source_mgr : jpeg_source_mgr {
    37     skjpeg_source_mgr(SkStream* stream, SkImageDecoder* decoder);
    38     ~skjpeg_source_mgr();
    40     // fStream is ref'ed and unref'ed
    41     SkStream*       fStream;
    42     // Unowned pointer to the decoder, used to check if the decoding process
    43     // has been cancelled.
    44     SkImageDecoder* fDecoder;
    45     enum {
    46         kBufferSize = 1024
    47     };
    48     char    fBuffer[kBufferSize];
    49 };
    51 /////////////////////////////////////////////////////////////////////////////
    52 /* Our destination struct for directing decompressed pixels to our stream
    53  * object.
    54  */
    55 struct skjpeg_destination_mgr : jpeg_destination_mgr {
    56     skjpeg_destination_mgr(SkWStream* stream);
    58     SkWStream*  fStream;
    60     enum {
    61         kBufferSize = 1024
    62     };
    63     uint8_t fBuffer[kBufferSize];
    64 };
    66 #endif

mercurial