Subversion Repositories Kolibri OS

Rev

Rev 7252 | Rev 7783 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7252 Rev 7254
Line 86... Line 86...
86
#define Image_bpp16  5
86
#define Image_bpp16  5
87
#define Image_bpp1   6
87
#define Image_bpp1   6
88
#define Image_bpp8g  7  // grayscale
88
#define Image_bpp8g  7  // grayscale
89
#define Image_bpp2i  8
89
#define Image_bpp2i  8
90
#define Image_bpp4i  9
90
#define Image_bpp4i  9
91
#define Image_bpp8a 10  // grayscale with alpha channel; application layer only!!! kernel doesn't handle this image type, libimg can only create and destroy such images
91
#define Image_bpp8a 10  // grayscale with alpha channel; application layer only!!! 
-
 
92
                        // kernel doesn't handle this image type, 
-
 
93
                        // libimg can only create and destroy such images
Line 92... Line 94...
92
 
94
 
93
 
95
 
94
:dword load_image(dword filename)
96
:dword load_image(dword filename)
Line 189... Line 191...
189
        offx, 
191
        offx, 
190
        offy
192
        offy
191
    );  
193
    );  
192
}
194
}
Line 193... Line 195...
193
 
195
 
194
//NOTICE: DO NOT FORGOT TO INIT libio AND libimg!!!
196
//NOTICE: DO NOT FORGET TO INIT libio AND libimg!!!
195
:void save_image(dword _image, _w, _h, _path)
197
:void save_image(dword _image_pointer, _w, _h, _path)
196
{
198
{
197
    char save_success_message[4096+200];
199
    char save_success_message[4096+200];
198
    dword encoded_data=0;
200
    dword encoded_data=0;
199
    dword encoded_size=0;
201
    dword encoded_size=0;
Line 204... Line 206...
204
    if (image_ptr == 0) {
206
    if (image_ptr == 0) {
205
        notify("'Error saving file, probably not enought memory!' -E");
207
        notify("'Error saving file, probably not enought memory!' -E");
206
    }
208
    }
207
    else {
209
    else {
208
        EDI = image_ptr;
210
        EDI = image_ptr;
209
        memmov(EDI._Image.Data, _image, _w * _h * 3);
211
        memmov(EDI._Image.Data, _image_pointer, _w * _h * 3);
Line 210... Line 212...
210
 
212
 
Line 211... Line 213...
211
        encoded_data = encode_image(image_ptr, LIBIMG_FORMAT_PNG, 0, #encoded_size);
213
        encoded_data = encode_image(image_ptr, LIBIMG_FORMAT_PNG, 0, #encoded_size);