' Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
'
' SPDX-FileCopyrightText: NVIDIA CORPORATION & AFFILIATES
' SPDX-License-Identifier: LicenseRef-NvidiaProprietary
'
' 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

interface IImageData
{
    + {abstract} format() const: ImageFormat

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

interface IImageDataCudaArray extends IImageData
{
    + {abstract} numPlanes() const: int32_t
    + {abstract} plane(int p) const: cudaArray_t
}

struct Size2D
{
    + w: int32_t
    + h: int32_t
}

struct ImagePlanePitch
{
    + width: int32_t
    + height: int32_t
    + pitchBytes: int32_t
    + mem: void *
}

interface IImageDataPitch extends IImageData
{
    + {abstract} size() const: Size2D

    + {abstract} numPlanes() const: int32_t
    + {abstract} plane(int p) const: const ImagePlanePitch &
}

interface IImageDataPitchDevice implements IImageDataPitch
{
}

interface IImageDataPitchHost implements IImageDataPitch
{
}

struct ImageBufferCudaArray
{
    + numPlanes: int32_t
    + planes: cudaArray_t[MAX_PLANES]
}

class ImageDataCudaArray implements IImageDataCudaArray
{
    + ImageDataCudaArray(ImageFormat fmt,
                         const ImageBufferCudaArray &buffer)
}

struct ImageBufferPitch
{
    + numPlanes: int32_t
    + planes: ImagePlanePitch[MAX_PLANES]
}

class ImageDataPitchDevice implements IImageDataPitchDevice
{
    + ImageDataPitchDevice(ImageFormat fmt,
                           const ImageBufferPitch &buffer)
}

class ImageDataPitchHost implements IImageDataPitchHost
{
    + ImageDataPitchHost(ImageFormat fmt,
                         const ImageBufferPitch &buffer)
}

ImageBufferPitch -up-o ImageDataPitchHost: contains <
ImageBufferPitch -up-o ImageDataPitchDevice: contains <
ImagePlanePitch -right-o ImageBufferPitch: contains <

ImageBufferCudaArray -up-o ImageDataCudaArray: contains <

@enduml
