?? eb_pfwimage.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__
?? 快捷鍵說明
復(fù)制代碼
Ctrl + C
搜索代碼
Ctrl + F
全屏模式
F11
切換主題
Ctrl + Shift + D
顯示快捷鍵
?
增大字號
Ctrl + =
減小字號
Ctrl + -