aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkJpegInfo.h
blob: 1be4c0fa669ba79f852882375156584fa62949fe (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
/*
 * Copyright 2015 Google Inc.
 *
 * Use of this source code is governed by a BSD-style license that can be
 * found in the LICENSE file.
 */
#ifndef SkJpegInfo_DEFINED
#define SkJpegInfo_DEFINED

class SkData;

struct SkJFIFInfo {
    int fWidth;
    int fHeight;
    enum Type {
        kGrayscale,
        kYCbCr,
    } fType;
};

/** Returns true iff the data seems to be a valid JFIF JPEG image.  
    If so and if info is not NULL, populate info.

    JPEG/JFIF References:
        http://www.w3.org/Graphics/JPEG/itu-t81.pdf
        http://www.w3.org/Graphics/JPEG/jfif3.pdf
*/
bool SkIsJFIF(const SkData* skdata, SkJFIFInfo* info);

#endif  // SkJpegInfo_DEFINED