Click here to Skip to main content
12,998,654 members (130,007 online)
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads

Stats

96.7K views
7.8K downloads
107 bookmarked
Posted 19 Jul 2010

Pixel Shader for Edge Detection and Cartoon Effect

, 19 Aug 2010
Implementation of Sobel Edge Detection and Cartoon Effect using pixel shader.
#pragma once


struct ImageInfo_t
{
    ImageInfo_t()
    {
        nRows = nCols = 0;
        pData = 0;
    }
    ~ImageInfo_t()
    {
        if( pData )
        {
            delete[] pData;
            pData = 0;
        }
    }
    int nRows; int nCols; unsigned char* pData;
} ;

class EdgeDetectCPU
{
public:
    EdgeDetectCPU(void);
    ~EdgeDetectCPU(void);
    void SetCartoonEffect( const bool bCartoonEffect_i )
    {
        m_bCartoonEffect = bCartoonEffect_i;
    }
    void EdgeDetect( int nWidth, int nHeight, BYTE* pbyBMP_io );

private:

    void FindEdge( ImageInfo_t& stOriginalImage_i, ImageInfo_t& stEdgeImage_o );

    bool m_bCartoonEffect;
};

By viewing downloads associated with this article you agree to the Terms of Service and the article's licence.

If a file you wish to view isn't highlighted, and is a text file (not binary), please let us know and we'll add colourisation support for it.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

Share

About the Author

Santhosh G_
India India
No Biography provided

You may also be interested in...

Pro
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170622.1 | Last Updated 19 Aug 2010
Article Copyright 2010 by Santhosh G_
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid