Quantcast
Channel: bugs, errors - openFrameworks
Viewing all articles
Browse latest Browse all 636

Need help with ofxTimeline / openFrameworks 9 build error (Xcode / OSX Sierra)

$
0
0

@simspace wrote:

Hi all,

I am new to openFrameworks and I am trying to get the ofxTimeline addon to compile with openFrameworks 9 using Xcode on OSX Sierra.

The build of ofxTLImageSequence.cpp is failing in ofxTLImageSequence::recomputePreview() method.

This is not the actual code, but psuedo code of what is causing the error:
ofTexture->loadData( ofImage.getPixels(), …)

It seems that ofImage.getPixels() is not returning what ofTexture.loadData() requires and is causing the build error below.

Does any one have any ideas how to fix this?

Thanks,
Chris

The build errors:

Projects/openframeworks9/addons/ofxTimeline/src/ofxTLImageSequence.cpp:236:14: No matching member function for call to 'loadData'
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:474:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const unsigned char *const' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:482:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const unsigned short *' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:490:7: Candidate function not viable: no known conversion from 'ofPixels_<unsigned char>' to 'const float *' for 1st argument
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:549:7: Candidate function not viable: requires 3 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:955:10: Candidate function not viable: requires 5 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:520:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:527:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:534:7: Candidate function not viable: requires 2 arguments, but 4 were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:494:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:502:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided
Projects/openframeworks9/libs/openFrameworks/gl/ofTexture.h:510:7: Candidate function not viable: requires single argument 'pix', but 4 arguments were provided

The ofxTLImageSequence::recomputePreview() method:

void ofxTLImageSequence::recomputePreview(){
    if(!loaded){
        ofLogError("ofxTLImageSequence -- hasn't been loaded");
        return;
    }

    if(bounds.height < 20){
        ofLogError("ofxTLImageSequence -- too squished at height " + ofToString(20));
        return;
    }

    float widthPerFrame = bounds.height/imageHeight * imageWidth;
    int framesToShow = (bounds.width / widthPerFrame) + 1;
    if(framesToShow == 0){
        ofLogError("ofxTLImageSequence -- no frames to show!");
        return;
    }


    int startIndex = getIndexAtPercent(zoomBounds.min);
    int endIndex = getIndexAtPercent(zoomBounds.max);
    int framesInRange = (endIndex - startIndex);

    int frameStep = framesInRange / framesToShow;
    int fameIndex = 0;

    clearPreviewTextures();

    for(int i = 0; i < framesToShow; i++){
        ofImage* thumbnail = frames[startIndex+frameStep*i]->getThumbnail();
        PreviewTexture p;

        p.frameIndex = startIndex+frameStep*i;
        p.texture = new ofTexture();
        p.texture->allocate(thumbnail->getWidth(), thumbnail->getHeight(), ofGetGlInternalFormat(thumbnail->getPixelsRef()));

        // *** BUILD IS FAILING HERE *** //
        p.texture->loadData(thumbnail->getPixels(), thumbnail->getWidth(), thumbnail->getHeight(), ofGetGlInternalFormat(thumbnail->getPixelsRef()));

        p.bounds = ofRectangle(widthPerFrame*i, 0, widthPerFrame, bounds.height);

        previewTextures.push_back( p );
    }
}

Posts: 17

Participants: 3

Read full topic


Viewing all articles
Browse latest Browse all 636

Trending Articles