Path: blob/master/modules/imgproc/src/hal_replacement.hpp
16339 views
/*M///////////////////////////////////////////////////////////////////////////////////////1//2// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.3//4// By downloading, copying, installing or using the software you agree to this license.5// If you do not agree to this license, do not download, install,6// copy or use the software.7//8//9// License Agreement10// For Open Source Computer Vision Library11//12// Copyright (C) 2000-2008, Intel Corporation, all rights reserved.13// Copyright (C) 2009, Willow Garage Inc., all rights reserved.14// Copyright (C) 2013, OpenCV Foundation, all rights reserved.15// Copyright (C) 2015, Itseez Inc., all rights reserved.16// Third party copyrights are property of their respective owners.17//18// Redistribution and use in source and binary forms, with or without modification,19// are permitted provided that the following conditions are met:20//21// * Redistribution's of source code must retain the above copyright notice,22// this list of conditions and the following disclaimer.23//24// * Redistribution's in binary form must reproduce the above copyright notice,25// this list of conditions and the following disclaimer in the documentation26// and/or other materials provided with the distribution.27//28// * The name of the copyright holders may not be used to endorse or promote products29// derived from this software without specific prior written permission.30//31// This software is provided by the copyright holders and contributors "as is" and32// any express or implied warranties, including, but not limited to, the implied33// warranties of merchantability and fitness for a particular purpose are disclaimed.34// In no event shall the Intel Corporation or contributors be liable for any direct,35// indirect, incidental, special, exemplary, or consequential damages36// (including, but not limited to, procurement of substitute goods or services;37// loss of use, data, or profits; or business interruption) however caused38// and on any theory of liability, whether in contract, strict liability,39// or tort (including negligence or otherwise) arising in any way out of40// the use of this software, even if advised of the possibility of such damage.41//42//M*/4344#ifndef OPENCV_IMGPROC_HAL_REPLACEMENT_HPP45#define OPENCV_IMGPROC_HAL_REPLACEMENT_HPP4647#include "opencv2/core/hal/interface.h"48#include "opencv2/imgproc/hal/interface.h"4950#if defined __GNUC__51# pragma GCC diagnostic push52# pragma GCC diagnostic ignored "-Wunused-parameter"53#elif defined _MSC_VER54# pragma warning( push )55# pragma warning( disable: 4100 )56#endif5758//! @addtogroup imgproc_hal_interface59//! @note Define your functions to override default implementations:60//! @code61//! #undef hal_add8u62//! #define hal_add8u my_add8u63//! @endcode64//! @{6566/**67@brief Dummy structure storing filtering context6869Users can convert this pointer to any type they want. Initialisation and destruction should be made in Init and Free function implementations correspondingly.70Example:71@code{.cpp}72int my_hal_filterInit(cvhalFilter2D **context, ...) {73context = static_cast<cvhalFilter2D*>(new MyFilterData());74//... init75}7677int my_hal_filterFree(cvhalFilter2D *context) {78MyFilterData *c = static_cast<MyFilterData*>(context);79delete c;80}81@endcode82*/83struct cvhalFilter2D {};8485/**86@brief hal_filterInit87@param context double pointer to user-defined context88@param kernel_data pointer to kernel data89@param kernel_step kernel step90@param kernel_type kernel type (CV_8U, ...)91@param kernel_width kernel width92@param kernel_height kernel height93@param max_width max possible image width, can be used to allocate working buffers94@param max_height max possible image height95@param src_type source image type96@param dst_type destination image type97@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)98@param delta added to pixel values99@param anchor_x relative X position of center point within the kernel100@param anchor_y relative Y position of center point within the kernel101@param allowSubmatrix indicates whether the submatrices will be allowed as source image102@param allowInplace indicates whether the inplace operation will be possible103@sa cv::filter2D, cv::hal::Filter2D104*/105inline int hal_ni_filterInit(cvhalFilter2D **context, uchar *kernel_data, size_t kernel_step, int kernel_type, int kernel_width, int kernel_height, int max_width, int max_height, int src_type, int dst_type, int borderType, double delta, int anchor_x, int anchor_y, bool allowSubmatrix, bool allowInplace) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }106/**107@brief hal_filter108@param context pointer to user-defined context109@param src_data source image data110@param src_step source image step111@param dst_data destination image data112@param dst_step destination image step113@param width images width114@param height images height115@param full_width full width of source image (outside the ROI)116@param full_height full height of source image (outside the ROI)117@param offset_x source image ROI offset X118@param offset_y source image ROI offset Y119@sa cv::filter2D, cv::hal::Filter2D120*/121inline int hal_ni_filter(cvhalFilter2D *context, uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step, int width, int height, int full_width, int full_height, int offset_x, int offset_y) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }122/**123@brief hal_filterFree124@param context pointer to user-defined context125@sa cv::filter2D, cv::hal::Filter2D126*/127inline int hal_ni_filterFree(cvhalFilter2D *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }128129//! @cond IGNORED130#define cv_hal_filterInit hal_ni_filterInit131#define cv_hal_filter hal_ni_filter132#define cv_hal_filterFree hal_ni_filterFree133//! @endcond134135/**136@brief hal_sepFilterInit137@param context double pointer to user-defined context138@param src_type source image type139@param dst_type destination image type140@param kernel_type kernels type141@param kernelx_data pointer to x-kernel data142@param kernelx_length x-kernel vector length143@param kernely_data pointer to y-kernel data144@param kernely_length y-kernel vector length145@param anchor_x relative X position of center point within the kernel146@param anchor_y relative Y position of center point within the kernel147@param delta added to pixel values148@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)149@sa cv::sepFilter2D, cv::hal::SepFilter2D150*/151inline int hal_ni_sepFilterInit(cvhalFilter2D **context, int src_type, int dst_type, int kernel_type, uchar *kernelx_data, int kernelx_length, uchar *kernely_data, int kernely_length, int anchor_x, int anchor_y, double delta, int borderType) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }152/**153@brief hal_sepFilter154@param context pointer to user-defined context155@param src_data source image data156@param src_step source image step157@param dst_data destination image data158@param dst_step destination image step159@param width images width160@param height images height161@param full_width full width of source image (outside the ROI)162@param full_height full height of source image (outside the ROI)163@param offset_x source image ROI offset X164@param offset_y source image ROI offset Y165@sa cv::sepFilter2D, cv::hal::SepFilter2D166*/167inline int hal_ni_sepFilter(cvhalFilter2D *context, uchar *src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int full_width, int full_height, int offset_x, int offset_y) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }168/**169@brief hal_sepFilterFree170@param context pointer to user-defined context171@sa cv::sepFilter2D, cv::hal::SepFilter2D172*/173inline int hal_ni_sepFilterFree(cvhalFilter2D *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }174175//! @cond IGNORED176#define cv_hal_sepFilterInit hal_ni_sepFilterInit177#define cv_hal_sepFilter hal_ni_sepFilter178#define cv_hal_sepFilterFree hal_ni_sepFilterFree179//! @endcond180181/**182@brief hal_morphInit183@param context double pointer to user-defined context184@param operation morphology operation CV_HAL_MORPH_ERODE or CV_HAL_MORPH_DILATE185@param src_type source image type186@param dst_type destination image type187@param max_width max possible image width, can be used to allocate working buffers188@param max_height max possible image height189@param kernel_type kernel type (CV_8U, ...)190@param kernel_data pointer to kernel data191@param kernel_step kernel step192@param kernel_width kernel width193@param kernel_height kernel height194@param anchor_x relative X position of center point within the kernel195@param anchor_y relative Y position of center point within the kernel196@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)197@param borderValue values to use for CV_HAL_BORDER_CONSTANT mode198@param iterations number of iterations199@param allowSubmatrix indicates whether the submatrices will be allowed as source image200@param allowInplace indicates whether the inplace operation will be possible201@sa cv::erode, cv::dilate, cv::morphologyEx, cv::hal::Morph202*/203inline int hal_ni_morphInit(cvhalFilter2D **context, int operation, int src_type, int dst_type, int max_width, int max_height, int kernel_type, uchar *kernel_data, size_t kernel_step, int kernel_width, int kernel_height, int anchor_x, int anchor_y, int borderType, const double borderValue[4], int iterations, bool allowSubmatrix, bool allowInplace) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }204/**205@brief hal_morph206@param context pointer to user-defined context207@param src_data source image data208@param src_step source image step209@param dst_data destination image data210@param dst_step destination image step211@param width images width212@param height images height213@param src_full_width full width of source image (outside the ROI)214@param src_full_height full height of source image (outside the ROI)215@param src_roi_x source image ROI X offset216@param src_roi_y source image ROI Y offset217@param dst_full_width full width of destination image218@param dst_full_height full height of destination image219@param dst_roi_x destination image ROI X offset220@param dst_roi_y destination image ROI Y offset221@sa cv::erode, cv::dilate, cv::morphologyEx, cv::hal::Morph222*/223inline int hal_ni_morph(cvhalFilter2D *context, uchar *src_data, size_t src_step, uchar *dst_data, size_t dst_step, int width, int height, int src_full_width, int src_full_height, int src_roi_x, int src_roi_y, int dst_full_width, int dst_full_height, int dst_roi_x, int dst_roi_y) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }224/**225@brief hal_morphFree226@param context pointer to user-defined context227@sa cv::erode, cv::dilate, cv::morphologyEx, cv::hal::Morph228*/229inline int hal_ni_morphFree(cvhalFilter2D *context) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }230231//! @cond IGNORED232#define cv_hal_morphInit hal_ni_morphInit233#define cv_hal_morph hal_ni_morph234#define cv_hal_morphFree hal_ni_morphFree235//! @endcond236237/**238@brief hal_resize239@param src_type source and destination image type240@param src_data source image data241@param src_step source image step242@param src_width source image width243@param src_height source image height244@param dst_data destination image data245@param dst_step destination image step246@param dst_width destination image width247@param dst_height destination image height248@param inv_scale_x inversed scale X coefficient249@param inv_scale_y inversed scale Y coefficient250@param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...)251@sa cv::resize, cv::hal::resize252*/253inline int hal_ni_resize(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, double inv_scale_x, double inv_scale_y, int interpolation) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }254/**255@brief hal_warpAffine256@param src_type source and destination image type257@param src_data source image data258@param src_step source image step259@param src_width source image width260@param src_height source image height261@param dst_data destination image data262@param dst_step destination image step263@param dst_width destination image width264@param dst_height destination image height265@param M 2x3 matrix with transform coefficients266@param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...)267@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)268@param borderValue values to use for CV_HAL_BORDER_CONSTANT mode269@sa cv::warpAffine, cv::hal::warpAffine270*/271inline int hal_ni_warpAffine(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, const double M[6], int interpolation, int borderType, const double borderValue[4]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }272/**273@brief hal_warpPerspective274@param src_type source and destination image type275@param src_data source image data276@param src_step source image step277@param src_width source image width278@param src_height source image height279@param dst_data destination image data280@param dst_step destination image step281@param dst_width destination image width282@param dst_height destination image height283@param M 3x3 matrix with transform coefficients284@param interpolation interpolation mode (CV_HAL_INTER_NEAREST, ...)285@param borderType border processing mode (CV_HAL_BORDER_REFLECT, ...)286@param borderValue values to use for CV_HAL_BORDER_CONSTANT mode287@sa cv::warpPerspective, cv::hal::warpPerspective288*/289inline int hal_ni_warpPerspective(int src_type, const uchar *src_data, size_t src_step, int src_width, int src_height, uchar *dst_data, size_t dst_step, int dst_width, int dst_height, const double M[9], int interpolation, int borderType, const double borderValue[4]) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }290291//! @cond IGNORED292#define cv_hal_resize hal_ni_resize293#define cv_hal_warpAffine hal_ni_warpAffine294#define cv_hal_warpPerspective hal_ni_warpPerspective295//! @endcond296297/**298@brief hal_cvtBGRtoBGR299@param src_data,src_step source image data and step300@param dst_data,dst_step destination image data and step301@param width,height image size302@param depth image depth (one of CV_8U, CV_16U, CV_32F)303@param scn source image channels (3 or 4)304@param dcn destination image channels (3 or 4)305@param swapBlue if set to true B and R channels will be swapped (BGR->RGB or RGB->BGR)306Convert between BGR, BGRA, RGB and RGBA image formats.307*/308inline int hal_ni_cvtBGRtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, int dcn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }309310/**311@brief hal_cvtBGRtoBGR5x5312@param src_data,src_step source image data and step313@param dst_data,dst_step destination image data and step314@param width,height image size315@param scn source image channels (3 or 4)316@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)317@param greenBits number of bits for green channel (5 or 6)318Convert from BGR, BGRA, RGB and RGBA to packed BGR or RGB (16 bits per pixel, 555 or 565).319Support only CV_8U images (input 3 or 4 channels, output 2 channels).320*/321inline int hal_ni_cvtBGRtoBGR5x5(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int scn, bool swapBlue, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }322323/**324@brief hal_cvtBGR5x5toBGR325@param src_data,src_step source image data and step326@param dst_data,dst_step destination image data and step327@param width,height image size328@param dcn destination image channels (3 or 4)329@param swapBlue if set to true B and R destination channels will be swapped (write RGB)330@param greenBits number of bits for green channel (5 or 6)331Convert from packed BGR or RGB (16 bits per pixel, 555 or 565) to BGR, BGRA, RGB and RGBA.332Support only CV_8U images (input 2 channels, output 3 or 4 channels).333*/334inline int hal_ni_cvtBGR5x5toBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int dcn, bool swapBlue, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }335336/**337@brief hal_cvtBGRtoGray338@param src_data,src_step source image data and step339@param dst_data,dst_step destination image data and step340@param width,height image size341@param depth image depth (one of CV_8U, CV_16U or CV_32F)342@param scn source image channels (3 or 4)343@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)344Convert from BGR, BGRA, RGB or RGBA to 1-channel gray.345*/346inline int hal_ni_cvtBGRtoGray(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }347348/**349@brief hal_cvtGraytoBGR350@param src_data,src_step source image data and step351@param dst_data,dst_step destination image data and step352@param width,height image size353@param depth image depth (one of CV_8U, CV_16U or CV_32F)354@param dcn destination image channels (3 or 4)355Convert from 1-channel gray to BGR, RGB, RGBA or BGRA.356*/357inline int hal_ni_cvtGraytoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }358359/**360@brief hal_cvtBGR5x5toGray361@param src_data,src_step source image data and step362@param dst_data,dst_step destination image data and step363@param width,height image size364@param greenBits number of bits for green channel (5 or 6)365Convert from packed BGR (16 bits per pixel, 555 or 565) to 1-channel gray.366Support only CV_8U images.367*/368inline int hal_ni_cvtBGR5x5toGray(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }369370/**371@brief hal_cvtGraytoBGR5x5372@param src_data,src_step source image data and step373@param dst_data,dst_step destination image data and step374@param width,height image size375@param greenBits number of bits for green channel (5 or 6)376Convert from 1-channel gray to packed BGR (16 bits per pixel, 555 or 565).377Support only CV_8U images.378*/379inline int hal_ni_cvtGraytoBGR5x5(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int greenBits) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }380381/**382@brief hal_cvtBGRtoYUV383@param src_data,src_step source image data and step384@param dst_data,dst_step destination image data and step385@param width,height image size386@param depth image depth (one of CV_8U, CV_16U or CV_32F)387@param scn source image channels (3 or 4)388@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)389@param isCbCr if set to true write output in YCbCr format390Convert from BGR, RGB, BGRA or RGBA to YUV or YCbCr.391*/392inline int hal_ni_cvtBGRtoYUV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isCbCr) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }393394/**395@brief hal_cvtYUVtoBGR396@param src_data,src_step source image data and step397@param dst_data,dst_step destination image data and step398@param width,height image size399@param depth image depth (one of CV_8U, CV_16U or CV_32F)400@param dcn destination image channels (3 or 4)401@param swapBlue if set to true B and R destination channels will be swapped (write RGB)402@param isCbCr if set to true treat source as YCbCr403Convert from YUV or YCbCr to BGR, RGB, BGRA or RGBA.404*/405inline int hal_ni_cvtYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isCbCr) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }406407/**408@brief hal_cvtBGRtoXYZ409@param src_data,src_step source image data and step410@param dst_data,dst_step destination image data and step411@param width,height image size412@param depth image depth (one of CV_8U, CV_16U or CV_32F)413@param scn source image channels (3 or 4)414@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)415Convert from BGR, RGB, BGRA or RGBA to XYZ.416*/417inline int hal_ni_cvtBGRtoXYZ(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }418419/**420@brief hal_cvtXYZtoBGR421@param src_data,src_step source image data and step422@param dst_data,dst_step destination image data and step423@param width,height image size424@param depth image depth (one of CV_8U, CV_16U or CV_32F)425@param dcn destination image channels (3 or 4)426@param swapBlue if set to true B and R destination channels will be swapped (write RGB)427Convert from XYZ to BGR, RGB, BGRA or RGBA.428*/429inline int hal_ni_cvtXYZtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }430431/**432@brief hal_cvtBGRtoHSV433@param src_data,src_step source image data and step434@param dst_data,dst_step destination image data and step435@param width,height image size436@param depth image depth (one of CV_8U or CV_32F)437@param scn source image channels (3 or 4)438@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)439@param isFullRange if set to true write hue in range 0-255 (0-360 for float) otherwise in range 0-180440@param isHSV if set to true write HSV otherwise HSL441Convert from BGR, RGB, BGRA or RGBA to HSV or HSL.442*/443inline int hal_ni_cvtBGRtoHSV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isFullRange, bool isHSV) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }444445/**446@brief hal_cvtHSVtoBGR447@param src_data,src_step source image data and step448@param dst_data,dst_step destination image data and step449@param width,height image size450@param depth image depth (one of CV_8U or CV_32F)451@param dcn destination image channels (3 or 4)452@param swapBlue if set to true B and R destination channels will be swapped (write RGB)453@param isFullRange if set to true read hue in range 0-255 (0-360 for float) otherwise in range 0-180454@param isHSV if set to true treat source as HSV otherwise HSL455Convert from HSV or HSL to BGR, RGB, BGRA or RGBA.456*/457inline int hal_ni_cvtHSVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isFullRange, bool isHSV) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }458459/**460@brief hal_cvtBGRtoLab461@param src_data,src_step source image data and step462@param dst_data,dst_step destination image data and step463@param width,height image size464@param depth image depth (one of CV_8U or CV_32F)465@param scn source image channels (3 or 4)466@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)467@param isLab if set to true write Lab otherwise Luv468@param srgb if set to true use sRGB gamma correction469Convert from BGR, RGB, BGRA or RGBA to Lab or Luv.470*/471inline int hal_ni_cvtBGRtoLab(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int scn, bool swapBlue, bool isLab, bool srgb) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }472473/**474@brief hal_cvtLabtoBGR475@param src_data,src_step source image data and step476@param dst_data,dst_step destination image data and step477@param width,height image size478@param depth image depth (one of CV_8U or CV_32F)479@param dcn destination image channels (3 or 4)480@param swapBlue if set to true B and R destination channels will be swapped (write RGB)481@param isLab if set to true treat input as Lab otherwise Luv482@param srgb if set to true use sRGB gamma correction483Convert from Lab or Luv to BGR, RGB, BGRA or RGBA.484*/485inline int hal_ni_cvtLabtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int depth, int dcn, bool swapBlue, bool isLab, bool srgb) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }486487/**488@brief hal_cvtTwoPlaneYUVtoBGR489@param src_data,src_step source image data and step490@param dst_data,dst_step destination image data and step491@param dst_width,dst_height destination image size492@param dcn destination image channels (3 or 4)493@param swapBlue if set to true B and R destination channels will be swapped (write RGB)494@param uIdx U-channel index in the interleaved U/V plane (0 or 1)495Convert from YUV (YUV420sp (or NV12/NV21) - Y plane followed by interleaved U/V plane) to BGR, RGB, BGRA or RGBA.496Only for CV_8U.497*/498inline int hal_ni_cvtTwoPlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }499500/**501@brief hal_cvtThreePlaneYUVtoBGR502@param src_data,src_step source image data and step503@param dst_data,dst_step destination image data and step504@param dst_width,dst_height destination image size505@param dcn destination image channels (3 or 4)506@param swapBlue if set to true B and R destination channels will be swapped (write RGB)507@param uIdx U-channel plane index (0 or 1)508Convert from YUV (YUV420p (or YV12/YV21) - Y plane followed by U and V planes) to BGR, RGB, BGRA or RGBA.509Only for CV_8U.510*/511inline int hal_ni_cvtThreePlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int dst_width, int dst_height, int dcn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }512513/**514@brief hal_cvtBGRtoThreePlaneYUV515@param src_data,src_step source image data and step516@param dst_data,dst_step destination image data and step517@param width,height image size518@param scn source image channels (3 or 4)519@param swapBlue if set to true B and R source channels will be swapped (treat as RGB)520@param uIdx U-channel plane index (0 or 1)521Convert from BGR, RGB, BGRA or RGBA to YUV (YUV420p (or YV12/YV21) - Y plane followed by U and V planes).522Only for CV_8U.523*/524inline int hal_ni_cvtBGRtoThreePlaneYUV(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int scn, bool swapBlue, int uIdx) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }525526/**527@brief hal_cvtOnePlaneYUVtoBGR528@param src_data,src_step source image data and step529@param dst_data,dst_step destination image data and step530@param width,height image size531@param dcn destination image channels (3 or 4)532@param swapBlue if set to true B and R destination channels will be swapped (write RGB)533@param uIdx U-channel index (0 or 1)534@param ycn Y-channel index (0 or 1)535Convert from UYVY, YUY2 or YVYU to BGR, RGB, BGRA or RGBA.536Only for CV_8U.537*/538inline int hal_ni_cvtOnePlaneYUVtoBGR(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height, int dcn, bool swapBlue, int uIdx, int ycn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }539540541/**542@brief hal_cvtRGBAtoMultipliedRGBA543@param src_data,src_step source image data and step544@param dst_data,dst_step destination image data and step545@param width,height image size546Convert from BGRA or RGBA to format with multiplied alpha channel.547Only for CV_8U.548*/549inline int hal_ni_cvtRGBAtoMultipliedRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }550551/**552@brief hal_cvtMultipliedRGBAtoRGBA553@param src_data,src_step source image data and step554@param dst_data,dst_step destination image data and step555@param width,height image size556Convert from format with multiplied alpha channel to BGRA or RGBA.557Only for CV_8U.558*/559inline int hal_ni_cvtMultipliedRGBAtoRGBA(const uchar * src_data, size_t src_step, uchar * dst_data, size_t dst_step, int width, int height) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }560561//! @cond IGNORED562#define cv_hal_cvtBGRtoBGR hal_ni_cvtBGRtoBGR563#define cv_hal_cvtBGRtoBGR5x5 hal_ni_cvtBGRtoBGR5x5564#define cv_hal_cvtBGR5x5toBGR hal_ni_cvtBGR5x5toBGR565#define cv_hal_cvtBGRtoGray hal_ni_cvtBGRtoGray566#define cv_hal_cvtGraytoBGR hal_ni_cvtGraytoBGR567#define cv_hal_cvtBGR5x5toGray hal_ni_cvtBGR5x5toGray568#define cv_hal_cvtGraytoBGR5x5 hal_ni_cvtGraytoBGR5x5569#define cv_hal_cvtBGRtoYUV hal_ni_cvtBGRtoYUV570#define cv_hal_cvtYUVtoBGR hal_ni_cvtYUVtoBGR571#define cv_hal_cvtBGRtoXYZ hal_ni_cvtBGRtoXYZ572#define cv_hal_cvtXYZtoBGR hal_ni_cvtXYZtoBGR573#define cv_hal_cvtBGRtoHSV hal_ni_cvtBGRtoHSV574#define cv_hal_cvtHSVtoBGR hal_ni_cvtHSVtoBGR575#define cv_hal_cvtBGRtoLab hal_ni_cvtBGRtoLab576#define cv_hal_cvtLabtoBGR hal_ni_cvtLabtoBGR577#define cv_hal_cvtTwoPlaneYUVtoBGR hal_ni_cvtTwoPlaneYUVtoBGR578#define cv_hal_cvtThreePlaneYUVtoBGR hal_ni_cvtThreePlaneYUVtoBGR579#define cv_hal_cvtBGRtoThreePlaneYUV hal_ni_cvtBGRtoThreePlaneYUV580#define cv_hal_cvtOnePlaneYUVtoBGR hal_ni_cvtOnePlaneYUVtoBGR581#define cv_hal_cvtRGBAtoMultipliedRGBA hal_ni_cvtRGBAtoMultipliedRGBA582#define cv_hal_cvtMultipliedRGBAtoRGBA hal_ni_cvtMultipliedRGBAtoRGBA583//! @endcond584585/**586@brief Calculate integral image587@param depth,sdepth,sqdepth Depths of source image, sum image and square sum image588@param src_data,src_step Source image589@param sum_data,sum_step Sum image590@param sqsum_data,sqsum_step Square sum image591@param tilted_data,tilted_step Tilted sum image592@param width,height Source image dimensions593@param cn Number of channels594@note Following combinations of image depths are used:595Source | Sum | Square sum596-------|-----|-----------597CV_8U | CV_32S | CV_64F598CV_8U | CV_32S | CV_32F599CV_8U | CV_32S | CV_32S600CV_8U | CV_32F | CV_64F601CV_8U | CV_32F | CV_32F602CV_8U | CV_64F | CV_64F603CV_16U | CV_64F | CV_64F604CV_16S | CV_64F | CV_64F605CV_32F | CV_32F | CV_64F606CV_32F | CV_32F | CV_32F607CV_32F | CV_64F | CV_64F608CV_64F | CV_64F | CV_64F609@sa cv::integral610*/611inline int hal_ni_integral(int depth, int sdepth, int sqdepth, const uchar * src_data, size_t src_step, uchar * sum_data, size_t sum_step, uchar * sqsum_data, size_t sqsum_step, uchar * tilted_data, size_t tilted_step, int width, int height, int cn) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }612613//! @cond IGNORED614#define cv_hal_integral hal_ni_integral615//! @endcond616617/**618@brief Calculate medianBlur filter619@param src_data,src_step Source image620@param dst_data,dst_step Destination image621@param width,height Source image dimensions622@param depth Depths of source and destination image623@param cn Number of channels624@param ksize Size of kernel625*/626inline int hal_ni_medianBlur(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int depth, int cn, int ksize) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }627628//! @cond IGNORED629#define cv_hal_medianBlur hal_ni_medianBlur630//! @endcond631632/**633@brief Calculates adaptive threshold634@param src_data,src_step Source image635@param dst_data,dst_step Destination image636@param width,height Source image dimensions637@param maxValue Value assigned to the pixels for which the condition is satisfied638@param adaptiveMethod Adaptive thresholding algorithm639@param thresholdType Thresholding type640@param blockSize Size of a pixel neighborhood that is used to calculate a threshold value641@param C Constant subtracted from the mean or weighted mean642*/643inline int hal_ni_adaptiveThreshold(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, double maxValue, int adaptiveMethod, int thresholdType, int blockSize, double C) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }644645//! @cond IGNORED646#define cv_hal_adaptiveThreshold hal_ni_adaptiveThreshold647//! @endcond648649/**650@brief Calculates fixed-level threshold to each array element651@param src_data,src_step Source image652@param dst_data,dst_step Destination image653@param width,height Source image dimensions654@param depth Depths of source and destination image655@param cn Number of channels656@param thresh Threshold value657@param maxValue Value assigned to the pixels for which the condition is satisfied658@param thresholdType Thresholding type659*/660inline int hal_ni_threshold(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int depth, int cn, double thresh, double maxValue, int thresholdType) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }661662//! @cond IGNORED663#define cv_hal_threshold hal_ni_threshold664//! @endcond665666/**667@brief Calculate box filter668@param src_data,src_step Source image669@param dst_data,dst_step Destination image670@param width,height Source image dimensions671@param src_depth,dst_depth Depths of source and destination image672@param cn Number of channels673@param margin_left,margin_top,margin_right,margin_bottom Margins for source image674@param ksize_width,ksize_height Size of kernel675@param anchor_x,anchor_y Anchor point676@param normalize If true then result is normalized677@param border_type Border type678*/679inline int hal_ni_boxFilter(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int src_depth, int dst_depth, int cn, int margin_left, int margin_top, int margin_right, int margin_bottom, size_t ksize_width, size_t ksize_height, int anchor_x, int anchor_y, bool normalize, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }680681//! @cond IGNORED682#define cv_hal_boxFilter hal_ni_boxFilter683//! @endcond684685/**686@brief Blurs an image using a Gaussian filter.687@param src_data,src_step Source image688@param dst_data,dst_step Destination image689@param width,height Source image dimensions690@param depth Depth of source and destination image691@param cn Number of channels692@param margin_left,margin_top,margin_right,margin_bottom Margins for source image693@param ksize_width,ksize_height Size of kernel694@param sigmaX,sigmaY Gaussian kernel standard deviation.695@param border_type Border type696*/697inline int hal_ni_gaussianBlur(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int depth, int cn, size_t margin_left, size_t margin_top, size_t margin_right, size_t margin_bottom, size_t ksize_width, size_t ksize_height, double sigmaX, double sigmaY, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }698699//! @cond IGNORED700#define cv_hal_gaussianBlur hal_ni_gaussianBlur701//! @endcond702703/**704@brief Computes Sobel derivatives705@param src_depth,dst_depth Depths of source and destination image706@param src_data,src_step Source image707@param dst_data,dst_step Destination image708@param width,height Source image dimensions709@param cn Number of channels710@param margin_left,margin_top,margin_right,margin_bottom Margins for source image711@param dx,dy orders of the derivative x and y respectively712@param ksize Size of kernel713@param scale Scale factor for the computed derivative values714@param delta Delta value that is added to the results prior to storing them in dst715@param border_type Border type716*/717inline int hal_ni_sobel(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int src_depth, int dst_depth, int cn, int margin_left, int margin_top, int margin_right, int margin_bottom, int dx, int dy, int ksize, double scale, double delta, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }718719//! @cond IGNORED720#define cv_hal_sobel hal_ni_sobel721//! @endcond722723/**724@brief Computes Scharr filter725@param src_depth,dst_depth Depths of source and destination image726@param src_data,src_step Source image727@param dst_data,dst_step Destination image728@param width,height Source image dimensions729@param cn Number of channels730@param margin_left,margin_top,margin_right,margin_bottom Margins for source image731@param dx,dy orders of the derivative x and y respectively732@param scale Scale factor for the computed derivative values733@param delta Delta value that is added to the results prior to storing them in dst734@param border_type Border type735*/736inline int hal_ni_scharr(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int src_depth, int dst_depth, int cn, int margin_left, int margin_top, int margin_right, int margin_bottom, int dx, int dy, double scale, double delta, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }737738//! @cond IGNORED739#define cv_hal_scharr hal_ni_scharr740//! @endcond741742/**743@brief Perform Gaussian Blur and downsampling for input tile.744@param depth Depths of source and destination image745@param src_data,src_step Source image746@param dst_data,dst_step Destination image747@param src_width,src_height Source image dimensions748@param dst_width,dst_height Destination image dimensions749@param cn Number of channels750@param border_type Border type751*/752inline int hal_ni_pyrdown(const uchar* src_data, size_t src_step, int src_width, int src_height, uchar* dst_data, size_t dst_step, int dst_width, int dst_height, int depth, int cn, int border_type) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }753754//! @cond IGNORED755#define cv_hal_pyrdown hal_ni_pyrdown756//! @endcond757758/**759@brief Canny edge detector760@param src_data,src_step Source image761@param dst_data,dst_step Destination image762@param width,height Source image dimensions763@param cn Number of channels764@param lowThreshold, highThreshold Thresholds value765@param ksize Kernel size for Sobel operator.766@param L2gradient Flag, indicating use L2 or L1 norma.767*/768inline int hal_ni_canny(const uchar* src_data, size_t src_step, uchar* dst_data, size_t dst_step, int width, int height, int cn, double lowThreshold, double highThreshold, int ksize, bool L2gradient) { return CV_HAL_ERROR_NOT_IMPLEMENTED; }769770//! @cond IGNORED771#define cv_hal_canny hal_ni_canny772//! @endcond773774//! @}775776#if defined __GNUC__777# pragma GCC diagnostic pop778#elif defined _MSC_VER779# pragma warning( pop )780#endif781782#include "custom_hal.hpp"783784//! @cond IGNORED785#define CALL_HAL_RET(name, fun, retval, ...) \786int res = __CV_EXPAND(fun(__VA_ARGS__, &retval)); \787if (res == CV_HAL_ERROR_OK) \788return retval; \789else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \790CV_Error_(cv::Error::StsInternal, \791("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res));792793794#define CALL_HAL(name, fun, ...) \795int res = __CV_EXPAND(fun(__VA_ARGS__)); \796if (res == CV_HAL_ERROR_OK) \797return; \798else if (res != CV_HAL_ERROR_NOT_IMPLEMENTED) \799CV_Error_(cv::Error::StsInternal, \800("HAL implementation " CVAUX_STR(name) " ==> " CVAUX_STR(fun) " returned %d (0x%08x)", res, res));801//! @endcond802803#endif804805806