MCPcopy Create free account
hub / github.com/ARM-software/ComputeLibrary / PixelValue

Class PixelValue

arm_compute/core/PixelValue.h:39–335  ·  view source on GitHub ↗

Class describing the value of a pixel for any image format. */

Source from the content-addressed store, hash-verified

37{
38/** Class describing the value of a pixel for any image format. */
39class PixelValue
40{
41public:
42 /** Default constructor: value initialized to 0 */
43 PixelValue() noexcept : value{int64_t(0)}
44 {
45 }
46 /** Initialize the union with a pixel value of chosen datatype
47 *
48 * @param[in] v value.
49 * @param[in] datatype DataType that @p v have to be stored
50 * @param[in] qinfo (Optional) QuantizationInfo to apply in case of quantized data types to @p v
51 */
52 PixelValue(double v, DataType datatype, QuantizationInfo qinfo = QuantizationInfo()) : PixelValue()
53 {
54 switch (datatype)
55 {
56 case DataType::U8:
57 value.u8 = static_cast<uint8_t>(v);
58 break;
59 case DataType::S8:
60 value.s8 = static_cast<int8_t>(v);
61 break;
62 case DataType::QASYMM8:
63 value.u8 = quantize_qasymm8(static_cast<float>(v), qinfo);
64 break;
65 case DataType::QASYMM8_SIGNED:
66 value.s8 = quantize_qasymm8_signed(static_cast<float>(v), qinfo);
67 break;
68 case DataType::QSYMM8:
69 value.s8 = quantize_qsymm8(static_cast<float>(v), qinfo);
70 break;
71 case DataType::U16:
72 value.u16 = static_cast<uint16_t>(v);
73 break;
74 case DataType::S16:
75 value.s16 = static_cast<int16_t>(v);
76 break;
77 case DataType::QASYMM16:
78 value.u16 = quantize_qasymm16(static_cast<float>(v), qinfo);
79 break;
80 case DataType::QSYMM16:
81 value.s16 = quantize_qsymm16(static_cast<float>(v), qinfo);
82 break;
83 case DataType::U32:
84 value.u32 = static_cast<uint32_t>(v);
85 break;
86 case DataType::S32:
87 value.s32 = static_cast<int32_t>(v);
88 break;
89 case DataType::U64:
90 value.u64 = static_cast<uint64_t>(v);
91 break;
92 case DataType::S64:
93 value.s64 = static_cast<int64_t>(v);
94 break;
95 case DataType::BFLOAT16:
96 value.bf16 = static_cast<bfloat16>(v);

Callers 15

ScaleKernelInfoMethod · 0.85
get_min_maxFunction · 0.85
NEFillBorderClass · 0.85
NEPadLayerClass · 0.85
CLPadLayerClass · 0.85
GraphBuilderClass · 0.85
PadLayerMethod · 0.85
PadLayerNodeClass · 0.85
create_resize_layerFunction · 0.85
validateMethod · 0.85
configureMethod · 0.85
configureMethod · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected