Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
J

Jakub Bartczak

@Jakub Bartczak
About
Posts
1
Topics
1
Shares
0
Groups
0
Followers
0
Following
0

Posts

Recent Best Controversial

  • Sharpen filter of bmp image
    J Jakub Bartczak

    need some help with my code, I tried in many ways to make simple filtering image with array 3x3, but cant make it. any ideas how shall I start it?

    #include
    #include
    #include
    #include
    #include

    using namespace std;

    //BMP header
    typedef struct tagBITMAPFILEHEADER {
    unsigned short bfType;
    unsigned int bfSize;
    short bfReserved1;
    short bfReserved2;
    unsigned int bfOffBits;
    } BITMAPFILEHEADER;
    //BMP header
    typedef struct tagBITMAPINFOHEADER {
    unsigned int biSize;
    int biWidth;
    int biHeight;
    unsigned short biPlanes;
    unsigned short biBitCount;
    unsigned int biCompression;
    unsigned int biSizeImage;
    int biXpelsPerMeter;
    int biYpelsPerMeter;
    unsigned int biClrUses;
    unsigned int biClrImportant;
    } BITMAPINFOHEADER;

    int odczytajBFH(ifstream &ifs, BITMAPFILEHEADER &bfh);
    int odczytajBIH(ifstream &ifs, BITMAPINFOHEADER &bih, int kursor);
    void zapiszBFH(ofstream &ofs, BITMAPFILEHEADER &bfh);
    void zapiszBIH(ofstream &ofs, BITMAPINFOHEADER &bih);

    unsigned char* odczytajDaneObrazu(ifstream &ifs, unsigned int rozmiar, int kursor);
    void odczytajRGB(unsigned char *obraz, int **niebieski, int **zielony , int **czerwony, unsigned int rozmiar, int szerokosc, int wysokosc);
    unsigned char * polaczRGB(int **niebieski, int **zielony, int **czerwony, unsigned int rozmiar, int szerokosc, int wysokosc);
    void zwolnij_pamiec(unsigned char *obraz, int **niebieski, int **zielony , int **czerwony, int wysokosc);
    void zapiszDaneObrazu(ofstream &ofs, unsigned char *obraz, unsigned int rozmiar);

    int main()
    {
    BITMAPFILEHEADER bfh;
    BITMAPINFOHEADER bih;
    string str = "bitmap.bmp";
    const char * nazwa_pliku = str.c_str();
    ifstream ifs(nazwa_pliku, ios::binary) ;
    if( !ifs.is_open() )
    {
    cout << "\nBlad otwarcia pliku";
    return 0;
    }
    ofstream ofs("out.bmp", ios::binary);

    int kursor = odczytajBFH(ifs, bfh);
    kursor = odczytajBIH(ifs, bih, kursor);
    zapiszBFH(ofs, bfh);
    zapiszBIH(ofs, bih);
    unsigned int rozmiar = bfh.bfSize - bfh.bfOffBits;
    int szerokosc = bih.biWidth;
    int wysokosc = bih.biHeight;

    u

    Managed C++/CLI ios graphics data-structures help question
  • Login

  • Don't have an account? Register

  • Login or register to search.
  • First post
    Last post
0
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups