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

  • 大小: 1.42MB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發布日期: 2023-11-15
  • 語言: 其他
  • 標簽: libpng??

資源簡介

Ubuntu交叉編譯OpenCV時需要安裝的libpng庫,親測可用。

資源截圖

代碼片段和文件信息


#if?0?/*?in?case?someone?actually?tries?to?compile?this?*/

/*?example.c?-?an?example?of?using?libpng
?*?Last?changed?in?libpng?1.6.24?[August?4?2016]
?*?Maintained?1998-2016?Glenn?Randers-Pehrson
?*?Maintained?1996?1997?Andreas?Dilger)
?*?Written?1995?1996?Guy?Eric?Schalnat?Group?42?Inc.)
?*?To?the?extent?possible?under?law?the?authors?have?waived
?*?all?copyright?and?related?or?neighboring?rights?to?this?file.
?*?This?work?is?published?from:?United?States.
?*/

/*?This?is?an?example?of?how?to?use?libpng?to?read?and?write?PNG?files.
?*?The?file?libpng-manual.txt?is?much?more?verbose?then?this.??If?you?have?not
?*?read?it?do?so?first.??This?was?designed?to?be?a?starting?point?of?an
?*?implementation.??This?is?not?officially?part?of?libpng?is?hereby?placed
?*?in?the?public?domain?and?therefore?does?not?require?a?copyright?notice.
?*
?*?This?file?does?not?currently?compile?because?it?is?missing?certain
?*?parts?like?allocating?memory?to?hold?an?image.??You?will?have?to
?*?supply?these?parts?to?get?it?to?compile.??For?an?example?of?a?minimal
?*?working?PNG?reader/writer?see?pngtest.c?included?in?this?distribution;
?*?see?also?the?programs?in?the?contrib?directory.
?*/

/*?The?simple?but?restricted?approach?to?reading?a?PNG?file?or?data?stream
?*?just?requires?two?function?calls?as?in?the?following?complete?program.
?*?Writing?a?file?just?needs?one?function?call?so?long?as?the?data?has?an
?*?appropriate?layout.
?*
?*?The?following?code?reads?PNG?image?data?from?a?file?and?writes?it?in?a
?*?potentially?new?format?to?a?new?file.??While?this?code?will?compile?there?is
?*?minimal?(insufficient)?error?checking;?for?a?more?realistic?version?look?at
?*?contrib/examples/pngtopng.c
?*/
#include?
#include?
#include?
#include?
#include?
#include?

int?main(int?argc?const?char?**argv)
{
???if?(argc?==?3)
???{
??????png_image?image;?/*?The?control?structure?used?by?libpng?*/

??????/*?Initialize?the?‘png_image‘?structure.?*/
??????memset(&image?0?(sizeof?image));
??????image.version?=?PNG_IMAGE_VERSION;

??????/*?The?first?argument?is?the?file?to?read:?*/
??????if?(png_image_begin_read_from_file(&image?argv[1])?!=?0)
??????{
?????????png_bytep?buffer;

?????????/*?Set?the?format?in?which?to?read?the?PNG?file;?this?code?chooses?a
??????????*?simple?sRGB?format?with?a?non-associated?alpha?channel?adequate?to
??????????*?store?most?images.
??????????*/
?????????image.format?=?PNG_FORMAT_RGBA;

?????????/*?Now?allocate?enough?memory?to?hold?the?image?in?this?format;?the
??????????*?PNG_IMAGE_SIZE?macro?uses?the?information?about?the?image?(width
??????????*?height?and?format)?stored?in?‘image‘.
??????????*/
?????????buffer?=?malloc(PNG_IMAGE_SIZE(image));

?????????/*?If?enough?memory?was?available?read?the?image?in?the?desired?format
??????????*?then?write?the?result?out?to?the?new?file.??‘background‘?is?not
??????????*?necessary?when?reading?the?image?because?the?alpha?channel?is
??????

評論

共有 條評論