Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(831)

Side by Side Diff: include/images/SkJpegUtility.h

Issue 12438025: Upstream changes from Android for decoding jpeg images. (Closed) Base URL: https://skia.googlecode.com/svn/trunk
Patch Set: addressing comments Created 7 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch | Annotate | Revision Log
« no previous file with comments | « gyp/libjpeg.gyp ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1
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 */
8
9
10 #ifndef SkJpegUtility_DEFINED
11 #define SkJpegUtility_DEFINED
12
13 #include "SkImageDecoder.h"
14 #include "SkStream.h"
15
16 extern "C" {
17 #include "jpeglib.h"
18 #include "jerror.h"
19 }
20
21 #include <setjmp.h>
22
23 /* Our error-handling struct.
24 *
25 */
26 struct skjpeg_error_mgr : jpeg_error_mgr {
27 jmp_buf fJmpBuf;
28 };
29
30
31 void skjpeg_error_exit(j_common_ptr cinfo);
32
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, bool ownStream) ;
38 ~skjpeg_source_mgr();
39
40 SkStream* fStream;
41 void* fMemoryBase;
42 size_t fMemoryBaseSize;
43 bool fUnrefStream;
44 SkImageDecoder* fDecoder;
45 enum {
46 kBufferSize = 1024
47 };
48 char fBuffer[kBufferSize];
49 };
50
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);
57
58 SkWStream* fStream;
59
60 enum {
61 kBufferSize = 1024
62 };
63 uint8_t fBuffer[kBufferSize];
64 };
65
66 #endif
OLDNEW
« no previous file with comments | « gyp/libjpeg.gyp ('k') | src/images/SkImageDecoder_libjpeg.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698