MCPcopy Create free account
hub / github.com/cinder/Cinder / openFile

Method openFile

samples/ImageHeightField/src/ImageHeightFieldApp.cpp:51–66  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

49}
50
51void ImageHFApp::openFile()
52{
53 fs::path path = getOpenFilePath( "", ImageIo::getLoadExtensions() );
54 if( ! path.empty() ) {
55 mImage = loadImage( path );
56
57 mWidth = mImage.getWidth();
58 mHeight = mImage.getHeight();
59
60 mVboMesh = gl::VboMesh::create( mWidth * mHeight, GL_POINTS, { gl::VboMesh::Layout().usage(GL_STATIC_DRAW).attrib(geom::POSITION, 3).attrib(geom::COLOR, 3) } );
61 mPointsBatch = gl::Batch::create( mVboMesh, gl::getStockShader( gl::ShaderDef().color() ) );
62
63 updateData( kColor );
64 mCam.lookAt( vec3( mWidth / 2, 50, mHeight / 2 ), vec3( 0 ) );
65 }
66}
67
68void ImageHFApp::keyDown( KeyEvent event )
69{

Callers

nothing calls this directly

Calls 10

getOpenFilePathFunction · 0.85
loadImageFunction · 0.85
LayoutClass · 0.85
colorMethod · 0.80
lookAtMethod · 0.80
createFunction · 0.50
ShaderDefClass · 0.50
emptyMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected