Subversion Repositories Kolibri OS

Rev

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

Rev 7049 Rev 7190
Line 28... Line 28...
28
dword img_is_img  = #aimg_is_img;
28
dword img_is_img  = #aimg_is_img;
29
dword img_to_rgb2 = #aimg_to_rgb2;
29
dword img_to_rgb2 = #aimg_to_rgb2;
30
dword img_decode  = #aimg_decode;
30
dword img_decode  = #aimg_decode;
31
dword img_destroy = #aimg_destroy;
31
dword img_destroy = #aimg_destroy;
32
dword img_draw    = #aimg_draw;
32
dword img_draw    = #aimg_draw;
-
 
33
dword img_create    = #aimg_create;
-
 
34
dword img_encode   = #aimg_encode;
-
 
35
 
33
//dword img_flip    = #aimg_flip;
36
//dword img_flip    = #aimg_flip;
34
//dword img_rotate  = #aimg_rotate;
37
//dword img_rotate  = #aimg_rotate;
35
$DD 2 dup 0
38
$DD 2 dup 0
Line 36... Line 39...
36
 
39
 
Line 39... Line 42...
39
char aimg_is_img[11]  = "img_is_img\0";
42
char aimg_is_img[11]  = "img_is_img\0";
40
char aimg_to_rgb2[12] = "img_to_rgb2\0";
43
char aimg_to_rgb2[12] = "img_to_rgb2\0";
41
char aimg_decode[11]  = "img_decode\0";
44
char aimg_decode[11]  = "img_decode\0";
42
char aimg_destroy[12] = "img_destroy\0";
45
char aimg_destroy[12] = "img_destroy\0";
43
char aimg_draw[9]    = "img_draw\0";
46
char aimg_draw[9]    = "img_draw\0";
-
 
47
char aimg_create[11]    = "img_create\0";
-
 
48
char aimg_encode[11]    = "img_encode\0";
44
//char aimg_flip[9]    = "img_flip\0";
49
//char aimg_flip[9]    = "img_flip\0";
45
//char aimg_rotate[11]  = "img_rotate\0 ";
50
//char aimg_rotate[11]  = "img_rotate\0 ";
Line -... Line 51...
-
 
51
 
-
 
52
#define LIBIMG_FORMAT_BMP       1
-
 
53
#define LIBIMG_FORMAT_ICO       2
-
 
54
#define LIBIMG_FORMAT_CUR       3
-
 
55
#define LIBIMG_FORMAT_GIF       4
-
 
56
#define LIBIMG_FORMAT_PNG       5
-
 
57
#define LIBIMG_FORMAT_JPEG      6
-
 
58
#define LIBIMG_FORMAT_TGA       7
-
 
59
#define LIBIMG_FORMAT_PCX       8
-
 
60
#define LIBIMG_FORMAT_XCF       9
-
 
61
#define LIBIMG_FORMAT_TIFF     10
-
 
62
#define LIBIMG_FORMAT_PNM      11
-
 
63
#define LIBIMG_FORMAT_WBMP     12
-
 
64
#define LIBIMG_FORMAT_XBM      13
-
 
65
#define LIBIMG_FORMAT_Z80      14
-
 
66
 
-
 
67
struct _Image
-
 
68
{
-
 
69
   dword Checksum; // ((Width ROL 16) OR Height) XOR Data[0]        ; ignored so far
-
 
70
   dword Width;
-
 
71
   dword Height;
-
 
72
   dword Next;
-
 
73
   dword Previous;
-
 
74
   dword Type;     // one of Image.bppN
-
 
75
   dword Data;
-
 
76
   dword Palette;  // used iff Type eq Image.bpp1, Image.bpp2, Image.bpp4 or Image.bpp8i
-
 
77
   dword Extended;
-
 
78
   dword Flags;    // bitfield
-
 
79
   dword Delay;    // used iff Image.IsAnimated is set in Flags
-
 
80
};
-
 
81
 
-
 
82
// values for Image.Type
-
 
83
// must be consecutive to allow fast switch on Image.Type in support functions
-
 
84
#define Image_bpp8i  1  // indexed
-
 
85
#define Image_bpp24  2
-
 
86
#define Image_bpp32  3
-
 
87
#define Image_bpp15  4
-
 
88
#define Image_bpp16  5
-
 
89
#define Image_bpp1   6
-
 
90
#define Image_bpp8g  7  // grayscale
-
 
91
#define Image_bpp2i  8
-
 
92
#define Image_bpp4i  9
Line 46... Line 93...
46
 
93
#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
47
 
94
 
48
 
95
 
Line 131... Line 178...
131
        offx, 
178
        offx, 
132
        offy
179
        offy
133
    );  
180
    );  
134
}
181
}
Line -... Line 182...
-
 
182
 
-
 
183
dword create_image(dword type, dword width, dword height) {
-
 
184
	img_create stdcall(width, height, type);
-
 
185
	return EAX;
-
 
186
}
-
 
187
 
-
 
188
// size - output parameter, error code / the size of encoded data
-
 
189
dword encode_image(dword image_ptr, dword options, dword specific_options, dword* size) {
-
 
190
	img_encode stdcall(image_ptr, options, specific_options);
-
 
191
	ESDWORD[size] = ECX;
-
 
192
	
-
 
193
	return EAX;
-
 
194
}
135
 
195
 
136
#endif
196
#endif