aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/pdf/SkJpegInfo.h
blob: 1b03e45b105e777d9ec58a74ab41185b2bf99b8a (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
31
/*
 * 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

#include "SkSize.h"

class SkData;

struct SkJFIFInfo {
    SkISize fSize;
    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 nullptr, 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