1 /*
2  * Copyright 2015 Google Inc.
3  *
4  * Use of this source code is governed by a BSD-style license that can be
5  * found in the LICENSE file.
6  */
7 #ifndef SkJpegInfo_DEFINED
8 #define SkJpegInfo_DEFINED
9 
10 #include "SkSize.h"
11 
12 class SkData;
13 
14 struct SkJFIFInfo {
15     SkISize fSize;
16     enum Type {
17         kGrayscale,
18         kYCbCr,
19     } fType;
20 };
21 
22 /** Returns true iff the data seems to be a valid JFIF JPEG image.
23     If so and if info is not nullptr, populate info.
24 
25     JPEG/JFIF References:
26         http://www.w3.org/Graphics/JPEG/itu-t81.pdf
27         http://www.w3.org/Graphics/JPEG/jfif3.pdf
28 */
29 bool SkIsJFIF(const SkData* skdata, SkJFIFInfo* info);
30 
31 #endif  // SkJpegInfo_DEFINED
32