diff options
author | Ruben Brunk <rubenbrunk@google.com> | 2015-06-05 17:03:05 -0700 |
---|---|---|
committer | Ruben Brunk <rubenbrunk@google.com> | 2015-06-16 09:51:20 -0700 |
commit | 0f212b73e47ef0e1fa39aa250ebabedb9d81a361 (patch) | |
tree | a05bb0a5893e85ddd2c77c59509fcaf52283603d /media/img_utils/include | |
parent | bd974011599b6d4ff47c1cee36d617f191dc0c2f (diff) | |
download | frameworks_av-0f212b73e47ef0e1fa39aa250ebabedb9d81a361.zip frameworks_av-0f212b73e47ef0e1fa39aa250ebabedb9d81a361.tar.gz frameworks_av-0f212b73e47ef0e1fa39aa250ebabedb9d81a361.tar.bz2 |
Add distortion correction opcodes in DngCreator.
Bug: 20491394
Change-Id: Ide932d49e620c7dc9a847bb5ddc8715d5f936bd5
Diffstat (limited to 'media/img_utils/include')
-rw-r--r-- | media/img_utils/include/img_utils/DngUtils.h | 37 |
1 files changed, 37 insertions, 0 deletions
diff --git a/media/img_utils/include/img_utils/DngUtils.h b/media/img_utils/include/img_utils/DngUtils.h index 4389b02..3dcedc5 100644 --- a/media/img_utils/include/img_utils/DngUtils.h +++ b/media/img_utils/include/img_utils/DngUtils.h @@ -31,6 +31,7 @@ namespace android { namespace img_utils { #define NELEMS(x) ((int) (sizeof(x) / sizeof((x)[0]))) +#define CLAMP(x, low, high) (((x) > (high)) ? (high) : (((x) < (low)) ? (low) : (x))) /** * Utility class for building values for the OpcodeList tags specified @@ -107,13 +108,49 @@ class ANDROID_API OpcodeListBuilder : public LightRefBase<OpcodeListBuilder> { uint32_t mapPlanes, const float* mapGains); + /** + * Add WarpRectilinear opcode for the given metadata parameters. + * + * Returns OK on success, or a negative error code. + */ + virtual status_t addWarpRectilinearForMetadata(const float* kCoeffs, + uint32_t activeArrayWidth, + uint32_t activeArrayHeight, + float opticalCenterX, + float opticalCenterY); + + /** + * Add a WarpRectilinear opcode. + * + * numPlanes - Number of planes included in this opcode. + * opticalCenterX, opticalCenterY - Normalized x,y coordinates of the sensor optical + * center relative to the top,left pixel of the produced images (e.g. [0.5, 0.5] + * gives a sensor optical center in the image center. + * kCoeffs - A list of coefficients for the polynomial equation representing the distortion + * correction. For each plane, 6 coefficients must be included: + * {k_r0, k_r1, k_r2, k_r3, k_t0, k_t1}. See the DNG 1.4 specification for an + * outline of the polynomial used here. + * + * Returns OK on success, or a negative error code. + */ + virtual status_t addWarpRectilinear(uint32_t numPlanes, + double opticalCenterX, + double opticalCenterY, + const double* kCoeffs); + // TODO: Add other Opcode methods protected: static const uint32_t FLAG_OPTIONAL = 0x1u; static const uint32_t FLAG_OPTIONAL_FOR_PREVIEW = 0x2u; + // Opcode IDs enum { + WARP_RECTILINEAR_ID = 1, GAIN_MAP_ID = 9, + }; + + // LSM mosaic indices + enum { LSM_R_IND = 0, LSM_GE_IND = 1, LSM_GO_IND = 2, |