halcanary | 96287f7 | 2015-05-07 11:46:59 -0700 | [diff] [blame] | 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 | |
Mike Klein | c0bd9f9 | 2019-04-23 12:05:21 -0500 | [diff] [blame] | 10 | #include "include/codec/SkEncodedOrigin.h" |
| 11 | #include "include/core/SkSize.h" |
| 12 | #include "include/private/SkEncodedInfo.h" |
halcanary | 7a14b31 | 2015-10-01 07:28:13 -0700 | [diff] [blame] | 13 | |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 14 | /** Returns true if the data seems to be a valid JPEG image with a known colorType. |
halcanary | 96287f7 | 2015-05-07 11:46:59 -0700 | [diff] [blame] | 15 | |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 16 | @param [out] size Image size in pixels |
| 17 | @param [out] colorType Encoded color type (kGray_Color, kYUV_Color, several others). |
| 18 | @param [out] orientation EXIF Orientation of the image. |
halcanary | 96287f7 | 2015-05-07 11:46:59 -0700 | [diff] [blame] | 19 | */ |
Hal Canary | 83e0f1b | 2018-04-05 16:58:41 -0400 | [diff] [blame] | 20 | bool SkGetJpegInfo(const void* data, size_t len, |
| 21 | SkISize* size, |
| 22 | SkEncodedInfo::Color* colorType, |
| 23 | SkEncodedOrigin* orientation); |
halcanary | 96287f7 | 2015-05-07 11:46:59 -0700 | [diff] [blame] | 24 | |
| 25 | #endif // SkJpegInfo_DEFINED |