当前位置: 首页 > news >正文

ssr网站怎么做肥西建设局网站

ssr网站怎么做,肥西建设局网站,免费的x网站域名,wordpress 文章自定义排序#xff08;#xff14;#xff09;blur function 简单画图熟悉一下要做什么 可以看到3种情况#xff0c;顶格#xff0c;边界#xff0c;里面如果分开算的话#xff0c;是真的麻烦#xff1b;但是当时还真的没有想到更好的#xff0c;就先写一写#xff08;此处摘取…blur function 简单画图熟悉一下要做什么 可以看到3种情况顶格边界里面如果分开算的话是真的麻烦但是当时还真的没有想到更好的就先写一写此处摘取3处外部都是 for (int i 0; i height; i) { 下边省去不写 for (int j 0; j width; j) { } } 里面 int sumRed 0,sumGreen 0,sumBlue 0;//set 3 conditions by the limit//前面1部分//计算9个格子if (i 0 i height - 1 j 0 j width - 1) {for (int k -1; k 1; k) {for (int m -1; m 1; m) {sumRed copy[i k][j m].rgbtRed;sumGreen copy[i k][j m].rgbtGreen;sumBlue copy[i k][j m].rgbtBlue;}}//after sum it all and give that value to imageimage[i][j].rgbtRed round(sumRed / 9.0);image[i][j].rgbtGreen round(sumGreen / 9.0);image[i][j].rgbtBlue round(sumBlue / 9.0); }顶格 //1.1 左上角 i j sumRed 0, sumGreen 0, sumBlue 0;if (j 0 i 0) {for (int k 0; k 1; k) {for (int m 0; m 1; m) {sumRed copy[i k][j m].rgbtRed;sumGreen copy[i k][j m].rgbtGreen;sumBlue copy[i k][j m].rgbtBlue;}}//after sum it all and give that value to imageimage[i][j].rgbtRed round(sumRed / 4.0);image[i][j].rgbtGreen round(sumGreen / 4.0);image[i][j].rgbtBlue round(sumBlue / 4.0);}边界 //2.1上边界:移动的方向只有下高度-1k 左边m -右边msumRed 0, sumGreen 0, sumBlue 0;if (i 0) {//计算RGB利用双循环(k,m)for (int k 0; k 1; k) {for (int m -1; m 1; m) {sumRed copy[i k][j m].rgbtRed;sumGreen copy[i k][j m].rgbtGreen;sumBlue copy[i k][j m].rgbtBlue;}}image[i][j].rgbtRed round(sumRed / 6.0);image[i][j].rgbtGreen round(sumGreen / 6.0);image[i][j].rgbtBlue round(sumBlue / 6.0);}简化 然后可以看到很多重复的地方需要开始统一找到不同的地方469然后里层的双循环k,m其实也可以合并只要移动之后的index在范围里面就可以了里层循环的次数加上限定的条件计算count,然后一步步开始删减… // Blur image void blur(int height, int width, RGBTRIPLE image[height][width]) {// copy the image[height][width]RGBTRIPLE copy[height][width];for (int i 0; i height; i){for (int j 0; j width; j){copy[i][j] image[i][j];}}int sumRed 0, sumGreen 0, sumBlue 0, count 0;// set 3 conditions by the limitfor (int i 0; i height; i){for (int j 0; j width; j){for (int k -1; k 1; k){for (int m -1; m 1; m){// condition limit boundaryif (i k 0 i k height - 1 j m 0 j m width - 1){sumRed copy[i k][j m].rgbtRed;sumGreen copy[i k][j m].rgbtGreen;sumBlue copy[i k][j m].rgbtBlue;count;}}}// after sum it all and give that value to image//before calculating the results,first convert it to float!image[i][j].rgbtRed round((float) sumRed / count);image[i][j].rgbtGreen round((float) sumGreen / count);image[i][j].rgbtBlue round((float) sumBlue / count);// clear it and for next roundsumRed 0, sumGreen 0, sumBlue 0, count 0;}} } 问题 这里要在计算之前把int sumRGB值转化成float类型 image[i][j].rgbtRed round((float) sumRed / count);而不是float计算之后的值这样就把小数点之后的都丢了 image[i][j].rgbtRed round((float) sumRed / count);总结 刚开始的时候想不到简洁的方法或者不太理解先慢慢写出来能运行就可以。 后面再去优化一步一步来不需要太大压力 check :) helpers.c exists :) filter compiles :) grayscale correctly filters single pixel with whole number average :) grayscale correctly filters single pixel without whole number average :) grayscale leaves alone pixels that are already gray :) grayscale correctly filters simple 3x3 image :) grayscale correctly filters more complex 3x3 image :) grayscale correctly filters 4x4 image :) sepia correctly filters single pixel :) sepia correctly filters simple 3x3 image :) sepia correctly filters more complex 3x3 image :) sepia correctly filters 4x4 image :) reflect correctly filters 1x2 image :) reflect correctly filters 1x3 image :) reflect correctly filters image that is its own mirror image :) reflect correctly filters 3x3 image :) reflect correctly filters 4x4 image :) blur correctly filters middle pixel :) blur correctly filters pixel on edge :) blur correctly filters pixel in corner :) blur correctly filters 3x3 image :) blur correctly filters 4x4 image
http://www.pierceye.com/news/920250/

相关文章:

  • vps 网站上传做网站费用需要分摊吗
  • 建网站 考虑oou淘宝客图片wordpress模板
  • 玩具网站开发背景小说网站开发文档
  • 遵义网站设计公司制作网站需要
  • 做广告公司网站建设价格成都seo招聘
  • 网站建设与规划试卷友联互换
  • 宠物网站建设费用天元建设集团有限公司是国企吗
  • 南宁在百度上建网站网站设计怎么做链接
  • 多多进宝怎么做自己网站沈阳正规的男科医院
  • 做简历的网站叫什么软件外贸网站建设工作计划
  • 关键词搜索引擎网站公司要求做网站
  • 如何判断网站开发语言浙江省网站建设报价
  • 建设一个网站思路有关网站建设的网站
  • 网站文明建设工程包括做电影网站什么后果
  • 邯郸市有搞网站服服务的吗怎样免费建设免费网站
  • 衡水学校网站建设wordpress后台中文安装
  • 英文网站建站模板电子名片制作app
  • 沧州网站建设多少钱网站多域名
  • 自己做的网站怎么被搜录免费在线观看韩国电视剧网站推荐
  • 网站推广策划案格式及范文专业做网站排名多少钱
  • 做网站优化多少钱南京华典建设有限公司网站
  • 建网站是什么专业类别海洋高端的专业做网站
  • 网站建设评审标准asp网站安全吗
  • 网站服务器怎么维护网站建设讠金手指科杰
  • 网站关键词推广哪家好咸阳seo推广
  • 自己建设网站难不难门户网站建立流程
  • 制作梦核的网站做网站注意哪方面
  • 京东商城网站wordpress模板凡科网做的网站能直接用吗
  • 网站 位置导航网站备案查询系统php版
  • 网站安全检测平台做网站的怎么挣钱