OpMorphology.h#

Fully qualified name: public/src/operator/include/OpMorphology.h

File members: public/src/operator/include/OpMorphology.h

/*
 * SPDX-FileCopyrightText: Copyright (c) 2024-2025 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
 * 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.
 */

#ifndef PVA_SOLUTIONS_OPMORPHOLOGY_H
#define PVA_SOLUTIONS_OPMORPHOLOGY_H

#include <PvaOperator.h>
#include <PvaOperatorTypes.h>
#include <cupva_host_scheduling.h>
#include <nvcv/BorderType.h>
#include <nvcv/Status.h>
#include <nvcv/Tensor.h>

#ifdef __cplusplus
extern "C" {
#endif

#define MAX_MASK_MORPHOLOGY_MASK_WIDTH (5)
#define MAX_MASK_MORPHOLOGY_MASK_HEIGHT (5)
#define MAX_MASK_MORPHOLOGY_MASK_ARRAY_SIZE (MAX_MASK_MORPHOLOGY_MASK_WIDTH * MAX_MASK_MORPHOLOGY_MASK_HEIGHT)
typedef enum
{
    RECTANGLE_MASK = 0,
    CROSS_MASK = 1
} MorphologyMaskType;

typedef struct PvaMorphologyMaskParamsRec
{
    int32_t maskWidth;
    int32_t maskHeight;
    MorphologyMaskType maskShape;
} PvaMorphologyMaskParams;

NVCVStatus pvaMorphologyCreate(NVCVOperatorHandle *handle, NVCVTensorRequirements *tensorRequirements,
                               PvaMorphologyType morphType, PvaMorphologyMaskParams *maskParams,
                               const NVCVBorderType borderMode, int32_t borderValue);

NVCVStatus pvaMorphologySubmit(NVCVOperatorHandle handle, cupvaStream_t stream, NVCVTensorHandle in,
                               NVCVTensorHandle out);

#ifdef __cplusplus
}
#endif

#endif /* PVA_SOLUTIONS_OPMORPHOLOGY_H */