//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
#[cfg(feature = "objc2-core-graphics")]
use objc2_core_graphics::*;
use objc2_foundation::*;

use crate::*;

/// [Apple's documentation](https://developer.apple.com/documentation/coreimage/cikernelroicallback?language=objc)
#[cfg(all(feature = "block2", feature = "objc2-core-foundation"))]
pub type CIKernelROICallback = *mut block2::DynBlock<dyn Fn(c_int, CGRect) -> CGRect>;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/cikernel?language=objc)
    #[unsafe(super(NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIKernel;
);

unsafe impl Send for CIKernel {}

unsafe impl Sync for CIKernel {}

extern_conformance!(
    unsafe impl NSObjectProtocol for CIKernel {}
);

impl CIKernel {
    extern_methods!(
        #[deprecated = "Core Image Kernel Language API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
        #[unsafe(method(kernelsWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelsWithString(string: &NSString) -> Option<Retained<NSArray<CIKernel>>>;

        #[unsafe(method(kernelsWithMetalString:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelsWithMetalString_error(
            source: &NSString,
        ) -> Result<Retained<NSArray<CIKernel>>, Retained<NSError>>;

        #[deprecated = "Core Image Kernel Language API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
        #[unsafe(method(kernelWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithString(string: &NSString) -> Option<Retained<Self>>;

        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_error(
            name: &NSString,
            data: &NSData,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(feature = "CIImage")]
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:outputPixelFormat:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_outputPixelFormat_error(
            name: &NSString,
            data: &NSData,
            format: CIFormat,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[unsafe(method(kernelNamesFromMetalLibraryData:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelNamesFromMetalLibraryData(data: &NSData)
            -> Retained<NSArray<NSString>>;

        #[unsafe(method(name))]
        #[unsafe(method_family = none)]
        pub unsafe fn name(&self) -> Retained<NSString>;

        /// # Safety
        ///
        /// `method` must be a valid selector.
        #[unsafe(method(setROISelector:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setROISelector(&self, method: Sel);

        #[cfg(all(
            feature = "CIImage",
            feature = "block2",
            feature = "objc2-core-foundation"
        ))]
        /// # Safety
        ///
        /// - `callback` must be a valid pointer.
        /// - `args` generic should be of the correct type.
        #[unsafe(method(applyWithExtent:roiCallback:arguments:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyWithExtent_roiCallback_arguments(
            &self,
            extent: CGRect,
            callback: CIKernelROICallback,
            args: &NSArray<AnyObject>,
        ) -> Option<Retained<CIImage>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CIKernel {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/cicolorkernel?language=objc)
    #[unsafe(super(CIKernel, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIColorKernel;
);

unsafe impl Send for CIColorKernel {}

unsafe impl Sync for CIColorKernel {}

extern_conformance!(
    unsafe impl NSObjectProtocol for CIColorKernel {}
);

impl CIColorKernel {
    extern_methods!(
        #[deprecated = "Core Image Kernel Language API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
        #[unsafe(method(kernelWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithString(string: &NSString) -> Option<Retained<Self>>;

        #[cfg(all(feature = "CIImage", feature = "objc2-core-foundation"))]
        /// # Safety
        ///
        /// `args` generic should be of the correct type.
        #[unsafe(method(applyWithExtent:arguments:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyWithExtent_arguments(
            &self,
            extent: CGRect,
            args: &NSArray<AnyObject>,
        ) -> Option<Retained<CIImage>>;
    );
}

/// Methods declared on superclass `CIKernel`.
impl CIColorKernel {
    extern_methods!(
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_error(
            name: &NSString,
            data: &NSData,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(feature = "CIImage")]
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:outputPixelFormat:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_outputPixelFormat_error(
            name: &NSString,
            data: &NSData,
            format: CIFormat,
        ) -> Result<Retained<Self>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CIColorKernel {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciwarpkernel?language=objc)
    #[unsafe(super(CIKernel, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIWarpKernel;
);

unsafe impl Send for CIWarpKernel {}

unsafe impl Sync for CIWarpKernel {}

extern_conformance!(
    unsafe impl NSObjectProtocol for CIWarpKernel {}
);

impl CIWarpKernel {
    extern_methods!(
        #[deprecated = "Core Image Kernel Language API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
        #[unsafe(method(kernelWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithString(string: &NSString) -> Option<Retained<Self>>;

        #[cfg(all(
            feature = "CIImage",
            feature = "block2",
            feature = "objc2-core-foundation"
        ))]
        /// # Safety
        ///
        /// - `callback` must be a valid pointer.
        /// - `args` generic should be of the correct type.
        #[unsafe(method(applyWithExtent:roiCallback:inputImage:arguments:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyWithExtent_roiCallback_inputImage_arguments(
            &self,
            extent: CGRect,
            callback: CIKernelROICallback,
            image: &CIImage,
            args: &NSArray<AnyObject>,
        ) -> Option<Retained<CIImage>>;
    );
}

/// Methods declared on superclass `CIKernel`.
impl CIWarpKernel {
    extern_methods!(
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_error(
            name: &NSString,
            data: &NSData,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(feature = "CIImage")]
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:outputPixelFormat:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_outputPixelFormat_error(
            name: &NSString,
            data: &NSData,
            format: CIFormat,
        ) -> Result<Retained<Self>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CIWarpKernel {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/coreimage/ciblendkernel?language=objc)
    #[unsafe(super(CIColorKernel, CIKernel, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct CIBlendKernel;
);

unsafe impl Send for CIBlendKernel {}

unsafe impl Sync for CIBlendKernel {}

extern_conformance!(
    unsafe impl NSObjectProtocol for CIBlendKernel {}
);

impl CIBlendKernel {
    extern_methods!(
        #[deprecated = "Core Image Kernel Language API deprecated. (Define CI_SILENCE_GL_DEPRECATION to silence these warnings)"]
        #[unsafe(method(kernelWithString:))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithString(string: &NSString) -> Option<Retained<Self>>;

        #[cfg(feature = "CIImage")]
        #[unsafe(method(applyWithForeground:background:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyWithForeground_background(
            &self,
            foreground: &CIImage,
            background: &CIImage,
        ) -> Option<Retained<CIImage>>;

        #[cfg(all(feature = "CIImage", feature = "objc2-core-graphics"))]
        #[unsafe(method(applyWithForeground:background:colorSpace:))]
        #[unsafe(method_family = none)]
        pub unsafe fn applyWithForeground_background_colorSpace(
            &self,
            foreground: &CIImage,
            background: &CIImage,
            color_space: &CGColorSpace,
        ) -> Option<Retained<CIImage>>;
    );
}

/// Methods declared on superclass `CIKernel`.
impl CIBlendKernel {
    extern_methods!(
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_error(
            name: &NSString,
            data: &NSData,
        ) -> Result<Retained<Self>, Retained<NSError>>;

        #[cfg(feature = "CIImage")]
        #[unsafe(method(kernelWithFunctionName:fromMetalLibraryData:outputPixelFormat:error:_))]
        #[unsafe(method_family = none)]
        pub unsafe fn kernelWithFunctionName_fromMetalLibraryData_outputPixelFormat_error(
            name: &NSString,
            data: &NSData,
            format: CIFormat,
        ) -> Result<Retained<Self>, Retained<NSError>>;
    );
}

/// Methods declared on superclass `NSObject`.
impl CIBlendKernel {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new() -> Retained<Self>;
    );
}

/// BuiltIn.
impl CIBlendKernel {
    extern_methods!(
        #[unsafe(method(componentAdd))]
        #[unsafe(method_family = none)]
        pub unsafe fn componentAdd() -> Retained<CIBlendKernel>;

        #[unsafe(method(componentMultiply))]
        #[unsafe(method_family = none)]
        pub unsafe fn componentMultiply() -> Retained<CIBlendKernel>;

        #[unsafe(method(componentMin))]
        #[unsafe(method_family = none)]
        pub unsafe fn componentMin() -> Retained<CIBlendKernel>;

        #[unsafe(method(componentMax))]
        #[unsafe(method_family = none)]
        pub unsafe fn componentMax() -> Retained<CIBlendKernel>;

        #[unsafe(method(clear))]
        #[unsafe(method_family = none)]
        pub unsafe fn clear() -> Retained<CIBlendKernel>;

        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source() -> Retained<CIBlendKernel>;

        #[unsafe(method(destination))]
        #[unsafe(method_family = none)]
        pub unsafe fn destination() -> Retained<CIBlendKernel>;

        #[unsafe(method(sourceOver))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceOver() -> Retained<CIBlendKernel>;

        #[unsafe(method(destinationOver))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationOver() -> Retained<CIBlendKernel>;

        #[unsafe(method(sourceIn))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceIn() -> Retained<CIBlendKernel>;

        #[unsafe(method(destinationIn))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationIn() -> Retained<CIBlendKernel>;

        #[unsafe(method(sourceOut))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceOut() -> Retained<CIBlendKernel>;

        #[unsafe(method(destinationOut))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationOut() -> Retained<CIBlendKernel>;

        #[unsafe(method(sourceAtop))]
        #[unsafe(method_family = none)]
        pub unsafe fn sourceAtop() -> Retained<CIBlendKernel>;

        #[unsafe(method(destinationAtop))]
        #[unsafe(method_family = none)]
        pub unsafe fn destinationAtop() -> Retained<CIBlendKernel>;

        #[unsafe(method(exclusiveOr))]
        #[unsafe(method_family = none)]
        pub unsafe fn exclusiveOr() -> Retained<CIBlendKernel>;

        #[unsafe(method(multiply))]
        #[unsafe(method_family = none)]
        pub unsafe fn multiply() -> Retained<CIBlendKernel>;

        #[unsafe(method(screen))]
        #[unsafe(method_family = none)]
        pub unsafe fn screen() -> Retained<CIBlendKernel>;

        #[unsafe(method(overlay))]
        #[unsafe(method_family = none)]
        pub unsafe fn overlay() -> Retained<CIBlendKernel>;

        #[unsafe(method(darken))]
        #[unsafe(method_family = none)]
        pub unsafe fn darken() -> Retained<CIBlendKernel>;

        #[unsafe(method(lighten))]
        #[unsafe(method_family = none)]
        pub unsafe fn lighten() -> Retained<CIBlendKernel>;

        #[unsafe(method(colorDodge))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorDodge() -> Retained<CIBlendKernel>;

        #[unsafe(method(colorBurn))]
        #[unsafe(method_family = none)]
        pub unsafe fn colorBurn() -> Retained<CIBlendKernel>;

        #[unsafe(method(hardLight))]
        #[unsafe(method_family = none)]
        pub unsafe fn hardLight() -> Retained<CIBlendKernel>;

        #[unsafe(method(softLight))]
        #[unsafe(method_family = none)]
        pub unsafe fn softLight() -> Retained<CIBlendKernel>;

        #[unsafe(method(difference))]
        #[unsafe(method_family = none)]
        pub unsafe fn difference() -> Retained<CIBlendKernel>;

        #[unsafe(method(exclusion))]
        #[unsafe(method_family = none)]
        pub unsafe fn exclusion() -> Retained<CIBlendKernel>;

        #[unsafe(method(hue))]
        #[unsafe(method_family = none)]
        pub unsafe fn hue() -> Retained<CIBlendKernel>;

        #[unsafe(method(saturation))]
        #[unsafe(method_family = none)]
        pub unsafe fn saturation() -> Retained<CIBlendKernel>;

        #[unsafe(method(color))]
        #[unsafe(method_family = none)]
        pub unsafe fn color() -> Retained<CIBlendKernel>;

        #[unsafe(method(luminosity))]
        #[unsafe(method_family = none)]
        pub unsafe fn luminosity() -> Retained<CIBlendKernel>;

        #[unsafe(method(subtract))]
        #[unsafe(method_family = none)]
        pub unsafe fn subtract() -> Retained<CIBlendKernel>;

        #[unsafe(method(divide))]
        #[unsafe(method_family = none)]
        pub unsafe fn divide() -> Retained<CIBlendKernel>;

        #[unsafe(method(linearBurn))]
        #[unsafe(method_family = none)]
        pub unsafe fn linearBurn() -> Retained<CIBlendKernel>;

        #[unsafe(method(linearDodge))]
        #[unsafe(method_family = none)]
        pub unsafe fn linearDodge() -> Retained<CIBlendKernel>;

        #[unsafe(method(vividLight))]
        #[unsafe(method_family = none)]
        pub unsafe fn vividLight() -> Retained<CIBlendKernel>;

        #[unsafe(method(linearLight))]
        #[unsafe(method_family = none)]
        pub unsafe fn linearLight() -> Retained<CIBlendKernel>;

        #[unsafe(method(pinLight))]
        #[unsafe(method_family = none)]
        pub unsafe fn pinLight() -> Retained<CIBlendKernel>;

        #[unsafe(method(hardMix))]
        #[unsafe(method_family = none)]
        pub unsafe fn hardMix() -> Retained<CIBlendKernel>;

        #[unsafe(method(darkerColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn darkerColor() -> Retained<CIBlendKernel>;

        #[unsafe(method(lighterColor))]
        #[unsafe(method_family = none)]
        pub unsafe fn lighterColor() -> Retained<CIBlendKernel>;
    );
}
