Click here to Skip to main content
12,406,795 members (60,957 online)
Click here to Skip to main content
Articles » Multimedia » OpenGL » General » Downloads

Stats

86.9K views
7.5K downloads
107 bookmarked
Posted

Pixel Shader for Edge Detection and Cartoon Effect

, 19 Aug 2010 CPOL
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...

| Advertise | Privacy | Terms of Use | Mobile
Web01 | 2.8.160730.1 | Last Updated 19 Aug 2010
Article Copyright 2010 by Santhosh G_
Everything else Copyright © CodeProject, 1999-2016
Layout: fixed | fluid