24 #ifndef ARM_COMPUTE_PIXELVALUE_H 25 #define ARM_COMPUTE_PIXELVALUE_H 57 value.u8 = static_cast<uint8_t>(v);
60 value.s8 = static_cast<int8_t>(v);
72 value.u16 = static_cast<uint16_t>(v);
75 value.s16 = static_cast<int16_t>(v);
84 value.u32 = static_cast<uint32_t>(v);
87 value.s32 = static_cast<int32_t>(v);
90 value.u64 = static_cast<uint64_t>(v);
93 value.s64 = static_cast<int64_t>(v);
96 value.bf16 = static_cast<bfloat16>(v);
99 value.f16 = static_cast<half>(v);
102 value.f32 = static_cast<float>(v);
244 void get(uint8_t &v)
const 260 void get(uint16_t &v)
const 268 void get(int16_t &v)
const 276 void get(uint32_t &v)
const 284 void get(int32_t &v)
const 292 void get(uint64_t &v)
const 300 void get(int64_t &v)
const 340 template <
typename T>
void get(uint32_t &v) const
Interpret the pixel value as a U32.
uint8_t rgbx[4]
4 channels: RGBX8888
int8_t quantize_qsymm8(float value, const QuantizationInfo &qinfo)
Quantize a value given a 8-bit symmetric quantization scheme.
Class describing the value of a pixel for any image format.
PixelValue(float v)
Initialize the union with a F32 pixel value.
int16_t quantize_qsymm16(float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a 16-bit symmetric quantization scheme.
quantized, symmetric fixed-point 16-bit number
PixelValue(uint8_t v)
Initialize the union with a U8 pixel value.
uint8_t rgb[3]
3 channels: RGB888
uint8_t u8
Single channel U8.
uint16_t u16
Single channel U16.
uint8_t quantize_qasymm8(float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given an unsigned 8-bit asymmetric quantization scheme.
Brain floating point representation class.
PixelValue(double v)
Initialize the union with a F64 pixel value.
void get(int32_t &v) const
Interpret the pixel value as a S32.
int64_t s64
Single channel S64.
1 channel, 1 U8 per channel
void get(uint8_t &v) const
Interpret the pixel value as a U8.
void get(int8_t &v) const
Interpret the pixel value as a S8.
void get(double &v) const
Interpret the pixel value as a double.
half_float::half half
16-bit floating point type
1 channel, 1 F32 per channel
quantized, asymmetric fixed-point 16-bit number
1 channel, 1 U16 per channel
void get(int16_t &v) const
Interpret the pixel value as a S16.
half f16
Single channel F16.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
void get(uint64_t &v) const
Interpret the pixel value as a U64.
1 channel, 1 S32 per channel
16-bit brain floating-point number
PixelValue(half v)
Initialize the union with a F16 pixel value.
double f64
Single channel double.
Quantization information.
void get(int64_t &v) const
Interpret the pixel value as a S64.
PixelValue() noexcept
Default constructor: value initialized to 0.
1 channel, 1 U32 per channel
void get(bfloat16 &v) const
Interpret the pixel value as a BFLOAT16.
int8_t quantize_qasymm8_signed(float value, const INFO_TYPE &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a signed 8-bit asymmetric quantization scheme.
quantized, asymmetric fixed-point 8-bit number unsigned
void get(float &v) const
Interpret the pixel value as a F32.
bfloat16 bf16
Single channel brain floating-point number.
union arm_compute::PixelValue::@0 value
Union which describes the value of a pixel for any image format.
1 channel, 1 S16 per channel
PixelValue(bfloat16 v)
Initialize the union with a BFLOAT16 pixel value.
quantized, symmetric fixed-point 8-bit number
PixelValue(uint64_t v)
Initialize the union with a U64 pixel value.
int8_t s8
Single channel S8.
float f32
Single channel float 32.
void get(uint16_t &v) const
Interpret the pixel value as a U16.
T get() const
Get the pixel value.
PixelValue(uint16_t v)
Initialize the union with a U16 pixel value.
const QuantizationInfo qinfo
uint64_t u64
Single channel U64.
int16_t s16
Single channel S16.
PixelValue(uint32_t v)
Initialize the union with a U32 pixel value.
quantized, asymmetric fixed-point 8-bit number signed
PixelValue(int32_t v)
Initialize the union with a S32 pixel value.
int32_t s32
Single channel S32.
64-bit floating-point number
uint32_t u32
Single channel U32.
DataType
Available data types.
uint8_t yuv[3]
3 channels: Any YUV format
PixelValue(double v, DataType datatype, QuantizationInfo qinfo=QuantizationInfo())
Initialize the union with a pixel value of chosen datatype.
uint16_t quantize_qasymm16(float value, const UniformQuantizationInfo &qinfo, RoundingPolicy rounding_policy=RoundingPolicy::TO_NEAREST_UP)
Quantize a value given a 16-bit asymmetric quantization scheme.
PixelValue(int8_t v)
Initialize the union with a S8 pixel value.
PixelValue(int16_t v)
Initialize the union with a S16 pixel value.
PixelValue(int64_t v)
Initialize the union with a S64 pixel value.
void get(half &v) const
Interpret the pixel value as a F16.