91av视频/亚洲h视频/操亚洲美女/外国一级黄色毛片 - 国产三级三级三级三级

  • 大小: 535KB
    文件類型: .zip
    金幣: 2
    下載: 1 次
    發布日期: 2021-05-12
  • 語言: 其他
  • 標簽: SOIL??64??OpenGl??

資源簡介

src文件夾下存放SOIL.h頭文件,X64文件夾下分別存放debug和release版本下的lib文件,自行提取

資源截圖

代碼片段和文件信息

/*
Jonathan?Dummer
2007-07-31-10.32

simple?DXT?compression?/?decompression?code

public?domain
*/

#include?“image_DXT.h“
#include?
#include?
#include?
#include?

/* set?this?=1?if?you?want?to?use?the?covarince?matrix?method...
which?is?better?than?my?method?of?using?standard?deviations
overall?except?on?the?infintesimal?chance?that?the?power
method?fails?for?finding?the?largest?eigenvector */
#define?USE_COV_MAT 1

/*********?Function?Prototypes?*********/
/*
Takes?a?4x4?block?of?pixels?and?compresses?it?into?8?bytes
in?DXT1?format?(color?only?no?alpha).??Speed?is?valued
over?prettyness?at?least?for?now.
*/
void?compress_DDS_color_block(
int?channels
const?unsigned?char?*const?uncompressed
unsigned?char?compressed[8]?);
/*
Takes?a?4x4?block?of?pixels?and?compresses?the?alpha
component?it?into?8?bytes?for?use?in?DXT5?DDS?files.
Speed?is?valued?over?prettyness?at?least?for?now.
*/
void?compress_DDS_alpha_block(
const?unsigned?char?*const?uncompressed
unsigned?char?compressed[8]?);

/*********?Actual?Exposed?Functions?*********/
int
save_image_as_DDS

const?char?*filename
int?width?int?height?int?channels
const?unsigned?char?*const?data

{
/* variables */
FILE?*fout;
unsigned?char?*DDS_data;
DDS_header?header;
int?DDS_size;
/* error?check */
if(?(NULL?==?filename)?||
(width? (channels??4)?||
(data?==?NULL?)?)
{
return?0;
}
/* Convert?the?image */
if(?(channels?&?1)?==?1?)
{
/* no?alpha?just?use?DXT1 */
DDS_data?=?convert_image_to_DXT1(?data?width?height?channels?&DDS_size?);
}?else
{
/* has?alpha?so?use?DXT5 */
DDS_data?=?convert_image_to_DXT5(?data?width?height?channels?&DDS_size?);
}
/* save?it */
memset(?&header?0?sizeof(?DDS_header?)?);
header.dwMagic?=?(‘D‘?< header.dwSize?=?124;
header.dwFlags?=?DDSD_CAPS?|?DDSD_HEIGHT?|?DDSD_WIDTH?|?DDSD_PIXELFORMAT?|?DDSD_LINEARSIZE;
header.dwWidth?=?width;
header.dwHeight?=?height;
header.dwPitchOrLinearSize?=?DDS_size;
header.sPixelFormat.dwSize?=?32;
header.sPixelFormat.dwFlags?=?DDPF_FOURCC;
if(?(channels?&?1)?==?1?)
{
header.sPixelFormat.dwFourCC?=?(‘D‘?< }?else
{
header.sPixelFormat.dwFourCC?=?(‘D‘?< }
header.sCaps.dwCaps1?=?DDSCAPS_TEXTURE;
/* write?it?out */
fout?=?fopen(?filename?“wb“);
fwrite(?&header?sizeof(?DDS_header?)?1?fout?);
fwrite(?DDS_data?1?DDS_size?fout?);
fclose(?fout?);
/* done */
free(?DDS_data?);
return?1;
}

unsigned?char*?convert_image_to_DXT1(
const?unsigned?char?*const?uncompressed
int?width?int?height?int?channels
int?*out_size?)
{
unsigned?char?*compressed;
int?i?j?x?y;
unsigned?char?ublock[16*3];
unsigned?cha

?屬性????????????大小?????日期????時間???名稱
-----------?---------??----------?-----??----
?????目錄???????????0??2017-12-17?00:10??SOIL\src\
?????文件???????17181??2017-02-21?12:47??SOIL\src\image_DXT.c
?????文件????????3212??2017-02-21?12:47??SOIL\src\image_DXT.h
?????文件???????10511??2017-02-21?12:47??SOIL\src\image_helper.c
?????文件????????2287??2017-02-21?12:47??SOIL\src\image_helper.h
?????目錄???????????0??2017-12-17?00:10??SOIL\src\original\
?????文件??????118175??2017-02-21?12:47??SOIL\src\original\stb_image-1.09.c
?????文件??????126186??2017-02-21?12:47??SOIL\src\original\stb_image-1.16.c
?????文件???????58744??2017-02-21?12:47??SOIL\src\SOIL.c
?????文件???????15545??2017-02-21?12:47??SOIL\src\SOIL.h
?????文件??????117420??2017-02-21?12:47??SOIL\src\stb_image_aug.c
?????文件???????16945??2017-02-21?12:47??SOIL\src\stb_image_aug.h
?????文件?????????797??2017-02-21?12:47??SOIL\src\stbi_DDS_aug.h
?????文件???????15447??2017-02-21?12:47??SOIL\src\stbi_DDS_aug_c.h
?????文件???????11270??2017-02-21?12:47??SOIL\src\test_SOIL.cpp
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\Debug\
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\Debug\ALL_BUILD\
?????文件?????????556??2017-02-21?12:47??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.log
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\
?????文件?????????175??2017-02-21?12:47??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\ALL_BUILD.lastbuildstate
?????文件?????????992??2017-02-21?12:47??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\custombuild.command.1.tlog
?????文件????????4390??2017-02-21?12:47??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\custombuild.read.1.tlog
?????文件?????????278??2017-02-21?12:47??SOIL\Win32\Debug\ALL_BUILD\ALL_BUILD.tlog\custombuild.write.1.tlog
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\Debug\ZERO_CHECK\
?????文件?????????492??2017-02-21?12:47??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.log
?????目錄???????????0??2017-12-17?00:10??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\
?????文件????????1136??2017-02-21?12:47??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\custombuild.command.1.tlog
?????文件????????4604??2017-02-21?12:47??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\custombuild.read.1.tlog
?????文件?????????356??2017-02-21?12:47??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\custombuild.write.1.tlog
?????文件?????????175??2017-02-21?12:47??SOIL\Win32\Debug\ZERO_CHECK\ZERO_CHECK.tlog\ZERO_CHECK.lastbuildstate
............此處省略81個文件信息

評論

共有 條評論