| 70 | */ |
| 71 | |
| 72 | static void PushImageParameters(lua_State* L, dmImage::Image image) |
| 73 | { |
| 74 | lua_pushliteral(L, "width"); |
| 75 | lua_pushinteger(L, image.m_Width); |
| 76 | lua_rawset(L, -3); |
| 77 | |
| 78 | lua_pushliteral(L, "height"); |
| 79 | lua_pushinteger(L, image.m_Height); |
| 80 | lua_rawset(L, -3); |
| 81 | |
| 82 | lua_pushliteral(L, "type"); |
| 83 | switch (image.m_Type) { |
| 84 | case dmImage::TYPE_RGB: |
| 85 | lua_pushliteral(L, "rgb"); |
| 86 | break; |
| 87 | case dmImage::TYPE_RGBA: |
| 88 | lua_pushliteral(L, "rgba"); |
| 89 | break; |
| 90 | case dmImage::TYPE_LUMINANCE: |
| 91 | lua_pushliteral(L, "l"); |
| 92 | break; |
| 93 | case dmImage::TYPE_LUMINANCE_ALPHA: |
| 94 | lua_pushliteral(L, "la"); |
| 95 | break; |
| 96 | default: |
| 97 | assert(false); |
| 98 | } |
| 99 | lua_rawset(L, -3); |
| 100 | } |
| 101 | |
| 102 | /*# load image from buffer |
| 103 | * Load image (PNG or JPEG) from buffer. |
no test coverage detected