back to scratko.xyz
aboutsummaryrefslogtreecommitdiff
path: root/img_handler.hpp
blob: cb53807c9a9cad57c505b67337ad97f54438422d (plain)
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
/*
 * Processing of images uploaded by the user 
 * (resizing, cropping, saving)
 */

#ifndef IMG_HANDLER_HPP_SENTRY
#define IMG_HANDLER_HPP_SENTRY

#include <string>

enum {
    width   = 300,
    height  = 300
};

class ImageHandler {
    int channel;
    int in_width;
    int in_height;
    std::string source_path;
    std::string destination_directory;
    unsigned char *img_data;
    unsigned char *resized_data;
public:
    ImageHandler(const char *p);
    void load_img();
    void resize_img();
    void save_img();
};

#endif