skia2/include/codec/SkEncodedOrigin.h
Leon Scroggins III 5411a60e0d Add an Option for orientation on JPEG encodes
Move Origin to its own header so that SkPixmap and SkJpegEncoder need
not depend on SkCodec.

Add libexif, which is already used by Android, and use it to write the
orientation. Write a makefile based on the Android.bp in Android, minus
warnings. (libexif has an LGPL license.)

Add a test that verifies all the orientations work.

Optionally enable writing the orientation (and therefore including
libexif). Chromium does not currently need it, and Android does not
expose an API that would allow using it. Disable on Windows, where we
still have build errors to fix.

Bug: skia:7138
Change-Id: Iaeff44c36aebe0e639666979dc00e1b7594bbeb1
Reviewed-on: https://skia-review.googlesource.com/60721
Commit-Queue: Leon Scroggins <scroggo@google.com>
Reviewed-by: Mike Klein <mtklein@chromium.org>
Reviewed-by: Mike Reed <reed@google.com>
2017-10-18 17:38:15 +00:00

24 lines
962 B
C

/*
* Copyright 2017 Google Inc.
*
* Use of this source code is governed by a BSD-style license that can be
* found in the LICENSE file.
*/
#ifndef SkEncodedOrigin_DEFINED
#define SkEncodedOrigin_DEFINED
// These values match the orientation www.exif.org/Exif2-2.PDF.
enum SkEncodedOrigin {
kTopLeft_SkEncodedOrigin = 1, // Default
kTopRight_SkEncodedOrigin = 2, // Reflected across y-axis
kBottomRight_SkEncodedOrigin = 3, // Rotated 180
kBottomLeft_SkEncodedOrigin = 4, // Reflected across x-axis
kLeftTop_SkEncodedOrigin = 5, // Reflected across x-axis, Rotated 90 CCW
kRightTop_SkEncodedOrigin = 6, // Rotated 90 CW
kRightBottom_SkEncodedOrigin = 7, // Reflected across x-axis, Rotated 90 CW
kLeftBottom_SkEncodedOrigin = 8, // Rotated 90 CCW
kDefault_SkEncodedOrigin = kTopLeft_SkEncodedOrigin,
kLast_SkEncodedOrigin = kLeftBottom_SkEncodedOrigin,
};
#endif // SkEncodedOrigin_DEFINED