MayaFlux 1.0.0
Digital-First Multimedia Processing Framework
Loading...
Searching...
No Matches

◆ make_empty_storage()

MAYAFLUX_API DataVariant MayaFlux::Kakshya::make_empty_storage ( ImageFormat  format,
size_t  element_count 
)

Allocate a zeroed DataVariant of the alternative backing a format.

Parameters
formatPixel format determining the element type.
element_countNumber of elements, not bytes. Typically width * height * channel_count.
Returns
Zero-filled variant of the matching alternative.

Definition at line 154 of file PixelStorage.cpp.

155{
156 switch (storage_element_size(format)) {
157 case 2:
158 return std::vector<uint16_t>(element_count, 0U);
159 case 4:
160 return std::vector<float>(element_count, 0.0F);
161 default:
162 return std::vector<uint8_t>(element_count, 0U);
163 }
164}
bool format
size_t storage_element_size(ImageFormat format)
Byte width of the DataVariant element backing a given ImageFormat.

References format, and storage_element_size().

Referenced by MayaFlux::Kakshya::TextureContainer::append_image_layer(), MayaFlux::Kakshya::CameraContainer::CameraContainer(), MayaFlux::Kakshya::TextureContainer::claim_cpu(), MayaFlux::Kakshya::TextureContainer::clear(), MayaFlux::Kakshya::TextureContainer::ensure_cpu(), MayaFlux::Kakshya::TextureContainer::from_image(), MayaFlux::Kakshya::TextureContainer::from_image(), MayaFlux::Kakshya::TextureContainer::from_image_array(), MayaFlux::Kakshya::TextureContainer::from_image_array(), MayaFlux::Kakshya::TextureContainer::hold_layer(), and MayaFlux::Kakshya::TextureContainer::TextureContainer().

+ Here is the call graph for this function:
+ Here is the caller graph for this function: