资源简介
cximage是强大的图像处理库,支持各种格式的图片。源码可以编译支持各种编译环境。
代码片段和文件信息
/*
* TIFF file IO using CxFile.
*/
#ifdef WIN32
#include
#endif
#include
#include “ximage.h“
#if CXIMAGE_SUPPORT_TIF
#include “../tiff/tiffiop.h“
#include “xfile.h“
static tsize_t
_tiffReadProcEx(thandle_t fd tdata_t buf tsize_t size)
{
return (tsize_t)((CxFile*)fd)->Read(buf 1 size);
}
static tsize_t
_tiffWriteProcEx(thandle_t fd tdata_t buf tsize_t size)
{
return (tsize_t)((CxFile*)fd)->Write(buf 1 size);
}
static toff_t
_tiffSeekProcEx(thandle_t fd toff_t off int whence)
{
if ( off == 0xFFFFFFFF )
return 0xFFFFFFFF;
if (!((CxFile*)fd)->Seek(off whence))
return 0xFFFFFFFF;
if (whence == SEEK_SET)
return off;
return (toff_t)((CxFile*)fd)->Tell();
}
// Return nonzero if error
static int
_tiffCloseProcEx(thandle_t /*fd*/)
{
// return !((CxFile*)fd)->Close(); // “//“ needed for memory files
return 0;
}
#include
static toff_t
_tiffSizeProcEx(thandle_t fd)
{
return ((CxFile*)fd)->Size();
}
static int
_tiffMapProcEx(thandle_t /*fd*/ tdata_t* /*pbase*/ toff_t* /*psize*/)
{
return (0);
}
static void
_tiffUnmapProcEx(thandle_t /*fd*/ tdata_t /*base*/ toff_t /*size*/)
{
}
// Open a TIFF file descriptor for read/writing.
/*
TIFF*
TIFFOpen(const char* name const char* mode)
{
static const char module[] = “TIFFOpen“;
FILE* stream = fopen(name mode);
if (stream == NULL)
{
TIFFError(module “%s: Cannot open“ name);
return NULL;
}
return (TIFFFdOpen((int)stream name mode));
}
*/
TIFF*
_TIFFFdOpen(void* fd const char* name const char* mode)
{
TIFF* tif;
tif = TIFFClientOpen(name mode
(thandle_t) fd
_tiffReadProcEx _tiffWriteProcEx _tiffSeekProcEx _tiffCloseProcEx
_tiffSizeProcEx _tiffMapProcEx _tiffUnmapProcEx);
if (tif)
tif->tif_fd = fd;
return (tif);
}
extern “C“ TIFF* _TIFFOpenEx(CxFile* stream const char* mode)
{
return (_TIFFFdOpen(stream “TIFF IMAGE“ mode));
}
#ifdef __GNUC__
extern char* malloc();
extern char* realloc();
#else
#include
#endif
tdata_t
_TIFFmalloc(tsize_t s)
{
return (malloc((size_t) s));
}
void
_TIFFfree(tdata_t p)
{
free(p);
}
tdata_t
_TIFFrealloc(tdata_t p tsize_t s)
{
return (realloc(p (size_t) s));
}
void
_TIFFmemset(tdata_t p int v tsize_t c)
{
memset(p v (size_t) c);
}
void
_TIFFmemcpy(tdata_t d const tdata_t s tsize_t c)
{
memcpy(d s (size_t) c);
}
int
_TIFFmemcmp(const tdata_t p1 const tdata_t p2 tsize_t c)
{
return (memcmp(p1 p2 (size_t) c));
}
#ifndef UNICODE
#define DbgPrint wvsprintf
#define DbgPrint2 wsprintf
#define DbgMsgBox MessageBox
#else
#define DbgPrint wvsprintfA
#define DbgPrint2 wsprintfA
#define DbgMsgBox MessageBoxA
#endif
static void
Win32WarningHandler(const char* module const char* fmt va_list ap)
{
#ifdef _DEBUG
#if (!defined(_CONSOLE) && !defined(_WIN32_WCE) && de
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 9193 2008-01-29 00:34 cximage_full\CxImage\cximage.dsp
文件 537 2001-08-06 17:19 cximage_full\CxImage\cximage.dsw
文件 294 2004-10-18 17:52 cximage_full\CxImage\CxImageDLL\CxImageCrtDll.cpp
文件 11859 2008-01-29 19:27 cximage_full\CxImage\CxImageDLL\CxImageCrtDll.dsp
文件 3035 2008-02-03 17:07 cximage_full\CxImage\CxImageDLL\CxImageCrtDll.rc
文件 2998 2003-04-06 13:33 cximage_full\CxImage\CxImageDLL\CxImageDll.dsw
文件 364 2003-03-23 14:55 cximage_full\CxImage\CxImageDLL\CxImageMfcDll.clw
文件 1817 2003-03-23 14:55 cximage_full\CxImage\CxImageDLL\CxImageMfcDll.cpp
文件 11043 2008-01-29 00:59 cximage_full\CxImage\CxImageDLL\cximagemfcdll.dsp
文件 1330 2003-03-23 14:55 cximage_full\CxImage\CxImageDLL\CxImageMfcDll.h
文件 3031 2008-01-29 20:06 cximage_full\CxImage\CxImageDLL\CxImageMfcDll.rc
文件 419 2003-03-23 15:58 cximage_full\CxImage\CxImageDLL\resource.h
文件 419 2004-10-17 09:40 cximage_full\CxImage\CxImageDLL\resrc1.h
文件 215 2003-03-23 14:55 cximage_full\CxImage\CxImageDLL\StdAfx.cpp
文件 1496 2008-01-29 00:27 cximage_full\CxImage\CxImageDLL\StdAfx.h
文件 802 2003-03-23 15:12 cximage_full\CxImage\CxImageDLL\StdCrt.h
文件 2352 2008-02-02 15:00 cximage_full\CxImage\license.txt
文件 4660 2008-01-29 20:47 cximage_full\CxImage\tif_xfile.cpp
文件 2836 2008-01-29 21:32 cximage_full\CxImage\xfile.h
文件 14264 2008-02-02 15:00 cximage_full\CxImage\ximabmp.cpp
文件 2574 2004-06-27 19:31 cximage_full\CxImage\ximabmp.h
文件 1855 2008-01-28 23:05 cximage_full\CxImage\ximacfg.h
文件 4200 2008-01-29 00:00 cximage_full\CxImage\ximadef.h
文件 106870 2008-02-02 15:00 cximage_full\CxImage\ximadsp.cpp
文件 28500 2008-02-02 15:00 cximage_full\CxImage\ximaenc.cpp
文件 31295 2008-02-02 15:00 cximage_full\CxImage\ximaexif.cpp
文件 16653 2008-02-02 15:00 cximage_full\CxImage\ximage.cpp
文件 28464 2008-02-02 15:00 cximage_full\CxImage\ximage.h
文件 49042 2008-02-02 15:00 cximage_full\CxImage\ximagif.cpp
文件 8034 2008-01-30 23:31 cximage_full\CxImage\ximagif.h
............此处省略687个文件信息
评论
共有 条评论