Logo Search packages:      
Sourcecode: inkscape version File versions  Download package

static void sp_feDisplacementMap_build ( SPObject object,
SPDocument document,
Inkscape::XML::Node repr 
) [static]

Reads the Inkscape::XML::Node, and initializes SPFeDisplacementMap variables. For this to get called, our name must be associated with a repr via "sp_object_type_register". Best done through sp-object-repr.cpp's repr_name_entries array.

Definition at line 93 of file displacementmap.cpp.

References SPFeDisplacementMap::in2, Inkscape::XML::Node::setAttribute(), sp_filter_name_for_image(), sp_filter_primitive_name_previous_out(), and sp_object_read_attr().

{
    if (((SPObjectClass *) feDisplacementMap_parent_class)->build) {
        ((SPObjectClass *) feDisplacementMap_parent_class)->build(object, document, repr);
    }

    /*LOAD ATTRIBUTES FROM REPR HERE*/
    sp_object_read_attr(object, "scale");
    sp_object_read_attr(object, "in2");
    sp_object_read_attr(object, "xChannelSelector");
    sp_object_read_attr(object, "yChannelSelector");

    /* Unlike normal in, in2 is required attribute. Make sure, we can call
     * it by some name. */
    SPFeDisplacementMap *disp = SP_FEDISPLACEMENTMAP(object);
    if (disp->in2 == Inkscape::Filters::NR_FILTER_SLOT_NOT_SET ||
        disp->in2 == Inkscape::Filters::NR_FILTER_UNNAMED_SLOT)
    {
        SPFilter *parent = SP_FILTER(object->parent);
        disp->in2 = sp_filter_primitive_name_previous_out(disp);
        repr->setAttribute("in2", sp_filter_name_for_image(parent, disp->in2));
    }
}

Here is the call graph for this function:


Generated by  Doxygen 1.6.0   Back to index