Subversion Repositories Kolibri OS

Rev

Rev 6457 | Rev 8545 | Go to most recent revision | Only display areas with differences | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 6457 Rev 6495
1
#ifndef KOLIBRI_LIBIMG_H
1
#ifndef KOLIBRI_LIBIMG_H
2
#define KOLIBRI_LIBIMG_H
2
#define KOLIBRI_LIBIMG_H
3
 
3
 
4
int kolibri_libimg_init(void)
-
 
5
{
-
 
6
  int asm_init_status = init_libimg_asm();
-
 
7
  
-
 
8
  /* just return asm_init_status? or return init_libimg_asm() ?*/
-
 
9
 
-
 
10
  if(asm_init_status == 0)
-
 
11
    return 0;
-
 
12
  else
-
 
13
    return 1;
-
 
14
}
4
extern int kolibri_libimg_init(void);
15
 
5
 
16
//list of format id's
6
//list of format id's
17
#define LIBIMG_FORMAT_BMP       1
7
#define LIBIMG_FORMAT_BMP       1
18
#define LIBIMG_FORMAT_ICO       2
8
#define LIBIMG_FORMAT_ICO       2
19
#define LIBIMG_FORMAT_CUR       3
9
#define LIBIMG_FORMAT_CUR       3
20
#define LIBIMG_FORMAT_GIF       4
10
#define LIBIMG_FORMAT_GIF       4
21
#define LIBIMG_FORMAT_PNG       5
11
#define LIBIMG_FORMAT_PNG       5
22
#define LIBIMG_FORMAT_JPEG      6
12
#define LIBIMG_FORMAT_JPEG      6
23
#define LIBIMG_FORMAT_TGA       7
13
#define LIBIMG_FORMAT_TGA       7
24
#define LIBIMG_FORMAT_PCX       8
14
#define LIBIMG_FORMAT_PCX       8
25
#define LIBIMG_FORMAT_XCF       9
15
#define LIBIMG_FORMAT_XCF       9
26
#define LIBIMG_FORMAT_TIFF      10
16
#define LIBIMG_FORMAT_TIFF      10
27
#define LIBIMG_FORMAT_PNM       11
17
#define LIBIMG_FORMAT_PNM       11
28
#define LIBIMG_FORMAT_WBMP      12
18
#define LIBIMG_FORMAT_WBMP      12
29
#define LIBIMG_FORMAT_XBM       13
19
#define LIBIMG_FORMAT_XBM       13
30
#define LIBIMG_FORMAT_Z80       14
20
#define LIBIMG_FORMAT_Z80       14
31
 
21
 
32
//error codes
22
//error codes
33
#define LIBIMG_ERROR_OUT_OF_MEMORY      1
23
#define LIBIMG_ERROR_OUT_OF_MEMORY      1
34
#define LIBIMG_ERROR_FORMAT             2
24
#define LIBIMG_ERROR_FORMAT             2
35
#define LIBIMG_ERROR_CONDITIONS         3
25
#define LIBIMG_ERROR_CONDITIONS         3
36
#define LIBIMG_ERROR_BIT_DEPTH          4
26
#define LIBIMG_ERROR_BIT_DEPTH          4
37
#define LIBIMG_ERROR_ENCODER            5
27
#define LIBIMG_ERROR_ENCODER            5
38
#define LIBIMG_ERROR_SRC_TYPE           6
28
#define LIBIMG_ERROR_SRC_TYPE           6
39
#define LIBIMG_ERROR_SCALE              7
29
#define LIBIMG_ERROR_SCALE              7
40
#define LIBIMG_ERROR_INTER              8
30
#define LIBIMG_ERROR_INTER              8
41
#define LIBIMG_ERROR_NOT_INPLEMENTED    9
31
#define LIBIMG_ERROR_NOT_INPLEMENTED    9
42
#define LIBIMG_ERROR_INVALID_INPUT      10
32
#define LIBIMG_ERROR_INVALID_INPUT      10
43
 
33
 
44
//encode flags (byte 0x02 of _common option)
34
//encode flags (byte 0x02 of _common option)
45
#define LIBIMG_ENCODE_STRICT_SPECIFIC   0x01
35
#define LIBIMG_ENCODE_STRICT_SPECIFIC   0x01
46
#define LIBIMG_ENCODE_STRICT_BIT_DEPTH  0x02
36
#define LIBIMG_ENCODE_STRICT_BIT_DEPTH  0x02
47
#define LIBIMG_ENCODE_DELETE_ALPHA      0x08
37
#define LIBIMG_ENCODE_DELETE_ALPHA      0x08
48
#define LIBIMG_ENCODE_FLUSH_ALPHA       0x10
38
#define LIBIMG_ENCODE_FLUSH_ALPHA       0x10
49
 
39
 
50
 
40
 
51
#define FLIP_VERTICAL   0x01
41
#define FLIP_VERTICAL   0x01
52
#define FLIP_HORIZONTAL 0x02
42
#define FLIP_HORIZONTAL 0x02
53
 
43
 
54
#define ROTATE_90_CW    0x01
44
#define ROTATE_90_CW    0x01
55
#define ROTATE_180      0x02
45
#define ROTATE_180      0x02
56
#define ROTATE_270_CW   0x03
46
#define ROTATE_270_CW   0x03
57
#define ROTATE_90_CCW   ROTATE_270_CW
47
#define ROTATE_90_CCW   ROTATE_270_CW
58
#define ROTATE_270_CCW  ROTATE_90_CW
48
#define ROTATE_270_CCW  ROTATE_90_CW
59
 
49
 
60
extern void* (*img_decode)(void *, uint32_t, uint32_t) __attribute__((__stdcall__));
50
extern void* (*img_decode)(void *, uint32_t, uint32_t) __attribute__((__stdcall__));
61
extern void* (*img_encode)(void *, uint32_t, uint32_t) __attribute__((__stdcall__));
51
extern void* (*img_encode)(void *, uint32_t, uint32_t) __attribute__((__stdcall__));
62
extern void* (*img_create)(uint32_t, uint32_t, uint32_t) __attribute__((__stdcall__));
52
extern void* (*img_create)(uint32_t, uint32_t, uint32_t) __attribute__((__stdcall__));
63
extern void (*img_to_rgb2)(void *, void *) __attribute__((__stdcall__));
53
extern void (*img_to_rgb2)(void *, void *) __attribute__((__stdcall__));
64
extern void* (*img_to_rgb)(void *) __attribute__((__stdcall__));
54
extern void* (*img_to_rgb)(void *) __attribute__((__stdcall__));
65
extern uint32_t (*img_flip)(void *, uint32_t) __attribute__((__stdcall__));
55
extern uint32_t (*img_flip)(void *, uint32_t) __attribute__((__stdcall__));
66
extern uint32_t (*img_flip_layer)(void *, uint32_t) __attribute__((__stdcall__));
56
extern uint32_t (*img_flip_layer)(void *, uint32_t) __attribute__((__stdcall__));
67
extern uint32_t (*img_rotate)(void *, uint32_t) __attribute__((__stdcall__));
57
extern uint32_t (*img_rotate)(void *, uint32_t) __attribute__((__stdcall__));
68
extern uint32_t (*img_rotate_layer)(void *, uint32_t) __attribute__((__stdcall__));
58
extern uint32_t (*img_rotate_layer)(void *, uint32_t) __attribute__((__stdcall__));
69
extern void (*img_draw)(void *, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t	) __attribute__((__stdcall__));
59
extern void (*img_draw)(void *, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t, uint32_t	) __attribute__((__stdcall__));
70
extern uint32_t (*img_count)(void *) __attribute__((__stdcall__));
60
extern uint32_t (*img_count)(void *) __attribute__((__stdcall__));
71
extern uint32_t (*img_destroy)(void *) __attribute__((__stdcall__));
61
extern uint32_t (*img_destroy)(void *) __attribute__((__stdcall__));
72
extern uint32_t (*img_destroy_layer)(void *) __attribute__((__stdcall__));
62
extern uint32_t (*img_destroy_layer)(void *) __attribute__((__stdcall__));
73
 
63
 
74
#endif /* KOLIBRI_LIBIMG_H */
64
#endif /* KOLIBRI_LIBIMG_H */