blob: 39de99455af110bed49ac9089f5fc48818456360 [file] [log] [blame]
halcanary96287f72015-05-07 11:46:59 -07001/*
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
halcanary7a14b312015-10-01 07:28:13 -070010#include "SkSize.h"
11
halcanary96287f72015-05-07 11:46:59 -070012class SkData;
13
14struct SkJFIFInfo {
halcanary7a14b312015-10-01 07:28:13 -070015 SkISize fSize;
halcanary96287f72015-05-07 11:46:59 -070016 enum Type {
17 kGrayscale,
18 kYCbCr,
19 } fType;
20};
21
halcanary9d524f22016-03-29 09:03:52 -070022/** Returns true iff the data seems to be a valid JFIF JPEG image.
halcanary96fcdcc2015-08-27 07:41:13 -070023 If so and if info is not nullptr, populate info.
halcanary96287f72015-05-07 11:46:59 -070024
25 JPEG/JFIF References:
26 http://www.w3.org/Graphics/JPEG/itu-t81.pdf
27 http://www.w3.org/Graphics/JPEG/jfif3.pdf
28*/
29bool SkIsJFIF(const SkData* skdata, SkJFIFInfo* info);
30
31#endif // SkJpegInfo_DEFINED