Click here to Skip to main content
15,886,578 members
Articles / Desktop Programming / MFC

ImageStone - A Powerful C++ Class Library for Image Manipulation

Rate me:
Please Sign up or sign in to vote.
4.81/5 (250 votes)
6 Dec 2011Zlib3 min read 117.8K   51.5K   405  
An article on a library for image manipulation
/*
 *   Copyright (C) =USTC= Fu Li
 *
 *   Author   :  Fu Li
 *   Create   :  2004-2-21
 *   Home     :  http://www.crazy-bit.com/
 *   Mail     :  crazybitwps@hotmail.com
 *   History  :  
 */
#ifndef __FOO_INTERFACE_PIXEL_PROCESSOR__2004_02_21__H__
#define __FOO_INTERFACE_PIXEL_PROCESSOR__2004_02_21__H__
#include "../StdDefine.h"
class FCObjImage ; // external class

class FCInterface_PixelProcess ;

//=============================================================================
/**
 *  Pixel processor interface.
 */
class FCInterface_PixelProcess
{
public:
    virtual ~FCInterface_PixelProcess() {}

    /// How to process the image.
    enum PROCESS_TYPE
    {
        /// process whole image.
        PROCESS_TYPE_WHOLE,
        /// process every pixel step.
        PROCESS_TYPE_PIXEL,
    };

    /// Whether the image can be disposed by this processor.
    virtual bool ValidateColorBits (const FCObjImage* pImg) =0 ;

    /// Query process type, default to return PROCESS_TYPE_PIXEL.
    virtual PROCESS_TYPE QueryProcessType() {return PROCESS_TYPE_PIXEL;}

    /// Before process.
    virtual void OnEnterProcess (FCObjImage* pImg) {}
    /// Process (x,y) pixel when QueryProcessType return PROCESS_TYPE_PIXEL.
    virtual void ProcessPixel (FCObjImage* pImg, int x, int y, BYTE* pPixel) {}
    /// Process whole image when QueryProcessType return PROCESS_TYPE_WHOLE.
    virtual void ProcessWholeImage (FCObjImage* pImg, FCObjProgress* pProgress) {}
    /// After process.
    virtual void OnLeaveProcess (FCObjImage* pImg) {}
};

//=============================================================================
// inline Implement
//=============================================================================

#endif

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 zlib/libpng License


Written By
Team Leader PhoXo
China China
graduate from University of Science and Technology of China at 2002.

Now I work at www.phoxo.com.

Comments and Discussions