@@ -19918,6 +19918,53 @@ int lua_cocos2dx_Image_hasPremultipliedAlpha(lua_State* tolua_S)
19918
19918
19919
19919
return 0;
19920
19920
}
19921
+ int lua_cocos2dx_Image_reversePremultipliedAlpha(lua_State* tolua_S)
19922
+ {
19923
+ int argc = 0;
19924
+ cocos2d::Image* cobj = nullptr;
19925
+ bool ok = true;
19926
+
19927
+ #if COCOS2D_DEBUG >= 1
19928
+ tolua_Error tolua_err;
19929
+ #endif
19930
+
19931
+
19932
+ #if COCOS2D_DEBUG >= 1
19933
+ if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
19934
+ #endif
19935
+
19936
+ cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);
19937
+
19938
+ #if COCOS2D_DEBUG >= 1
19939
+ if (!cobj)
19940
+ {
19941
+ tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
19942
+ return 0;
19943
+ }
19944
+ #endif
19945
+
19946
+ argc = lua_gettop(tolua_S)-1;
19947
+ if (argc == 0)
19948
+ {
19949
+ if(!ok)
19950
+ {
19951
+ tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'", nullptr);
19952
+ return 0;
19953
+ }
19954
+ cobj->reversePremultipliedAlpha();
19955
+ lua_settop(tolua_S, 1);
19956
+ return 1;
19957
+ }
19958
+ luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:reversePremultipliedAlpha",argc, 0);
19959
+ return 0;
19960
+
19961
+ #if COCOS2D_DEBUG >= 1
19962
+ tolua_lerror:
19963
+ tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_reversePremultipliedAlpha'.",&tolua_err);
19964
+ #endif
19965
+
19966
+ return 0;
19967
+ }
19921
19968
int lua_cocos2dx_Image_saveToFile(lua_State* tolua_S)
19922
19969
{
19923
19970
int argc = 0;
@@ -20126,6 +20173,53 @@ int lua_cocos2dx_Image_getHeight(lua_State* tolua_S)
20126
20173
20127
20174
return 0;
20128
20175
}
20176
+ int lua_cocos2dx_Image_premultiplyAlpha(lua_State* tolua_S)
20177
+ {
20178
+ int argc = 0;
20179
+ cocos2d::Image* cobj = nullptr;
20180
+ bool ok = true;
20181
+
20182
+ #if COCOS2D_DEBUG >= 1
20183
+ tolua_Error tolua_err;
20184
+ #endif
20185
+
20186
+
20187
+ #if COCOS2D_DEBUG >= 1
20188
+ if (!tolua_isusertype(tolua_S,1,"cc.Image",0,&tolua_err)) goto tolua_lerror;
20189
+ #endif
20190
+
20191
+ cobj = (cocos2d::Image*)tolua_tousertype(tolua_S,1,0);
20192
+
20193
+ #if COCOS2D_DEBUG >= 1
20194
+ if (!cobj)
20195
+ {
20196
+ tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
20197
+ return 0;
20198
+ }
20199
+ #endif
20200
+
20201
+ argc = lua_gettop(tolua_S)-1;
20202
+ if (argc == 0)
20203
+ {
20204
+ if(!ok)
20205
+ {
20206
+ tolua_error(tolua_S,"invalid arguments in function 'lua_cocos2dx_Image_premultiplyAlpha'", nullptr);
20207
+ return 0;
20208
+ }
20209
+ cobj->premultiplyAlpha();
20210
+ lua_settop(tolua_S, 1);
20211
+ return 1;
20212
+ }
20213
+ luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.Image:premultiplyAlpha",argc, 0);
20214
+ return 0;
20215
+
20216
+ #if COCOS2D_DEBUG >= 1
20217
+ tolua_lerror:
20218
+ tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_Image_premultiplyAlpha'.",&tolua_err);
20219
+ #endif
20220
+
20221
+ return 0;
20222
+ }
20129
20223
int lua_cocos2dx_Image_initWithImageFile(lua_State* tolua_S)
20130
20224
{
20131
20225
int argc = 0;
@@ -20581,10 +20675,12 @@ int lua_register_cocos2dx_Image(lua_State* tolua_S)
20581
20675
tolua_beginmodule(tolua_S,"Image");
20582
20676
tolua_function(tolua_S,"new",lua_cocos2dx_Image_constructor);
20583
20677
tolua_function(tolua_S,"hasPremultipliedAlpha",lua_cocos2dx_Image_hasPremultipliedAlpha);
20678
+ tolua_function(tolua_S,"reversePremultipliedAlpha",lua_cocos2dx_Image_reversePremultipliedAlpha);
20584
20679
tolua_function(tolua_S,"saveToFile",lua_cocos2dx_Image_saveToFile);
20585
20680
tolua_function(tolua_S,"hasAlpha",lua_cocos2dx_Image_hasAlpha);
20586
20681
tolua_function(tolua_S,"isCompressed",lua_cocos2dx_Image_isCompressed);
20587
20682
tolua_function(tolua_S,"getHeight",lua_cocos2dx_Image_getHeight);
20683
+ tolua_function(tolua_S,"premultiplyAlpha",lua_cocos2dx_Image_premultiplyAlpha);
20588
20684
tolua_function(tolua_S,"initWithImageFile",lua_cocos2dx_Image_initWithImageFile);
20589
20685
tolua_function(tolua_S,"getWidth",lua_cocos2dx_Image_getWidth);
20590
20686
tolua_function(tolua_S,"getBitPerPixel",lua_cocos2dx_Image_getBitPerPixel);
@@ -78809,6 +78905,117 @@ int lua_cocos2dx_RenderTexture_isAutoDraw(lua_State* tolua_S)
78809
78905
78810
78906
return 0;
78811
78907
}
78908
+ int lua_cocos2dx_RenderTexture_saveToFileAsNonPMA(lua_State* tolua_S)
78909
+ {
78910
+ int argc = 0;
78911
+ cocos2d::RenderTexture* cobj = nullptr;
78912
+ bool ok = true;
78913
+ #if COCOS2D_DEBUG >= 1
78914
+ tolua_Error tolua_err;
78915
+ #endif
78916
+
78917
+ #if COCOS2D_DEBUG >= 1
78918
+ if (!tolua_isusertype(tolua_S,1,"cc.RenderTexture",0,&tolua_err)) goto tolua_lerror;
78919
+ #endif
78920
+ cobj = (cocos2d::RenderTexture*)tolua_tousertype(tolua_S,1,0);
78921
+ #if COCOS2D_DEBUG >= 1
78922
+ if (!cobj)
78923
+ {
78924
+ tolua_error(tolua_S,"invalid 'cobj' in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'", nullptr);
78925
+ return 0;
78926
+ }
78927
+ #endif
78928
+ argc = lua_gettop(tolua_S)-1;
78929
+ do{
78930
+ if (argc == 4) {
78931
+ std::string arg0;
78932
+ ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78933
+
78934
+ if (!ok) { break; }
78935
+ cocos2d::Image::Format arg1;
78936
+ ok &= luaval_to_int32(tolua_S, 3,(int *)&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78937
+
78938
+ if (!ok) { break; }
78939
+ bool arg2;
78940
+ ok &= luaval_to_boolean(tolua_S, 4,&arg2, "cc.RenderTexture:saveToFileAsNonPMA");
78941
+
78942
+ if (!ok) { break; }
78943
+ std::function<void (cocos2d::RenderTexture *, const std::string&)> arg3;
78944
+ do {
78945
+ // Lambda binding for lua is not supported.
78946
+ assert(false);
78947
+ } while(0)
78948
+ ;
78949
+
78950
+ if (!ok) { break; }
78951
+ bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2, arg3);
78952
+ tolua_pushboolean(tolua_S,(bool)ret);
78953
+ return 1;
78954
+ }
78955
+ }while(0);
78956
+ ok = true;
78957
+ do{
78958
+ if (argc == 1) {
78959
+ std::string arg0;
78960
+ ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78961
+
78962
+ if (!ok) { break; }
78963
+ bool ret = cobj->saveToFileAsNonPMA(arg0);
78964
+ tolua_pushboolean(tolua_S,(bool)ret);
78965
+ return 1;
78966
+ }
78967
+ }while(0);
78968
+ ok = true;
78969
+ do{
78970
+ if (argc == 2) {
78971
+ std::string arg0;
78972
+ ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78973
+
78974
+ if (!ok) { break; }
78975
+ bool arg1;
78976
+ ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78977
+
78978
+ if (!ok) { break; }
78979
+ bool ret = cobj->saveToFileAsNonPMA(arg0, arg1);
78980
+ tolua_pushboolean(tolua_S,(bool)ret);
78981
+ return 1;
78982
+ }
78983
+ }while(0);
78984
+ ok = true;
78985
+ do{
78986
+ if (argc == 3) {
78987
+ std::string arg0;
78988
+ ok &= luaval_to_std_string(tolua_S, 2,&arg0, "cc.RenderTexture:saveToFileAsNonPMA");
78989
+
78990
+ if (!ok) { break; }
78991
+ bool arg1;
78992
+ ok &= luaval_to_boolean(tolua_S, 3,&arg1, "cc.RenderTexture:saveToFileAsNonPMA");
78993
+
78994
+ if (!ok) { break; }
78995
+ std::function<void (cocos2d::RenderTexture *, const std::string&)> arg2;
78996
+ do {
78997
+ // Lambda binding for lua is not supported.
78998
+ assert(false);
78999
+ } while(0)
79000
+ ;
79001
+
79002
+ if (!ok) { break; }
79003
+ bool ret = cobj->saveToFileAsNonPMA(arg0, arg1, arg2);
79004
+ tolua_pushboolean(tolua_S,(bool)ret);
79005
+ return 1;
79006
+ }
79007
+ }while(0);
79008
+ ok = true;
79009
+ luaL_error(tolua_S, "%s has wrong number of arguments: %d, was expecting %d \n", "cc.RenderTexture:saveToFileAsNonPMA",argc, 1);
79010
+ return 0;
79011
+
79012
+ #if COCOS2D_DEBUG >= 1
79013
+ tolua_lerror:
79014
+ tolua_error(tolua_S,"#ferror in function 'lua_cocos2dx_RenderTexture_saveToFileAsNonPMA'.",&tolua_err);
79015
+ #endif
79016
+
79017
+ return 0;
79018
+ }
78812
79019
int lua_cocos2dx_RenderTexture_setKeepMatrix(lua_State* tolua_S)
78813
79020
{
78814
79021
int argc = 0;
@@ -79891,6 +80098,7 @@ int lua_register_cocos2dx_RenderTexture(lua_State* tolua_S)
79891
80098
tolua_function(tolua_S,"setSprite",lua_cocos2dx_RenderTexture_setSprite);
79892
80099
tolua_function(tolua_S,"getSprite",lua_cocos2dx_RenderTexture_getSprite);
79893
80100
tolua_function(tolua_S,"isAutoDraw",lua_cocos2dx_RenderTexture_isAutoDraw);
80101
+ tolua_function(tolua_S,"saveToFileAsNonPMA",lua_cocos2dx_RenderTexture_saveToFileAsNonPMA);
79894
80102
tolua_function(tolua_S,"setKeepMatrix",lua_cocos2dx_RenderTexture_setKeepMatrix);
79895
80103
tolua_function(tolua_S,"setClearFlags",lua_cocos2dx_RenderTexture_setClearFlags);
79896
80104
tolua_function(tolua_S,"begin",lua_cocos2dx_RenderTexture_begin);
0 commit comments