Ignore:
Timestamp:
Mar 11, 2015 3:11:07 AM (9 years ago)
Author:
ldelgass
Message:

Add legend option for blending against a background color

File:
1 edited

Legend:

Unmodified
Added
Removed
  • geovis/trunk/RendererCmd.cpp

    r5118 r5119  
    743743          Tcl_Obj *const *objv)
    744744{
    745     if (objc != 4) {
     745    if (objc < 4) {
    746746        Tcl_AppendResult(interp, "wrong # args: should be \"",
    747747                Tcl_GetString(objv[0]), " colormapName width height\"", (char*)NULL);
     
    755755        return TCL_ERROR;
    756756    }
    757 
    758757    bool opaque = true;
     758    if (objc > 4) {
     759        if (GetBooleanFromObj(interp, objv[4], &opaque) != TCL_OK) {
     760            return TCL_ERROR;
     761        }
     762    }
    759763    float bgColor[3];
    760     memset(bgColor, 0, sizeof(float)*3);
     764    if (objc > 5) {
     765        if (GetFloatFromObj(interp, objv[5], &bgColor[0]) != TCL_OK ||
     766            GetFloatFromObj(interp, objv[6], &bgColor[1]) != TCL_OK ||
     767            GetFloatFromObj(interp, objv[7], &bgColor[2]) != TCL_OK) {
     768            return TCL_ERROR;
     769        }
     770    } else {
     771        memset(bgColor, 0, sizeof(float)*3);
     772    }
    761773    osg::ref_ptr<osg::Image> imgData = new osg::Image();
    762774
Note: See TracChangeset for help on using the changeset viewer.