int TransformImageBuffer(unsigned char* pImageBuffer, int width, int height,unsigned char* targetImageBuffer)
{
//center flip
int nRet = ;
int length = width * height;
for(int i = ; i < length / ; i++)
{
targetImageBuffer[i] = pImageBuffer[length -i -];
targetImageBuffer[length -i -] = pImageBuffer[i];
}
//vertical flip
for(int h = ; h < height; h++)
{
int firstLine = h * width;
for(int w = ; w < width /; w++)
{
int temp = targetImageBuffer[firstLine + w];
targetImageBuffer[firstLine + w] = targetImageBuffer[firstLine + width - w - ];
targetImageBuffer[firstLine + width - w - ] = temp;
}
} //horizon flip
for(int i = ; i < length /; i++)
{
int line = i / width;
int seq = i % width;
int mirrorPoint = (height - line - ) * width - + seq;
targetImageBuffer[i] = pImageBuffer[mirrorPoint];
targetImageBuffer[mirrorPoint] = pImageBuffer[i];
}
return nRet;
}

最新文章

  1. css-使用line-height实现垂直居中的一些问题
  2. LINUX下搭建VPN
  3. POJ 1450
  4. About GAC
  5. 【HDOJ】3487 Play with Chain
  6. 查找IP来源
  7. 基于纹理边缘抑制的轮廓和边界检测(Contour and Boundary Detection)
  8. spring4.2完整web项目(使用html视图解析器)
  9. MyBatis 源码分析——SqlSession接口和Executor类
  10. Swift学习笔记7--访问控制
  11. Sitecore CMS中查看标准字段
  12. go语言中的坑
  13. Codeforces 757C. Felicity is Coming!
  14. numpy数组-标准化数据
  15. 使用zabbix发送邮件的简易设置流程(存档用)
  16. vSphere下安装Hyper-V
  17. 【centOS7】centOS7上普通用户切换root用户,相互切换
  18. 个人项目-数组求和(语言:C++)
  19. AMD、CMD、CommonJs和 ES6对比
  20. Zookeeper简介和安装(四)

热门文章

  1. C#利用Emit反射实现AOP,以及平台化框架封装思路
  2. easyui tree 判断是否是叶子节点
  3. easyui小清新俺也晒晒 视频管理软件bs项目
  4. 基于Redis缓存的Session共享(附源码)
  5. ASP.NET MVC基础学习
  6. 了解JVM加载实例化类的原理
  7. TaintDroid:智能手机监控实时隐私信息流跟踪系统(三)
  8. Ajax实现xml文件数据插入数据库(一)--- 构建解析xml文件的js库
  9. 【C语言】字符串模块
  10. SAP CRM 为用户创建业务合作伙伴并分配到组织单位