⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 eb_pfwimage.h

📁 这是法国Kaleido公司提供了一个手机mmi设计平台
💻 H
字号:
/***************************************************************************
EB_PFWImage.h  -  
-------------------
begin                : Tue Mar 3 2004
copyright            : (C) 2004 by DigitalAirways
email                : info@digitalairways.com
***************************************************************************/

/*
* Copyright (c) 2000-2004 DigitalAirways, sarl. All Rights Reserved.
*
* This software is the confidential and proprietary information of
* DigitalAirways, sarl. ("Confidential Information").  You shall not
* disclose such Confidential Information and shall use it only in
* accordance with the terms of the license agreement you entered into
* with DigitalAirways.
* A copy of this license is included in the licence.txt file included
* in this software package.
*/

/*
**************************************************************
* TODO
**************************************************************

- 


**************************************************************
* HISTORY
**************************************************************

- 2004/05/10 : when POOLED_IMAGES is defined the images are kept in a pool
with a reference counter. The maximum number of references is defined by
the value of POOLED_IMAGES.
When the POOL is full-up, it's not used for additional images.

*/

#ifndef __EB_PFWIMAGE__
#define __EB_PFWIMAGE__


#include "EB_Graphics.h"

class KREBDLIBS_API PFWImage {

private:

	Graphics* fGraphics ;
	GContext* gContext ;

protected:

	/*
	* ctor should not be used by external callers to allow some cache to be managed here.
	*/
	PFWImage(GContext* newGContext, unsigned char* src=0) ;

	/*
	* This is used to create a new blank Image
	*/
	PFWImage(GContext* newGContext, int w, int h) ;

public:			

	DEFINE_NEW(PFWImage);
	DEFINE_DELETE(PFWImage);

	/*
	* dtor is not public to allow some cache to be managed here.
	*/
	virtual ~PFWImage() ;

public:

	GContext* getContext() { return gContext; }

	/*
	* ctor is not public to allow some cache to be managed here.
	*/
	static PFWImage* getImage(GContext* gContext, unsigned char* src);

	/*
	* dtor is not public to allow a pool to be used here.
	* nocache may be set to true when the caller is certain that the PFWImage
	* is not in a local pool.
	*/
	static void freeImage(GContext* gContext, PFWImage* img, int nopool=0);

	/*
	* This is used to create a new blank Image
	*/
	static PFWImage* createImage(GContext* newGContext, int w, int h)
	{
		return XNEW(PFWImage) (newGContext, w, h);
	}


	/*
	* This is used to create an Image from a Graphics
	*/
	PFWImage(Graphics* g) ;
	/*
	*
	*/
	virtual void paintImage(Graphics* g, long x, long y);
	/*
	* Change the current fGraphics. It returns the previous one.
	*/
	Graphics* setGraphics(Graphics* newGraphics);
	/*
	*
	*/
	void paintExtract(Graphics* g, int xT, int yT, int xF, int yF, int w, int h) ;

	Graphics* getGraphics() { return fGraphics ;}

	//	@return the height of this image.
	virtual int getHeight() { if(!fGraphics) return 0; return fGraphics->getHeight(); }

	//	@return the width of this image.
	virtual int getWidth() { if(!fGraphics) return 0; return fGraphics->getWidth(); }

	PFWImage* duplicate() ;
	PFWImage* reduce(int dstWidth, int dstHeight, PFWImage* target=0);
	PFWImage* enlarge(int dstWidth, int dstHeight, PFWImage* target=0);
	PFWImage* extract(int x, int y, int w, int h, PFWImage* target=0);
	PFWImage* vflip(PFWImage* target=0);
	PFWImage* hflip(PFWImage* target=0);

} ;

#endif // ndef __EB_PFWIMAGE__

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -