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

Method run

test/cairoTest/cairoTest.cpp:273–285  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

271// image
272struct TestImage : public TestBase {
273 virtual void run( fli::cairo::Context &ctx ) {
274 Surface beyonceSurface( loadImage( app::App::loadResource( "Beyonce.jpg", RES_BEYONCE_JPG, "JPG" ) ), SurfaceConstraintsCairo() );
275 fli::shared_ptr<fli::cairo::SurfaceImage> image( new cairo::SurfaceImage( beyonceSurface ) );
276
277
278 ctx.translate( 128.0, 128.0 );
279 ctx.rotate( 45 * M_PI / 180 );
280 ctx.scale( 256.0 / image->getWidth(), 256.0 / image->getHeight() );
281 ctx.translate( -0.5 * image->getWidth(), -0.5 * image->getHeight() );
282
283 ctx.setSourceSurface( *image, 0, 0 );
284 ctx.paint();
285 }
286};
287
288// image pattern

Callers

nothing calls this directly

Calls 10

loadImageFunction · 0.85
loadResourceFunction · 0.85
rotateMethod · 0.80
setSourceSurfaceMethod · 0.80
paintMethod · 0.80
translateMethod · 0.45
scaleMethod · 0.45
getWidthMethod · 0.45
getHeightMethod · 0.45

Tested by

no test coverage detected