|
Krita Source Code Documentation
|
#include <kis_edge_detection_kernel.h>
Public Types | |
| enum | FilterOutput { pythagorean , xGrowth , xFall , yGrowth , yFall , radian } |
| enum | FilterType { Simple , Prewitt , SobelVector } |
Public Member Functions | |
| KisEdgeDetectionKernel () | |
Static Public Member Functions | |
| static void | applyEdgeDetection (KisPaintDeviceSP device, const QRect &rect, qreal xRadius, qreal yRadius, FilterType type, const QBitArray &channelFlags, KoUpdater *progressUpdater, FilterOutput output=pythagorean, bool writeToAlpha=false) |
| applyEdgeDetection This applies the edge detection filter to the device. | |
| static void | convertToNormalMap (KisPaintDeviceSP device, const QRect &rect, qreal xRadius, qreal yRadius, FilterType type, int channelToConvert, QVector< int > channelOrder, QVector< bool > channelFlip, const QBitArray &channelFlags, KoUpdater *progressUpdater, boost::optional< bool > useFftw=boost::none) |
| convertToNormalMap Convert a channel of the device to a normal map. The channel will be interpreted as a heightmap. | |
| static KisConvolutionKernelSP | createHorizontalKernel (qreal radius, FilterType type, bool denormalize=true, bool reverse=false) |
| static Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > | createHorizontalMatrix (qreal radius, FilterType type, bool reverse=false) |
| createHorizontalMatrix | |
| static KisConvolutionKernelSP | createVerticalKernel (qreal radius, FilterType type, bool denormalize=true, bool reverse=false) |
| static Eigen::Matrix< qreal, Eigen::Dynamic, Eigen::Dynamic > | createVerticalMatrix (qreal radius, FilterType type, bool reverse=false) |
| createVerticalMatrix | |
| static int | kernelSizeFromRadius (qreal radius) |
| static qreal | sigmaFromRadius (qreal radius) |
Definition at line 18 of file kis_edge_detection_kernel.h.
| Enumerator | |
|---|---|
| pythagorean | |
| xGrowth | |
| xFall | |
| yGrowth | |
| yFall | |
| radian | |
Definition at line 29 of file kis_edge_detection_kernel.h.
| Enumerator | |
|---|---|
| Simple | |
| Prewitt | |
| SobelVector | |
Definition at line 23 of file kis_edge_detection_kernel.h.
| KisEdgeDetectionKernel::KisEdgeDetectionKernel | ( | ) |
Definition at line 17 of file kis_edge_detection_kernel.cpp.
|
static |
applyEdgeDetection This applies the edge detection filter to the device.
| device | the device to apply to. |
| rect | the affected rect. |
| xRadius | the radius of the horizontal sampling, radius of 0 is effectively disabling it. |
| yRadius | the radius of the vertical sampling, radius of 0 is effectively disabling it. |
| type | the type can be prewitt, sobel or simple, each of which have a different sampling for the eventual edge detection. |
| channelFlags | the affected channels. |
| progressUpdater | the progress updater if it exists. |
| output | the output mode. |
| writeToAlpha | whether or not to have the result applied to the transparency than the color channels, this is useful for fringe effects. |
Definition at line 182 of file kis_edge_detection_kernel.cpp.
References KoColorSpace::alphaPos(), KisConvolutionPainter::applyMatrix(), BORDER_REPEAT, KoColorSpace::channelCount(), KoColorSpace::colorChannelCount(), KisPaintDevice::colorSpace(), createHorizontalKernel(), createVerticalKernel(), KoColor::data(), KoColorSpace::fromNormalisedChannelsValue(), KIS_SAFE_ASSERT_RECOVER_RETURN, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nConseqPixels(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixels(), KoColorSpace::normalisedChannelsValue(), KoColor::opacityF(), KoColorSpace::pixelSize(), KisPaintDevice::prepareClone(), pythagorean, radian, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisPainter::setChannelFlags(), KoColorSpace::setOpacity(), KoColor::setOpacity(), KisPainter::setProgress(), xFall, xGrowth, and yGrowth.
|
static |
convertToNormalMap Convert a channel of the device to a normal map. The channel will be interpreted as a heightmap.
| device | the device |
| rect | the rectangle to apply this to. |
| xRadius | the xradius |
| yRadius | the yradius |
| type | the edge detection filter. |
| channelToConvert | the channel to use as a grayscale. |
| channelOrder | the order in which the xyz coordinates ought to be written to the pixels. |
| channelFlip | whether to flip the channels |
| channelFlags | the channel flags |
| progressUpdater |
Definition at line 329 of file kis_edge_detection_kernel.cpp.
References KoColorSpace::alphaPos(), KisConvolutionPainter::applyMatrix(), BORDER_REPEAT, KoColorSpace::channelCount(), KoColorSpace::channels, KisPaintDevice::colorSpace(), createHorizontalKernel(), createVerticalKernel(), KisConvolutionPainter::FFTW, KoColorSpace::fromNormalisedChannelsValue(), KIS_ASSERT_RECOVER_RETURN, KIS_SAFE_ASSERT_RECOVER_RETURN, KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::nextPixel(), KoColorSpace::normalisedChannelsValue(), KoColorSpace::pixelSize(), KisPaintDevice::prepareClone(), KisSequentialIteratorBase< IteratorPolicy, SourcePolicy, ProgressPolicy >::rawData(), KisPainter::setChannelFlags(), KisConvolutionPainter::setEnginePreference(), KisPainter::setProgress(), and KisConvolutionPainter::SPATIAL.
|
static |
Definition at line 146 of file kis_edge_detection_kernel.cpp.
References createHorizontalMatrix(), and KisConvolutionKernel::fromMatrix().
|
static |
createHorizontalMatrix
| radius | the radius. 1 makes a 3x3 kernel. |
| type | One of the entries in the enum Filtertype |
| reverse | which direction the gradient goes. The horizontal gradient by default detects the rightmost edges. Reversed it selects the leftmost edges. |
Definition at line 28 of file kis_edge_detection_kernel.cpp.
References kernelSizeFromRadius(), KIS_ASSERT_RECOVER_NOOP, Prewitt, and Simple.
|
static |
Definition at line 159 of file kis_edge_detection_kernel.cpp.
References createVerticalMatrix(), and KisConvolutionKernel::fromMatrix().
|
static |
createVerticalMatrix
| radius | the radius. 1 makes a 3x3 kernel. |
| type | One of the entries in the enum Filtertype |
| reverse | which direction the gradient goes. The vertical gradient by default detects the topmost edges. Reversed it selects the bottommost edges. |
Definition at line 87 of file kis_edge_detection_kernel.cpp.
References kernelSizeFromRadius(), KIS_ASSERT_RECOVER_NOOP, Prewitt, and Simple.
|
static |
Definition at line 172 of file kis_edge_detection_kernel.cpp.
References sigmaFromRadius().
|
static |
Definition at line 177 of file kis_edge_detection_kernel.cpp.