资源简介
libtiff,里面有源码和静态库,直接导入VS就可以用了
代码片段和文件信息
/* $Id: tif_aux.cv 1.26 2010-07-01 15:33:28 dron Exp $ */
/*
* Copyright (c) 1991-1997 Sam Leffler
* Copyright (c) 1991-1997 Silicon Graphics Inc.
*
* Permission to use copy modify distribute and sell this software and
* its documentation for any purpose is hereby granted without fee provided
* that (i) the above copyright notices and this permission notice appear in
* all copies of the software and related documentation and (ii) the names of
* Sam Leffler and Silicon Graphics may not be used in any advertising or
* publicity relating to the software without the specific prior written
* permission of Sam Leffler and Silicon Graphics.
*
* THE SOFTWARE IS PROVIDED “AS-IS“ AND WITHOUT WARRANTY OF ANY KIND
* EXPRESS IMPLIED OR OTHERWISE INCLUDING WITHOUT LIMITATION ANY
* WARRANTY OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.
*
* IN NO EVENT SHALL SAM LEFFLER OR SILICON GRAPHICS BE LIABLE FOR
* ANY SPECIAL INCIDENTAL INDIRECT OR CONSEQUENTIAL DAMAGES OF ANY KIND
* OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE DATA OR PROFITS
* WHETHER OR NOT ADVISED OF THE POSSIBILITY OF DAMAGE AND ON ANY THEORY OF
* LIABILITY ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE
* OF THIS SOFTWARE.
*/
/*
* TIFF Library.
*
* Auxiliary Support Routines.
*/
#include “tiffiop.h“
#include “tif_predict.h“
#include
uint32
_TIFFMultiply32(TIFF* tif uint32 first uint32 second const char* where)
{
uint32 bytes = first * second;
if (second && bytes / second != first) {
TIFFErrorExt(tif->tif_clientdata where “Integer overflow in %s“ where);
bytes = 0;
}
return bytes;
}
uint64
_TIFFMultiply64(TIFF* tif uint64 first uint64 second const char* where)
{
uint64 bytes = first * second;
if (second && bytes / second != first) {
TIFFErrorExt(tif->tif_clientdata where “Integer overflow in %s“ where);
bytes = 0;
}
return bytes;
}
void*
_TIFFCheckRealloc(TIFF* tif void* buffer
tmsize_t nmemb tmsize_t elem_size const char* what)
{
void* cp = NULL;
tmsize_t bytes = nmemb * elem_size;
/*
* XXX: Check for integer overflow.
*/
if (nmemb && elem_size && bytes / elem_size == nmemb)
cp = _TIFFrealloc(buffer bytes);
if (cp == NULL) {
TIFFErrorExt(tif->tif_clientdata tif->tif_name
“Failed to allocate memory for %s “
“(%ld elements of %ld bytes each)“
what(long) nmemb (long) elem_size);
}
return cp;
}
void*
_TIFFCheckMalloc(TIFF* tif tmsize_t nmemb tmsize_t elem_size const char* what)
{
return _TIFFCheckRealloc(tif NULL nmemb elem_size what);
}
static int
TIFFDefaultTransferFunction(TIFFDirectory* td)
{
uint16 **tf = td->td_transferfunction;
tmsize_t i n nbytes;
tf[0] = tf[1] = tf[2] = 0;
if (td->td_bitspersample >= sizeof(tmsize_t) * 8 - 2)
return 0;
n = ((tmsize_t)1)<
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 200623 2013-11-14 08:50 libtiff\ChangeLog
文件 3365 2015-04-03 08:55 libtiff\CMakeLists.txt
文件 1146 2013-11-14 08:50 libtiff\COPYRIGHT
文件 11379 2013-11-14 08:50 libtiff\t4.h
文件 35012 2013-11-14 08:50 libtiff\tiff.h
文件 22840 2013-11-14 08:50 libtiff\tiffio.h
文件 1693 2013-11-14 08:50 libtiff\tiffio.hxx
文件 16111 2013-11-14 08:50 libtiff\tiffiop.h
文件 410 2013-11-14 08:50 libtiff\tiffvers.h
文件 10472 2013-11-14 08:50 libtiff\tif_aux.c
文件 4307 2013-11-14 08:50 libtiff\tif_close.c
文件 5042 2013-11-14 08:50 libtiff\tif_codec.c
文件 9205 2013-11-14 08:50 libtiff\tif_color.c
文件 8600 2013-11-14 08:50 libtiff\tif_compress.c
文件 4599 2014-02-19 08:53 libtiff\tif_config.h.cmakein
文件 57128 2013-11-14 08:50 libtiff\tif_dir.c
文件 11292 2013-11-14 08:50 libtiff\tif_dir.h
文件 49710 2013-11-14 08:50 libtiff\tif_dirinfo.c
文件 184813 2013-11-14 08:50 libtiff\tif_dirread.c
文件 101655 2013-11-14 08:50 libtiff\tif_dirwrite.c
文件 4157 2013-11-14 08:50 libtiff\tif_dumpmode.c
文件 2414 2013-11-14 08:50 libtiff\tif_error.c
文件 3239 2013-11-14 08:50 libtiff\tif_extension.c
文件 49822 2013-11-14 08:50 libtiff\tif_fax3.c
文件 17236 2013-11-14 08:50 libtiff\tif_fax3.h
文件 104740 2013-11-14 08:50 libtiff\tif_fax3sm.c
文件 4073 2013-11-14 08:50 libtiff\tif_flush.c
文件 84373 2013-11-14 08:50 libtiff\tif_getimage.c
文件 6008 2013-11-14 08:50 libtiff\tif_jbig.c
文件 76074 2013-11-14 08:50 libtiff\tif_jpeg.c
............此处省略34个文件信息
评论
共有 条评论