' 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

struct ImagePlaneStridedMem
{
    + size: Size2D
    + pitchBytes: int32_t
    + data: void *
}

struct NVCVImageData

interface IVisitorImageData
{
    + {abstract} visit(ImageDataHostMem &data): bool
    + {abstract} visit(ImageDataHostPinnedMem &data): bool
    + {abstract} visit(ImageDataCudaMem &data): bool
    + {abstract} visit(ImageDataCudaArray &data): bool
}

interface ImageData
{
    + {abstract} cdata() const: const NVCVImageData &

    + {abstract} accept(IVisitorImageData &visitor): void
}

ImageData *-right- NVCVImageData
ImageData -[hidden]left- IVisitorImageData

interface ImageDataCudaArray extends ImageData
{
    + {abstract} plane(int p) const: cudaArray_t
}

interface ImageDataStridedMem extends ImageData
{
    + {abstract} size() const: Size2D
    + {abstract} format() const: ImageFormat

    + {abstract} plane(int p) const: ImagePlaneStridedMem &
}

ImageDataStridedMem -[hidden]left- ImagePlaneStridedMem

interface ImageDataHostMem
{
}
ImageDataStridedMem <|--# ImageDataHostMem: virtual

interface ImageDataHostPinnedMem
{
}
ImageDataStridedMem <|--# ImageDataHostPinnedMem: virtual

interface ImageDataCudaMem
{
}
ImageDataStridedMem <|--# ImageDataCudaMem: virtual

class ImageDataCudaArray implements ImageDataCudaArray
{
}

class ImageDataStridedMem
{
}
ImageDataStridedMem <|..# ImageDataStridedMem: virtual

class ImageDataHostMem implements ImageDataHostMem
{
}
ImageDataStridedMem <|--* ImageDataHostMem: private

class ImageDataHostPinnedMem implements ImageDataHostPinnedMem
{
}
ImageDataStridedMem <|--* ImageDataHostPinnedMem: private

class ImageDataCudaMem implements ImageDataCudaMem
{
}
ImageDataStridedMem <|--* ImageDataCudaMem: private

ImageDataCudaArray -[hidden]left- ImageDataCudaMem

@enduml
