aboutsummaryrefslogtreecommitdiffhomepage
path: root/include
diff options
context:
space:
mode:
Diffstat (limited to 'include')
-rw-r--r--include/codec/SkCodec.h22
-rw-r--r--include/codec/SkEncodedOrigin.h23
-rw-r--r--include/encode/SkJpegEncoder.h10
3 files changed, 17 insertions, 38 deletions
diff --git a/include/codec/SkCodec.h b/include/codec/SkCodec.h
index d3035a7a71..6e9c8280b9 100644
--- a/include/codec/SkCodec.h
+++ b/include/codec/SkCodec.h
@@ -14,7 +14,6 @@
#include "SkColorSpaceXform.h"
#include "SkEncodedImageFormat.h"
#include "SkEncodedInfo.h"
-#include "SkEncodedOrigin.h"
#include "SkImageInfo.h"
#include "SkPixmap.h"
#include "SkSize.h"
@@ -171,11 +170,24 @@ public:
const SkEncodedInfo& getEncodedInfo() const { return fEncodedInfo; }
+ enum Origin {
+ kTopLeft_Origin = 1, // Default
+ kTopRight_Origin = 2, // Reflected across y-axis
+ kBottomRight_Origin = 3, // Rotated 180
+ kBottomLeft_Origin = 4, // Reflected across x-axis
+ kLeftTop_Origin = 5, // Reflected across x-axis, Rotated 90 CCW
+ kRightTop_Origin = 6, // Rotated 90 CW
+ kRightBottom_Origin = 7, // Reflected across x-axis, Rotated 90 CW
+ kLeftBottom_Origin = 8, // Rotated 90 CCW
+ kDefault_Origin = kTopLeft_Origin,
+ kLast_Origin = kLeftBottom_Origin,
+ };
+
/**
* Returns the image orientation stored in the EXIF data.
* If there is no EXIF data, or if we cannot read the EXIF data, returns kTopLeft.
*/
- SkEncodedOrigin getOrigin() const { return fOrigin; }
+ Origin getOrigin() const { return fOrigin; }
/**
* Return a size that approximately supports the desired scale factor.
@@ -670,7 +682,7 @@ protected:
XformFormat srcFormat,
std::unique_ptr<SkStream>,
sk_sp<SkColorSpace>,
- SkEncodedOrigin = kTopLeft_SkEncodedOrigin);
+ Origin = kTopLeft_Origin);
/**
* Allows the subclass to set the recommended SkImageInfo
@@ -679,7 +691,7 @@ protected:
const SkImageInfo&,
XformFormat srcFormat,
std::unique_ptr<SkStream>,
- SkEncodedOrigin = kTopLeft_SkEncodedOrigin);
+ Origin = kTopLeft_Origin);
virtual SkISize onGetScaledDimensions(float /*desiredScale*/) const {
// By default, scaling is not supported.
@@ -829,7 +841,7 @@ private:
const XformFormat fSrcXformFormat;
std::unique_ptr<SkStream> fStream;
bool fNeedsRewind;
- const SkEncodedOrigin fOrigin;
+ const Origin fOrigin;
SkImageInfo fDstInfo;
Options fOptions;
diff --git a/include/codec/SkEncodedOrigin.h b/include/codec/SkEncodedOrigin.h
deleted file mode 100644
index 622ade1555..0000000000
--- a/include/codec/SkEncodedOrigin.h
+++ /dev/null
@@ -1,23 +0,0 @@
-/*
- * 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
diff --git a/include/encode/SkJpegEncoder.h b/include/encode/SkJpegEncoder.h
index a094e3fb9c..fd7c204161 100644
--- a/include/encode/SkJpegEncoder.h
+++ b/include/encode/SkJpegEncoder.h
@@ -9,9 +9,6 @@
#define SkJpegEncoder_DEFINED
#include "SkEncoder.h"
-#ifdef SK_HAS_EXIF_LIBRARY
-#include "SkEncodedOrigin.h"
-#endif
class SkJpegEncoderMgr;
class SkWStream;
@@ -65,13 +62,6 @@ public:
*/
AlphaOption fAlphaOption = AlphaOption::kIgnore;
SkTransferFunctionBehavior fBlendBehavior = SkTransferFunctionBehavior::kRespect;
-
-#ifdef SK_HAS_EXIF_LIBRARY
- /**
- * Origin to be written to EXIF, if anything other than the default.
- */
- SkEncodedOrigin fOrigin = kDefault_SkEncodedOrigin;
-#endif
};
/**