xxxx18一60岁hd中国/日韩女同互慰一区二区/西西人体扒开双腿无遮挡/日韩欧美黄色一级片 - 色护士精品影院www

  • 大小: 28KB
    文件類型: .gz
    金幣: 1
    下載: 0 次
    發(fā)布日期: 2021-05-21
  • 語言: 其他
  • 標簽: OpenCL??采樣器??

資源簡介

使用 OpenCL 采樣器對象,從原始圖像中截取部分矩形區(qū)域。

資源截圖

代碼片段和文件信息

#include?
#include?

#ifdef?__APPLE__
#include?
#else
#include?
#endif

#include?“util.h“

extern?void?scissor(uint8_t?*src?uint8_t?*des?int?orig_width?int?orig_height
int?new_width?int?new_height);

int?main()
{
/*?RGBA?image?format?*/
uint?orig_width?=?512
?????orig_height?=?512
?????size?=?orig_width?*?orig_height?*?4;

uint?new_width?=?256
?????new_height?=?256;

uint8_t?*img_buffer;
uint8_t?*out_buffer;

//?1.定義輸入文件和輸出文件
const?char?*img_file?=?“/data/local/tmp/lenna_rgba.bin“;
const?char?*out_file?=?“l(fā)enna_rgba_target.bin“;

//?2.分別為兩個文件預(yù)分配緩沖區(qū)
img_buffer?=?(uint8_t?*)malloc(size);
out_buffer?=?(uint8_t?*)malloc(size);
if?(!img_buffer?||?!out_buffer)?{
perror(“malloc?memory?fail“);
exit(EXIT_FAILURE);
}

//?3.將輸入文件保存到緩沖區(qū)中
load_data(img_file?img_buffer?size);

//?4.旋轉(zhuǎn)圖像
scissor(img_buffer?out_buffer?orig_width?orig_height
new_width?new_height);

//?5.把旋轉(zhuǎn)后的圖像數(shù)據(jù)保存到輸出文件中
store_data(out_file?out_buffer?384?*?384?*?4);

//?6.釋放緩沖區(qū)
free(img_buffer);
free(out_buffer);

return?0;
}

評論

共有 條評論