Subversion Repositories Kolibri OS

Rev

Rev 6456 | Rev 6495 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

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