MCPcopy Create free account
hub / github.com/TankOs/SFGUI / OnMirrorImageClick

Method OnMirrorImageClick

examples/Test.cpp:704–717  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

702}
703
704void SampleApp::OnMirrorImageClick() {
705 auto image = m_image->GetImage();
706
707 for( unsigned int height_index = 0; height_index < image.getSize().y; ++height_index ) {
708 for( unsigned int width_index = 0; width_index < image.getSize().x / 2; ++width_index ) {
709 auto color0 = image.getPixel( { width_index, height_index } );
710 auto color1 = image.getPixel( { image.getSize().x - width_index - 1, height_index } );
711 image.setPixel( { width_index, height_index }, color1 );
712 image.setPixel( { image.getSize().x - width_index - 1, height_index }, color0 );
713 }
714 }
715
716 m_image->SetImage( image );
717}
718
719void SampleApp::OnSwitchRendererClick() {
720 if( sfg::Renderer::Get().GetName() == "Non-Legacy Renderer" ) {

Callers

nothing calls this directly

Calls 2

GetImageMethod · 0.45
SetImageMethod · 0.45

Tested by

no test coverage detected