luat_zbuff.h 530 B

123456789101112131415161718192021
  1. #ifndef LUAT_ZBUFF_H
  2. #define LUAT_ZBUFF_H
  3. #include "luat_msgbus.h"
  4. #define LUAT_ZBUFF_TYPE "ZBUFF*"
  5. #define tozbuff(L) ((luat_zbuff_t *)luaL_checkudata(L, 1, LUAT_ZBUFF_TYPE))
  6. #define ZBUFF_SEEK_SET 0
  7. #define ZBUFF_SEEK_CUR 1
  8. #define ZBUFF_SEEK_END 2
  9. typedef struct luat_zbuff {
  10. uint8_t* addr; //数据存储的地址
  11. size_t len; //数据的长度
  12. size_t cursor; //目前的指针位置
  13. uint32_t width; //宽度
  14. uint32_t height;//高度
  15. uint8_t bit; //色深度
  16. } luat_zbuff_t;
  17. #endif