Update RingRayLib - raylib.c - Add Function : Color *ImageExtractPalette(Image image, int maxPaletteSize, int *extractCount)
@@ -3126,6 +3126,27 @@ RING_FUNC(ring_ImageDither)
ImageDither((Image *) RING_API_GETCPOINTER(1,"Image"), (int ) RING_API_GETNUMBER(2), (int ) RING_API_GETNUMBER(3), (int ) RING_API_GETNUMBER(4), (int ) RING_API_GETNUMBER(5));
}
+
+RING_FUNC(ring_ImageExtractPalette)
+{
+ if ( RING_API_PARACOUNT != 3 ) {
+ RING_API_ERROR(RING_API_MISS3PARA);
+ return ;
+ }
+ if ( ! RING_API_ISNUMBER(2) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ if ( ! RING_API_ISSTRING(3) ) {
+ RING_API_ERROR(RING_API_BADPARATYPE);
+ return ;
+ }
+ RING_API_RETCPOINTER(ImageExtractPalette(* (Image *) RING_API_GETCPOINTER(1,"Image"), (int ) RING_API_GETNUMBER(2),RING_API_GETINTPOINTER(3)),"Color");
+ if (RING_API_ISCPOINTERNOTASSIGNED(1))
+ ring_state_free(((VM *) pPointer)->pRingState,RING_API_GETCPOINTER(1,"Image"));
+ RING_API_ACCEPTINTVALUE(3) ;
+}
+
RING_API void ringlib_init(RingState *pRingState)
{
ring_vm_funcregister("initwindow",ring_InitWindow);
@@ -3321,4 +3342,5 @@ RING_API void ringlib_init(RingState *pRingState)
ring_vm_funcregister("imageresizecanvas",ring_ImageResizeCanvas);
ring_vm_funcregister("imagemipmaps",ring_ImageMipmaps);
ring_vm_funcregister("imagedither",ring_ImageDither);
+ ring_vm_funcregister("imageextractpalette",ring_ImageExtractPalette);
}
