Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/iphone/45.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
C++ 简单的iphone图像处理源代码问题,这个做什么_C++_Iphone_C_Objective C_Image Manipulation - Fatal编程技术网

C++ 简单的iphone图像处理源代码问题,这个做什么

C++ 简单的iphone图像处理源代码问题,这个做什么,c++,iphone,c,objective-c,image-manipulation,C++,Iphone,C,Objective C,Image Manipulation,我正在浏览上述项目的源代码,我不理解下面的代码行,有人能帮我解释一下吗?我试图让代码与彩色图像一起工作,因为它目前只与灰度图像一起工作。我有主要的工作方法,但是过滤器只适用于返回图像的顶部四分之一 //在heeder文件中 inline uint8_t* operator[](const int rowIndex) { return m_yptrs[rowIndex]; } //在.mm文件中 void Image::initYptrs() { m_yptrs=(uint8_t **)

我正在浏览上述项目的源代码,我不理解下面的代码行,有人能帮我解释一下吗?我试图让代码与彩色图像一起工作,因为它目前只与灰度图像一起工作。我有主要的工作方法,但是过滤器只适用于返回图像的顶部四分之一

//在heeder文件中

inline uint8_t* operator[](const int rowIndex) {
    return m_yptrs[rowIndex];
}
//在.mm文件中

void Image::initYptrs() {
m_yptrs=(uint8_t **) malloc(sizeof(uint8_t *)*m_height);
for(int i=0; i<m_height; i++) {
    m_yptrs[i]=m_imageData+i*m_width;
    }
}
提前感谢。

图像::initYptrs()初始化指向图像每行开头的指针数组

有问题的那一行应该是

m_yptrs[i] = m_imageData + i*BPP*m_width;
其中,BPP是每像素字节数(例如,RGB为3,RGBA为4)。

Image::initYptrs()
初始化指向图像每行开头的指针数组

有问题的那一行应该是

m_yptrs[i] = m_imageData + i*BPP*m_width;

其中BPP是每像素字节数(例如,RGB为3,RGBA为4)。

谢谢,这正好解释了我需要知道的内容。我现在有高斯模糊工作的颜色!再次感谢汉克斯,这正是我需要知道的。我现在有高斯模糊工作的颜色!再次感谢