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

Method openImage

samples/ImageFileBasic/src/ImageFileBasicApp.cpp:40–57  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

38}
39
40void ImageFileBasicApp::openImage( const fs::path &path )
41{
42 try {
43 mImagePath = path;
44 mImageSource = loadImage( path );
45 mTexture = gl::Texture::create( mImageSource );
46 mCanvas.setContentBounds( Rectf( mTexture->getBounds() ) );
47 mCanvas.fitAll();
48 mErrorMessage.clear();
49 }
50 catch( Exception &exc ) {
51 CI_LOG_EXCEPTION( "failed to load image.", exc );
52 mTexture.reset();
53 mImageSource.reset();
54 mImagePath.clear();
55 mErrorMessage = exc.what();
56 }
57}
58
59void ImageFileBasicApp::openImageDialog()
60{

Callers

nothing calls this directly

Calls 8

loadImageFunction · 0.85
setContentBoundsMethod · 0.80
fitAllMethod · 0.80
createFunction · 0.50
getBoundsMethod · 0.45
clearMethod · 0.45
resetMethod · 0.45
whatMethod · 0.45

Tested by

no test coverage detected