From 53b405f1e08ad41cb9a527abfe0308ec1edf18ff Mon Sep 17 00:00:00 2001 From: Michalis Spyrou Date: Wed, 27 Sep 2017 15:55:31 +0100 Subject: COMPMID-417 - Add RandomAccessor support in Graph API. Change-Id: I54dd435258a2d0ff486ded64b23654bab6b80f3f Reviewed-on: http://mpd-gerrit.cambridge.arm.com/89373 Tested-by: Kaizen Reviewed-by: Georgios Pinitas --- arm_compute/core/PixelValue.h | 66 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 66 insertions(+) (limited to 'arm_compute/core/PixelValue.h') diff --git a/arm_compute/core/PixelValue.h b/arm_compute/core/PixelValue.h index 63405560ea..ce3726b6fc 100644 --- a/arm_compute/core/PixelValue.h +++ b/arm_compute/core/PixelValue.h @@ -84,6 +84,25 @@ public: { value.s32 = v; } + + /** Initialize the union with a U64 pixel value + * + * @param[in] v U64 value. + */ + PixelValue(uint64_t v) + : PixelValue() + { + value.u64 = v; + } + /** Initialize the union with a S64 pixel value + * + * @param[in] v S64 value. + */ + PixelValue(int64_t v) + : PixelValue() + { + value.s64 = v; + } /** Initialize the union with a F16 pixel value * * @param[in] v F16 value. @@ -102,6 +121,15 @@ public: { value.f32 = v; } + /** Initialize the union with a F64 pixel value + * + * @param[in] v F64 value. + */ + PixelValue(double v) + : PixelValue() + { + value.f64 = v; + } /** Union which describes the value of a pixel for any image format. * Use the field corresponding to the image format */ @@ -110,6 +138,7 @@ public: uint8_t rgb[3]; /**< 3 channels: RGB888 */ uint8_t yuv[3]; /**< 3 channels: Any YUV format */ uint8_t rgbx[4]; /**< 4 channels: RGBX8888 */ + double f64; /**< Single channel double */ float f32; /**< Single channel float 32 */ half f16; /**< Single channel F16 */ uint8_t u8; /**< Single channel U8 */ @@ -118,6 +147,8 @@ public: int16_t s16; /**< Single channel S16 */ uint32_t u32; /**< Single channel U32 */ int32_t s32; /**< Single channel S32 */ + uint64_t u64; /**< Single channel U64 */ + int64_t s64; /**< Single channel S64 */ } value; /** Interpret the pixel value as a U8 * @@ -167,6 +198,22 @@ public: { v = value.s32; } + /** Interpret the pixel value as a U64 + * + * @param[out] v Returned value + */ + void get(uint64_t &v) const + { + v = value.u64; + } + /** Interpret the pixel value as a S64 + * + * @param[out] v Returned value + */ + void get(int64_t &v) const + { + v = value.s64; + } /** Interpret the pixel value as a F16 * * @param[out] v Returned value @@ -183,6 +230,25 @@ public: { v = value.f32; } + /** Interpret the pixel value as a double + * + * @param[out] v Returned value + */ + void get(double &v) const + { + v = value.f64; + } + /** Get the pixel value + * + * @return Pixel value + */ + template + T get() const + { + T val; + get(val); + return val; + } }; } #endif /* __ARM_COMPUTE_PIXELVALUE_H__ */ -- cgit v1.2.1