#include "stb_image.h"
#define STB_IMAGE_IMPLEMENTATION
/* stb_image - v2.05 - public domain image loader - http://nothings.org/stb_image.h
no warranty implied; use at your own risk
Do this:
#define STB_IMAGE_IMPLEMENTATION
before you include this file in *one* C or C++ file to create the implementation.
// i.e. it should look like this:
#include ...
#include ...
#include ...
#define STB_IMAGE_IMPLEMENTATION
#include "stb_image.h"
You can #define STBI_ASSERT(x) before the #include to avoid using assert.h.
And #define STBI_MALLOC, STBI_REALLOC, and STBI_FREE to avoid using malloc,realloc,free
QUICK NOTES:
Primarily of interest to game developers and other people who can
avoid problematic images and only need the trivial interface
JPEG baseline & progressive (12 bpc/arithmetic not supported, same as stock IJG lib)
PNG 1/2/4/8-bit-per-channel (16 bpc not supported)
TGA (not sure what subset, if a subset)
BMP non-1bpp, non-RLE
PSD (composited view only, no extra channels)
GIF (*comp always reports as 4-channel)
HDR (radiance rgbE format)
PIC (Softimage PIC)
PNM (PPM and PGM binary only)
- decode from memory or through FILE (define STBI_NO_STDIO to remove code)
- decode from arbitrary I/O callbacks
- SIMD acceleration on x86/x64 (SSE2) and ARM (NEON)
Full documentation under "DOCUMENTATION" below.
Revision 2.00 release notes:
- Progressive JPEG is now supported.
- PPM and PGM binary formats are now supported, thanks to Ken Miller.
- x86 platforms now make use of SSE2 SIMD instructions for
JPEG decoding, and ARM platforms can use NEON SIMD if requested.
This work was done by Fabian "ryg" Giesen. SSE2 is used by
default, but NEON must be enabled explicitly; see docs.
With other JPEG optimizations included in this version, we see
2x speedup on a JPEG on an x86 machine, and a 1.5x speedup
on a JPEG on an ARM machine, relative to previous versions of this
library. The same results will not obtain for all JPGs and for all
x86/ARM machines. (Note that progressive JPEGs are significantly
slower to decode than regular JPEGs.) This doesn't mean that this
is the fastest JPEG decoder in the land; rather, it brings it
closer to parity with standard libraries. If you want the fastest
decode, look elsewhere. (See "Philosophy" section of docs below.)
See final bullet items below for more info on SIMD.
- Added STBI_MALLOC, STBI_REALLOC, and STBI_FREE macros for replacing
the memory allocator. Unlike other STBI libraries, these macros don't
support a context parameter, so if you need to pass a context in to
the allocator, you'll have to store it in a global or a thread-local
variable.
- Split existing STBI_NO_HDR flag into two flags, STBI_NO_HDR and
STBI_NO_LINEAR.
STBI_NO_HDR: suppress implementation of .hdr reader format
STBI_NO_LINEAR: suppress high-dynamic-range light-linear float API
- You can suppress implementation of any of the decoders to reduce
your code footprint by #defining one or more of the following
symbols before creating the implementation.
STBI_NO_JPEG
STBI_NO_PNG
STBI_NO_BMP
STBI_NO_PSD
STBI_NO_TGA
STBI_NO_GIF
STBI_NO_HDR
STBI_NO_PIC
STBI_NO_PNM (.ppm and .pgm)
- You can request *only* certain decoders and suppress all other ones
(this will be more forward-compatible, as addition of new decoders
doesn't require you to disable them explicitly):
STBI_ONLY_JPEG
STBI_ONLY_PNG
STBI_ONLY_BMP
STBI_ONLY_PSD
STBI_ONLY_TGA
STBI_ONLY_GIF
STBI_ONLY_HDR
STBI_ONLY_PIC
STBI_ONLY_PNM (.ppm and .pgm)
Note that you can define multiples of these, and you will get all
of them ("only x" and "only y" is interpreted to mean "only x&y").
- If you use STBI_NO_PNG (or _ONLY_ without PNG), and you still
want the zlib decoder to be available, #define STBI_SUPPORT_ZLIB
- Compilation of all SIMD code can be suppressed with
#define STBI_NO_SIMD
It should not be necessary to disable SIMD unless you have issues
compiling (e.g. using an x86 compiler which doesn't support SSE
intrinsics or that doesn't support the method used to detect
SSE2 support at run-time), and even those can be reported as
bugs so I can refine the built-in compile-time checking to be
smarter.
- The old STBI_SIMD system which allowed installing a user-defined
IDCT etc. has been removed. If you need this, don't upgrade. My
assumption is that almost nobody was doing this, and those who
were will find the built-in SIMD more satisfactory anyway.
- RGB values computed for JPEG images are slightly different from
previous versions of stb_image. (This is due to using less
integer precision in SIMD.) The C code has been adjusted so
that the same RGB values will be computed regardless of whether
SIMD support is available, so your app should always produce
consistent results. But these results are slightly different from
previous versions. (Specifically, about 3% of available YCbCr values
will compute different RGB results from pre-1.49 versions by +-1;
most of the deviating values are one smaller in the G channel.)
- If you must produce consistent results with previous versions of
stb_image, #define STBI_JPEG_OLD and you will get the same results
you used to; however, you will not get the SIMD speedups for
the YCbCr-to-RGB conversion step (although you should still see
significant JPEG speedup from the other changes).
Please note that STBI_JPEG_OLD is a temporary feature; it will be
removed in future versions of the library. It is only intended for
near-term back-compatibility use.
Latest revision history:
2.05 (2015-04-19) fix bug in progressive JPEG handling, fix warning
2.04 (2015-04-15) try to re-enable SIMD on MinGW 64-bit
2.03 (2015-04-12) additional corruption checking
stbi_set_flip_vertically_on_load
fix NEON support; fix mingw support
2.02 (2015-01-19) fix incorrect assert, fix warning
2.01 (2015-01-17) fix various warnings
2.00b (2014-12-25) fix STBI_MALLOC in progressive JPEG
2.00 (2014-12-25) optimize JPEG, including x86 SSE2 & ARM NEON SIMD
progressive JPEG
PGM/PPM support
STBI_MALLOC,STBI_REALLOC,STBI_FREE
STBI_NO_*, STBI_ONLY_*
GIF bugfix
1.48 (2014-12-14) fix incorrectly-named assert()
1.47 (2014-12-14) 1/2/4-bit PNG support (both grayscale and paletted)
optimize PNG
fix bug in interlaced PNG with user-specified channel count
See end of file for full revision history.
============================ Contributors =========================
Image formats Bug fixes & warning fixes
Sean Barrett (jpeg, png, bmp) Marc LeBlanc
Nicolas Schulz (hdr, psd) Christpher Lloyd
Jonathan Dummer (tga) Dave Moore
Jean-Marc Lienher (gif)
没有合适的资源?快使用搜索试试~ 我知道了~
资源推荐
资源详情
资源评论
收起资源包目录
vc6.0下,通过mfc使用duilib库源码下载 (110个子文件)
DuilibInVC6.aps 35KB
stb_image.c 221KB
DuilibInVC6.clw 1013B
DuilibInVC6Dlg.cpp 4KB
MainDui.cpp 2KB
DuilibInVC6.cpp 1KB
DemoDui.cpp 1KB
StdAfx.cpp 213B
DuiLib_d.dll 1.11MB
DuiLib_d.dll 1.11MB
DuiLib.dll 410KB
DuilibInVC6.dsp 4KB
DuilibInVC6.dsw 545B
DuilibInVC6.exe 2MB
GdiPlusGraphics.h 92KB
GdiPlusFlat.h 85KB
GdiPlusEnums.h 55KB
GdiPlusPath.h 49KB
GdiPlusBrush.h 30KB
GdiPlusImaging.h 24KB
stb_image.h 22KB
GdiPlusBitmap.h 22KB
GdiPlusHeaders.h 22KB
GdiPlusTypes.h 18KB
UIManager.h 14KB
GdiPlusimageAttributes.h 13KB
GdiPlusPen.h 13KB
GdiPlusRegion.h 13KB
UIList.h 12KB
GdiPlusMetaFile.h 12KB
UIDefine.h 11KB
GdiPlusStringFormat.h 9KB
GdiPlusMatrix.h 8KB
GdiPlusMetaHeader.h 8KB
UIControl.h 7KB
GdiPlusPixelFormats.h 7KB
Utils.h 6KB
downloadmgr.h 6KB
GdiPlusLineCaps.h 6KB
GdiPlusFontFamily.h 6KB
GdiPlusFont.h 6KB
UIWebBrowser.h 5KB
UIRichEdit.h 5KB
UITreeView.h 4KB
UIContainer.h 4KB
GdiPlusColor.h 4KB
UIScrollBar.h 4KB
WebBrowserEventHandler.h 4KB
UICombo.h 4KB
UIlib.h 4KB
WinImplBase.h 3KB
GdiPlus.h 3KB
UIBase.h 3KB
GdiPlusFontCollection.h 3KB
GdiPlusInit.h 3KB
UILabel.h 3KB
UIMarkup.h 3KB
GdiPlusGpStubs.h 3KB
UIRender.h 3KB
UIDelegate.h 2KB
UIEdit.h 2KB
UIFlash.h 2KB
UIActiveX.h 2KB
GdiPlusCachedBitmap.h 2KB
GdiPlusColorMatrix.h 2KB
UIButton.h 2KB
GdiPlusImageCodec.h 2KB
DuilibInVC6Dlg.h 1KB
UIOption.h 1KB
DuilibInVC6.h 1KB
StdAfx.h 1KB
GdiPlusMem.h 1KB
UIDlgBuilder.h 1KB
UISlider.h 1004B
MainDui.h 994B
UIProgress.h 950B
DemoDui.h 945B
UIHorizontalLayout.h 865B
UIVerticalLayout.h 859B
GdiPlusBase.h 857B
UICheckBox.h 774B
FlashEventHandler.h 733B
UITabLayout.h 684B
UIDateTime.h 666B
UIText.h 622B
UITileLayout.h 586B
Resource.h 544B
UIChildLayout.h 531B
DuilibInVC6.ico 1KB
DuiLib_d.lib 574KB
DuiLib.lib 571KB
GdiPlus.lib 196KB
DuilibInVC6.ncb 49KB
DuilibInVC6.opt 54KB
DuilibInVC6.plg 3KB
close_n.png 1KB
close_d.png 1KB
close_p.png 1KB
close_h.png 1KB
min_d.png 1015B
共 110 条
- 1
- 2
Easy28181
- 粉丝: 2
- 资源: 17
上传资源 快速赚钱
- 我的内容管理 展开
- 我的资源 快来上传第一个资源
- 我的收益 登录查看自己的收益
- 我的积分 登录查看自己的积分
- 我的C币 登录后查看C币余额
- 我的收藏
- 我的下载
- 下载帮助
安全验证
文档复制为VIP权益,开通VIP直接复制
信息提交成功
- 1
- 2
- 3
前往页