MCPcopy Create free account
hub / github.com/a-e-k/canvas_ity / put_image_data

Function put_image_data

test/test.cpp:1832–1853  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1830}
1831
1832void put_image_data( canvas &that, float width, float height )
1833{
1834 unsigned char checker[ 2052 ];
1835 for ( int index = 0; index < 2048; ++index )
1836 checker[ index + 2 ] = static_cast< unsigned char >(
1837 ( ( ( ( index >> 2 & 1 ) ^ ( index >> 7 & 1 ) ) |
1838 ( ( index & 3 ) == 3 ) ) &
1839 ( index >> 10 & 1 ) ) * 255 );
1840 checker[ 0 ] = 157;
1841 checker[ 1 ] = 157;
1842 checker[ 2050 ] = 157;
1843 checker[ 2051 ] = 157;
1844 that.set_color( fill_style, 0.4f, 0.05f, 0.2f, 1.0f );
1845 that.fill_rectangle( 0.0f, 0.0f, 0.25f * width, 0.25f * height );
1846 that.set_global_alpha( 0.5f );
1847 that.global_composite_operation = lighter;
1848 that.rotate( 0.2f );
1849 for ( int y = -10; y < static_cast< int >( height ); y += 29 )
1850 for ( int x = -10; x < static_cast< int >( width ); x += 29 )
1851 that.put_image_data( checker + 6, 16, 16, 128, x, y );
1852 that.put_image_data( 0, 32, 32, 128, 0, 0 );
1853}
1854
1855void save_restore( canvas &that, float width, float height )
1856{

Callers

nothing calls this directly

Calls 5

set_colorMethod · 0.80
fill_rectangleMethod · 0.80
set_global_alphaMethod · 0.80
rotateMethod · 0.80
put_image_dataMethod · 0.80

Tested by

no test coverage detected