' Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
'
' SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
' SPDX-License-Identifier: Apache-2.0
'
' NVIDIA CORPORATION, its affiliates and licensors retain all intellectual
' property and proprietary rights in and to this material, related
' documentation and any modifications thereto. Any use, reproduction,
' disclosure or distribution of this material and related documentation
' without an express license agreement from NVIDIA CORPORATION or
' its affiliates is strictly prohibited.

@startuml

class Allocator

class ImageData

interface IImage
{
    + {abstract} handle() const: NVCVImage

    + {abstract} size() const: Size2D
    + {abstract} format() const: ImageFormat

    + {abstract} alloc() const: Allocator

    + {abstract} exportData() const: ImageData

    + exportData<DerivedData>() const: Optional<DerivedData>
}

Allocator -right-o IImage: refers to <
ImageData -left-o IImage: refers to <

class Image implements IImage
{
    + Image(Size2D size, ImageFormat fmt,
            const Allocator &alloc=nullptr)
}

class ImageWrapHandle implements IImage
{
    + ImageWrapData(NVCVImage handle)
}

class ImageWrapData implements IImage
{
    + ImageWrapData(const ImageData &data,
                    ImageDataCleanupCallback &&cleanup = {})
}

@enduml
