[allegro 4.2.1] rozjaśnienie koloru
Ostatnio zmodyfikowano 2016-02-10 17:11
patrykq Temat założony przez niniejszego użytkownika |
[allegro 4.2.1] rozjaśnienie koloru » 2016-02-09 23:22:53 Witam, jak w allegro 4.2.1 rozjaśnić kolor? Chodzi mi o to, aby rozjaśnić daną bitmape/pixele, tak by kolory były białe, lecz by cieniowanie pozostało. |
|
darko202 |
» 2016-02-10 11:01:03 |
|
Pawlo3 |
» 2016-02-10 13:44:51 Przenieś temat do działu 'Biblioteki'. Wtedy uzyskasz więcej odpowiedzi. |
|
Gabes |
» 2016-02-10 16:17:05 |
|
Gibas11 |
» 2016-02-10 17:11:49 Wut? Jeśli dobrze rozumiem to chcesz po prostu zrobić czarno-białe zdjęcie, tak? Tu masz jak to osiągnąć w SFML: #include <iostream> #include <SFML/Graphics.hpp> using namespace std;
sf::RenderWindow app( sf::VideoMode( 800, 600 ), "app" ); int main() { sf::Image img; sf::Texture tex; sf::Sprite sprite; img.loadFromFile( "texture.png" ); for( int x = 0; x < img.getSize().x; x++ ) { for( int y = 0; y < img.getSize().y; y++ ) { char col =( img.getPixel( x, y ).r + img.getPixel( x, y ).g + img.getPixel( x, y ).b ) / 3; img.setPixel( x, y, sf::Color( col, col, col ) ); } } tex.loadFromImage( img ); sprite.setTexture( tex ); sprite.setPosition( 200, 200 ); while( true ) { app.clear(); app.draw( sprite ); app.display(); } return 0; }
|
|
« 1 » |