Quantcast
Channel: beginners - openFrameworks
Viewing all articles
Browse latest Browse all 4929

ofImage data to const char*

$
0
0

@Radeise wrote:

Hi,

I try to pass ofImage data to easyBMP c++ library.

this way work but it’s slow :

for( int  i=0 ; i < img->getWidth() ; i++)
    {
        for( int j=0 ; j < img->getHeight() ; j++)
        {
            bmp(i,j)->Red   = img->getColor(i,j).r;
            bmp(i,j)->Green = img->getColor(i,j).g;
            bmp(i,j)->Blue  = img->getColor(i,j).b;
        }
    }

So I try to pass data directly to ReadFromFile(const char*) function :

bmp.ReadFromFile((const char*) img->getPixels().getData());

That gives me this error : EasyBMP Error: Cannot open file \377\377\377\377 for input.
and a white image of 1x1px :face_with_raised_eyebrow:

I understand that there is a problem of structure but where?

:man_shrugging:

Posts: 1

Participants: 1

Read full topic


Viewing all articles
Browse latest Browse all 4929

Latest Images

Trending Articles



Latest Images