Stilllegung des Forums
Das Forum wurde am 05.06.2023 nach über 20 Jahren stillgelegt (weitere Informationen und ein kleiner Rückblick).
Registrierungen, Anmeldungen und Postings sind nicht mehr möglich. Öffentliche Inhalte sind weiterhin zugänglich.
Das Team von spieleprogrammierer.de bedankt sich bei der Community für die vielen schönen Jahre.
Wenn du eine deutschsprachige Spieleentwickler-Community suchst, schau doch mal im Discord und auf ZFX vorbei!
Werbeanzeige
Phili
unregistriert
Anonymous
unregistriert
Phili
unregistriert
Phili
unregistriert
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 |
#include <iostream> #include <fstream> #include <windows.h> using namespace std; struct PH3DBitmapHeader { char a[14]; }; struct PH3DBitmapInfo { DWORD biSize; LONG biWidth; LONG biHeight; WORD biPlanes; WORD biBitCount; DWORD biCompression; DWORD biSizeImage; LONG biXPelsPerMeter; LONG biYPelsPerMeter; DWORD biClrUsed; DWORD biClrImportant; }; int main() { char a[100]; cin>>a; ifstream ifs(a, ios::binary); ofstream ofs("Resultat.bmp", ios::binary); PH3DBitmapHeader Header; PH3DBitmapInfo Info; ifs.read((char*)&Header, 14); ifs.read((char*)&Info, 40); char *Buffer=new char[Info.biSizeImage]; ifs.read((char*)Buffer, Info.biSizeImage); cout<<Info.biCompression; ifs.close(); for(int i=0; i<Info.biHeight*Info.biWidth*3-1; i++) { Buffer[i]=(Buffer[i]+Buffer[i+1])/2; } ofs.write((char*)&Header, 14); ofs.write((char*)&Info, 40); ofs.write((char*)Buffer, Info.biSizeImage); ofs.close(); system ("PAUSE"); return 0; } |
Anonymous
unregistriert
![]() |
C-/C++-Quelltext |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 |
struct Pixel { unsigned char r,g,b; inline Pixel operator + (const Pixel& m) const { Pixel tempP; tempP.r = this->r + m.r; tempP.g = this->g + m.g; tempP.b = this->b + m.b; return tempP; } inline Pixel operator / (const float f) const { if(!f) return *this; Pixel tempP; tempP.r = this->r / f; tempP.g = this->g / f; tempP.b = this->b / f; return tempP; } }; |
Phili
unregistriert
Phili
unregistriert
Werbeanzeige