2 * Scilab ( http://www.scilab.org/ ) - This file is part of Scilab
3 * Copyright (C) 2013 - Scilab Enterprises - Calixte DENIZET
5 * This file must be used under the terms of the CeCILL.
6 * This source file is licensed as described in the file COPYING, which
7 * you should have received as part of this distribution. The terms
8 * are also available at
9 * http://www.cecill.info/licences/Licence_CeCILL_V2.1-en.txt
13 /*------------------------------------------------------------------------*/
14 /* file: get_image_type_property.c */
15 /* desc : function to get in Scilab the image_type field of */
16 /* a matplot handle */
17 /*------------------------------------------------------------------------*/
19 #include "setHandleProperty.h"
20 #include "SetProperty.h"
21 #include "getPropertyAssignedValue.h"
23 #include "localization.h"
24 #include "SetPropertyStatus.h"
26 #include "getGraphicObjectProperty.h"
27 #include "graphicObjectProperties.h"
31 /*------------------------------------------------------------------------*/
32 int get_image_type_property(void* _pvCtx, int iObjUID)
35 int * piImagetype = &imagetype;
38 getGraphicObjectProperty(iObjUID, __GO_DATA_MODEL_MATPLOT_IMAGE_TYPE__, jni_int, (void **)&piImagetype);
39 if (piImagetype == NULL)
41 Scierror(999, _("'%s' property does not exist for this handle.\n"), "image_type");
45 itype = (ImageType)imagetype;
50 return sciReturnString(_pvCtx, "rgb");
52 return sciReturnString(_pvCtx, "rgba");
54 return sciReturnString(_pvCtx, "gray");
56 return sciReturnString(_pvCtx, "index");
58 return sciReturnString(_pvCtx, "red");
60 return sciReturnString(_pvCtx, "green");
62 return sciReturnString(_pvCtx, "blue");
63 case MATPLOT_RGB_332 :
64 return sciReturnString(_pvCtx, "rgb332");
65 case MATPLOT_RGB_444 :
66 return sciReturnString(_pvCtx, "rgb444");
67 case MATPLOT_RGBA_4444 :
68 return sciReturnString(_pvCtx, "rgba444");
69 case MATPLOT_RGB_555 :
70 return sciReturnString(_pvCtx, "rgb555");
71 case MATPLOT_RGBA_5551 :
72 return sciReturnString(_pvCtx, "rgba5551");
74 Scierror(999, _("Wrong value for '%s' property.\n"), "image_type");
78 /*------------------------------------------------------------------------*/