45 internal_init(width, height, format,
false);
50 internal_init(width, height, format,
true);
53 void MultiImage::internal_init(
unsigned int width,
unsigned int height,
Format format,
bool auto_padding)
84 std::get<0>(_plane).
allocator()->init(info_full);
98 std::get<0>(_plane).
allocator()->init(info);
99 std::get<1>(_plane).
allocator()->init(info_uv88);
112 std::get<0>(_plane).
allocator()->init(info);
113 std::get<1>(_plane).
allocator()->init(info_sub2);
114 std::get<2>(_plane).
allocator()->init(info_sub2);
118 std::get<0>(_plane).
allocator()->init(info);
119 std::get<1>(_plane).
allocator()->init(info);
120 std::get<2>(_plane).
allocator()->init(info);
127 _info.
init(shape.
x(), shape.
y(), format);
145 std::get<0>(_plane).
allocator()->allocate();
149 std::get<0>(_plane).
allocator()->allocate();
150 std::get<1>(_plane).
allocator()->allocate();
154 std::get<0>(_plane).
allocator()->allocate();
155 std::get<1>(_plane).
allocator()->allocate();
156 std::get<2>(_plane).
allocator()->allocate();
184 std::get<0>(_plane).
allocator()->init(*dynamic_cast<Image *>(image->
plane(0))->
allocator(), coords, info_full);
192 std::get<1>(_plane).
allocator()->init(*dynamic_cast<Image *>(image->
plane(1))->
allocator(), coords, info_uv88);
199 std::get<1>(_plane).
allocator()->init(*dynamic_cast<Image *>(image->
plane(1))->
allocator(), coords, info_sub2);
200 std::get<2>(_plane).
allocator()->init(*dynamic_cast<Image *>(image->
plane(2))->
allocator(), coords, info_sub2);
213 _info.
init(width, height, format);
218 return &_plane[index];
223 return &_plane[index];
A single plane of 32-bit macro pixel of U0, Y0, V0, Y1 byte.
Store the multi-planar image's metadata.
TensorShape calculate_subsampled_shape(const TensorShape &shape, Format format, Channel channel=Channel::UNKNOWN)
Calculate subsampled shape for a given format and channel.
#define ARM_COMPUTE_ERROR(msg)
Print the given message then throw an std::runtime_error.
void init(unsigned int width, unsigned int height, Format format)
Initialize the metadata structure with the given parameters.
1 channel, 1 U8 per channel
1 channel, 1 F32 per channel
void init_auto_padding(unsigned int width, unsigned int height, Format format)
Allocate the multi-planar image.
A 2 plane YUV format of Luma (Y) and interleaved UV data at 4:2:0 sampling.
1 channel, 1 U16 per channel
Image * plane(unsigned int index) override
Return a pointer to the requested plane of the image.
A 2 plane YUV format of Luma (Y) and interleaved VU data at 4:2:0 sampling.
bool auto_padding() override
Update the offset to the first element and the strides to automatically computed values.
Copyright (c) 2017-2021 Arm Limited.
1 channel, 1 F16 per channel
1 channel, 1 S32 per channel
T x() const
Alias to access the size of the first dimension.
3 channels, 1 U8 per channel
1 channel, 1 U32 per channel
Format
Image colour formats.
void create_subimage(MultiImage *image, const Coordinates &coords, unsigned int width, unsigned int height)
Create a subimage from an existing MultiImage.
A 3 plane of 8 bit 4:4:4 sampled Y, U, V planes.
const MultiImageInfo * info() const override
Interface to be implemented by the child class to return the multi-planar image's metadata...
Basic implementation of the tensor interface.
1 channel, 1 S16 per channel
TensorShape adjust_odd_shape(const TensorShape &shape, Format format)
Adjust tensor shape size if width or height are odd for a given multi-planar format.
input allocator() -> allocate()
A 3 plane of 8-bit 4:2:0 sampled Y, U, V planes.
4 channels, 1 U8 per channel
void allocate()
Allocated a previously initialised multi image.
2 channel, 1 U8 per channel
Store the tensor's metadata.
T y() const
Alias to access the size of the second dimension.
A single plane of 32-bit macro pixel of Y0, U0, Y1, V0 bytes.
Format format() const
Colour format of the image.
Basic implementation of the multi-planar image interface.
void init(unsigned int width, unsigned int height, Format format)
Allocate the multi-planar image.