博客
关于我
强烈建议你试试无所不能的chatGPT,快点击我
Getting or Setting Pixels
阅读量:6921 次
发布时间:2019-06-27

本文共 657 字,大约阅读时间需要 2 分钟。

Getting or Setting Pixels

The safe (slow) way

  • Suppose you are working on an Image<Bgr, Byte>. You can obtain the pixel on the y-th row and x-th column by calling
Bgr color = img[y, x];
  • Setting the pixel on the y-th row and x-th column is also simple
img[y,x] = color;

The fast way

The Image pixels values are stored in the Data property, a 3D array. Use this property if you need to iterate through the pixel values of the image.

For example, in an grayscale image (Image<Gray, Byte>), instead of doing this:

Gray byCurrent = imageGray[x, y];

You would do this:

Byte byCurrent = imageGray.Data[x, y, 0];

转载于:https://www.cnblogs.com/visionfeng/p/5479663.html

你可能感兴趣的文章
about the noise
查看>>
工程师五个等级by吴军
查看>>
Golang语法探索-声明结构体
查看>>
cgo中传递void **数据。
查看>>
Spring boot for Eclipse 开发指南第一节 快速创建
查看>>
PHP 5.4中引用的的几个问题 PHP Notice
查看>>
大流量稳定交易系统-王晓钟
查看>>
黄璐_对NFV和SDN的思考与实践
查看>>
上班第一天
查看>>
ASIHTTPRequest
查看>>
JMTabView
查看>>
IBAForms
查看>>
spring boot2 配置 FastJsonHttpMessageConverter 不起作用
查看>>
如何减少接口响应时间
查看>>
开源 免费 java CMS - FreeCMS-数据对象-channel
查看>>
蓝牙核心技术概述(一):蓝牙概述
查看>>
C++ 成员函数前和函数后加const修饰符区别
查看>>
centos7使用docker搭建fdfs
查看>>
android 6.0上getResources.getColor遭弃用
查看>>
Movie Store OpenCart 自适应主题模板 ABC-0249
查看>>