/*
* File: ximage.h
* Purpose: General Purpose Image Class
*/
/*
--------------------------------------------------------------------------------
COPYRIGHT NOTICE, DISCLAIMER, and LICENSE:
CxImage version 6.0.0 02/Feb/2008
CxImage : Copyright (C) 2001 - 2008, Davide Pizzolato
Original CImage and CImageIterator implementation are:
Copyright (C) 1995, Alejandro Aguilar Sierra (asierra(at)servidor(dot)unam(dot)mx)
Covered code is provided under this license on an "as is" basis, without warranty
of any kind, either expressed or implied, including, without limitation, warranties
that the covered code is free of defects, merchantable, fit for a particular purpose
or non-infringing. The entire risk as to the quality and performance of the covered
code is with you. Should any covered code prove defective in any respect, you (not
the initial developer or any other contributor) assume the cost of any necessary
servicing, repair or correction. This disclaimer of warranty constitutes an essential
part of this license. No use of any covered code is authorized hereunder except under
this disclaimer.
Permission is hereby granted to use, copy, modify, and distribute this
source code, or portions hereof, for any purpose, including commercial applications,
freely and without fee, subject to the following restrictions:
1. The origin of this software must not be misrepresented; you must not
claim that you wrote the original software. If you use this software
in a product, an acknowledgment in the product documentation would be
appreciated but is not required.
2. Altered source versions must be plainly marked as such, and must not be
misrepresented as being the original software.
3. This notice may not be removed or altered from any source distribution.
--------------------------------------------------------------------------------
Other information about CxImage, and the latest version, can be found at the
CxImage home page: http://www.xdp.it/cximage/
--------------------------------------------------------------------------------
*/
#if !defined(__CXIMAGE_H)
#define __CXIMAGE_H
#if _MSC_VER > 1000
#pragma once
#endif
/////////////////////////////////////////////////////////////////////////////
#include "xfile.h"
#include "xiofile.h"
#include "xmemfile.h"
#include "ximadef.h" //<vho> adjust some #define
/* see "ximacfg.h" for CxImage configuration options */
/////////////////////////////////////////////////////////////////////////////
// CxImage formats enumerator
enum ENUM_CXIMAGE_FORMATS{
CXIMAGE_FORMAT_UNKNOWN = 0,
#if CXIMAGE_SUPPORT_BMP
CXIMAGE_FORMAT_BMP = 1,
#endif
#if CXIMAGE_SUPPORT_GIF
CXIMAGE_FORMAT_GIF = 2,
#endif
#if CXIMAGE_SUPPORT_JPG
CXIMAGE_FORMAT_JPG = 3,
#endif
#if CXIMAGE_SUPPORT_PNG
CXIMAGE_FORMAT_PNG = 4,
#endif
#if CXIMAGE_SUPPORT_ICO
CXIMAGE_FORMAT_ICO = 5,
#endif
#if CXIMAGE_SUPPORT_TIF
CXIMAGE_FORMAT_TIF = 6,
#endif
#if CXIMAGE_SUPPORT_TGA
CXIMAGE_FORMAT_TGA = 7,
#endif
#if CXIMAGE_SUPPORT_PCX
CXIMAGE_FORMAT_PCX = 8,
#endif
#if CXIMAGE_SUPPORT_WBMP
CXIMAGE_FORMAT_WBMP = 9,
#endif
#if CXIMAGE_SUPPORT_WMF
CXIMAGE_FORMAT_WMF = 10,
#endif
#if CXIMAGE_SUPPORT_JP2
CXIMAGE_FORMAT_JP2 = 11,
#endif
#if CXIMAGE_SUPPORT_JPC
CXIMAGE_FORMAT_JPC = 12,
#endif
#if CXIMAGE_SUPPORT_PGX
CXIMAGE_FORMAT_PGX = 13,
#endif
#if CXIMAGE_SUPPORT_PNM
CXIMAGE_FORMAT_PNM = 14,
#endif
#if CXIMAGE_SUPPORT_RAS
CXIMAGE_FORMAT_RAS = 15,
#endif
#if CXIMAGE_SUPPORT_JBG
CXIMAGE_FORMAT_JBG = 16,
#endif
#if CXIMAGE_SUPPORT_MNG
CXIMAGE_FORMAT_MNG = 17,
#endif
#if CXIMAGE_SUPPORT_SKA
CXIMAGE_FORMAT_SKA = 18,
#endif
#if CXIMAGE_SUPPORT_RAW
CXIMAGE_FORMAT_RAW = 19,
#endif
CMAX_IMAGE_FORMATS = CXIMAGE_SUPPORT_BMP + CXIMAGE_SUPPORT_GIF + CXIMAGE_SUPPORT_JPG +
CXIMAGE_SUPPORT_PNG + CXIMAGE_SUPPORT_MNG + CXIMAGE_SUPPORT_ICO +
CXIMAGE_SUPPORT_TIF + CXIMAGE_SUPPORT_TGA + CXIMAGE_SUPPORT_PCX +
CXIMAGE_SUPPORT_WBMP+ CXIMAGE_SUPPORT_WMF +
CXIMAGE_SUPPORT_JBG + CXIMAGE_SUPPORT_JP2 + CXIMAGE_SUPPORT_JPC +
CXIMAGE_SUPPORT_PGX + CXIMAGE_SUPPORT_PNM + CXIMAGE_SUPPORT_RAS +
CXIMAGE_SUPPORT_SKA + CXIMAGE_SUPPORT_RAW + 1
};
/////////////////////////////////////////////////////////////////////////////
// CxImage class
/////////////////////////////////////////////////////////////////////////////
class DLL_EXP CxImage
{
//extensible information collector
typedef struct tagCxImageInfo {
DWORD dwEffWidth; ///< DWORD aligned scan line width
BYTE* pImage; ///< THE IMAGE BITS
CxImage* pGhost; ///< if this is a ghost, pGhost points to the body
CxImage* pParent; ///< if this is a layer, pParent points to the body
DWORD dwType; ///< original image format
char szLastError[256]; ///< debugging
long nProgress; ///< monitor
long nEscape; ///< escape
long nBkgndIndex; ///< used for GIF, PNG, MNG
RGBQUAD nBkgndColor; ///< used for RGB transparency
float fQuality; ///< used for JPEG, JPEG2000 (0.0f ... 100.0f)
BYTE nJpegScale; ///< used for JPEG [ignacio]
long nFrame; ///< used for TIF, GIF, MNG : actual frame
long nNumFrames; ///< used for TIF, GIF, MNG : total number of frames
DWORD dwFrameDelay; ///< used for GIF, MNG
long xDPI; ///< horizontal resolution
long yDPI; ///< vertical resolution
RECT rSelectionBox; ///< bounding rectangle
BYTE nAlphaMax; ///< max opacity (fade)
bool bAlphaPaletteEnabled; ///< true if alpha values in the palette are enabled.
bool bEnabled; ///< enables the painting functions
long xOffset;
long yOffset;
DWORD dwCodecOpt[CMAX_IMAGE_FORMATS]; ///< for GIF, TIF : 0=def.1=unc,2=fax3,3=fax4,4=pack,5=jpg
RGBQUAD last_c; ///< for GetNearestIndex optimization
BYTE last_c_index;
bool last_c_isvalid;
long nNumLayers;
DWORD dwFlags; ///< 0x??00000 = reserved, 0x00??0000 = blend mode, 0x0000???? = layer id - user flags
BYTE dispmeth;
bool bGetAllFrames;
bool bLittleEndianHost;
} CXIMAGEINFO;
public:
//public structures
struct rgb_color { BYTE r,g,b; };
#if CXIMAGE_SUPPORT_WINDOWS
// <VATI> text placement data
// members must be initialized with the InitTextInfo(&this) function.
typedef struct tagCxTextInfo
{
#if defined (_WIN32_WCE)
TCHAR text[256]; ///< text for windows CE
#else
TCHAR text[4096]; ///< text (char -> TCHAR for UNICODE [Cesar M])
#endif
LOGFONT lfont; ///< font and codepage data
COLORREF fcolor; ///< foreground color
long align; ///< DT_CENTER, DT_RIGHT, DT_LEFT aligment for multiline text
BYTE smooth; ///< text smoothing option. Default is false.
BYTE opaque; ///< text has background or hasn't. Default is true.
///< data for background (ignored if .opaque==FALSE)
COLORREF bcolor; ///< background color
float b_opacity; ///< opacity value for background between 0.0-1.0 Default is 0. (opaque)
BYTE b_outline; ///< outline width for background (zero: no outline)
BYTE b_round; ///< rounding radius for background rectangle. % of the height, between 0-50. Default is 10.
///< (backgr. always has a frame: width = 3 pixel + 10% of height by default.)
} CXTEXTINFO;
#endif
public:
/** \addtogroup Constructors */ //@{
CxImage(DWORD imagetype = 0);
CxImage(DWORD dwWidth, DWORD dwHeight, DWORD wBpp, DWORD imagetype = 0);
CxImage(const CxImage &src, bool copypixels = true, bool copyselection = true, bool copyalpha = true);
CxImage(const TCHAR * filename, DWORD imagetype); // For UNICODE support: char -> TCHAR
CxImage(FILE * stream, DWORD imagetype);
CxImage(CxFile * stream, DWORD imagetype);
CxImage(BYTE * buffer, DWORD size, DWORD imagetype);
virtual ~CxImage() { DestroyFrames(); Destroy(); };
CxImage& operator = (const CxImage&);
//@}
/** \addtogroup Initialization */ //@{
void* Cr
没有合适的资源?快使用搜索试试~ 我知道了~
Cximage 所有 版本的 压缩包
共34个文件
h:23个
7z:7个
zip:2个
5星 · 超过95%的资源 需积分: 9 35 下载量 64 浏览量
2010-04-18
08:22:24
上传
评论
收藏 11.24MB RAR 举报
温馨提示
史上最全 的 Cximage 源码 版本, 包含 编译好的 dll lib
资源推荐
资源详情
资源评论
收起资源包目录
Cximage.rar (34个子文件)
cximagecrt.dll 1.17MB
cximage600_lite.7z 260KB
cximage600_full.7z 1.53MB
cximage
ximapcx.h 2KB
ximaska.h 1KB
xiofile.h 3KB
ximaraw.h 3KB
ximage.h 28KB
ximacfg.h 2KB
ximawmf.h 5KB
ximajbg.h 1KB
xfile.h 3KB
ximamng.h 2KB
ximatif.h 2KB
ximawbmp.h 1KB
ximajas.h 3KB
ximagif.h 8KB
ximaico.h 2KB
ximatga.h 2KB
ximabmp.h 3KB
xmemfile.h 1000B
ximajpg.h 9KB
ximapng.h 2KB
ximaiter.h 7KB
ximadef.h 4KB
ximath.h 802B
cximage599c_ocx.zip 2.27MB
cximage600_demo.7z 602KB
cximage600_ce.7z 1.37MB
cximage599c_full_unicode.7z 1.15MB
cximagecrt.lib 147KB
cximage599c_tar.zip 1.78MB
cximage600_bc6.7z 1011KB
cximage600_bc3.7z 879KB
共 34 条
- 1
资源评论
- ytzgl2012-08-02系统图库,需要好好地学习学习。
- HaoYuan2012-08-21版本很全 就是没有 太多说明
- 幸福的家S2021-05-20挺全的,值得推荐
pod10
- 粉丝: 0
- 资源: 1
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功