备忘一下.
//得到灰度CCSprite, int l_iGrayValue = (int)(l_iR*0.299 + l_iG*0.587 + l_iB*0.114);
CCSprite* Tools::getGraySpriteWithFile(const char* p_file){
CCSprite* l_sprite = Tools::getSpriteWithFile(p_file);
CCSize l_sizeInPixel = l_sprite->getContentSizeInPixels();
//开辟出内存buffer
unsigned char* l_buffer = (unsigned char*)malloc(l_sizeInPixel.width * l_sizeInPixel.height * 4);
memset(l_buffer, 0, l_sizeInPixel.width * l_sizeInPixel.height * 4);
......
阅读全文