Index: src/extension/internal/ps.cpp =================================================================== RCS file: /cvsroot/inkscape/inkscape/src/extension/internal/ps.cpp,v retrieving revision 1.54 diff -r1.54 ps.cpp 57a58,62 > #include > #include > #include > #include > #include 553,558c558,624 < g_return_if_fail(style->fill.type == SP_PAINT_TYPE_COLOR); < < float rgb[3]; < sp_color_get_rgb_floatv(&style->fill.value.color, rgb); < < os << rgb[0] << " " << rgb[1] << " " << rgb[2] << " setrgbcolor\n"; --- > g_return_if_fail(style->fill.type == SP_PAINT_TYPE_COLOR || SP_IS_GRADIENT (SP_STYLE_FILL_SERVER (style))); > > if (style->fill.type == SP_PAINT_TYPE_COLOR) > { > float rgb[3]; > sp_color_get_rgb_floatv(&style->fill.value.color, rgb); > > os << rgb[0] << " " << rgb[1] << " " << rgb[2] << " setrgbcolor\n"; > } else if (SP_IS_GRADIENT (SP_STYLE_FILL_SERVER (style))) { > if (SP_IS_LINEARGRADIENT (SP_STYLE_FILL_SERVER (style))) { > SPLinearGradient *lg=SP_LINEARGRADIENT(SP_STYLE_FILL_SERVER (style)); > os << "<<\n/ShadingType 2\n/ColorSpace /DeviceRGB\n"; > os << "/Coords [" << lg->x1.computed << " " << lg->y1.computed << " " << lg->x2.computed << " " << lg->y2.computed <<"]\n"; > os << "/Extend [true true]\n"; > os << "/Domain [0 1]\n"; > os << "/Function <<\n/FunctionType 3\n/Functions\n[\n"; > for (gint i=0;unsigned(i)vector.stops.size()-1;i++) { > float rgb[3]; > sp_color_get_rgb_floatv(&lg->vector.stops[i].color, rgb); > os << "<<\n/FunctionType 2\n/Domain [0 1]\n"; > os << "/C0 [" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "]\n"; > sp_color_get_rgb_floatv(&lg->vector.stops[i+1].color, rgb); > os << "/C1 [" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "]\n"; > os << "/N 1\n>>\n"; > } > os << "]\n/Domain [0 1]\n"; > os << "/Bounds [ "; > for (gint i=0;unsigned(i)vector.stops.size()-2;i++) { > os << lg->vector.stops[i+1].offset <<" "; > } > os << "]\n"; > os << "/Encode [ "; > for (gint i=0;unsigned(i)vector.stops.size()-1;i++) { > os << "0 1 "; > } > os << "]\n"; > os << ">>\n>>\n"; > } else if (SP_IS_RADIALGRADIENT (SP_STYLE_FILL_SERVER (style))) { > SPRadialGradient *rg=SP_RADIALGRADIENT(SP_STYLE_FILL_SERVER (style)); > os << "<<\n/ShadingType 3\n/ColorSpace /DeviceRGB\n"; > os << "/Coords ["<fx.computed<<" "<fy.computed<<" 0 "<cx.computed<<" "<cy.computed<<" "<r.computed<<"]\n"; > os << "/Extend [true true]\n"; > os << "/Domain [0 1]\n"; > os << "/Function <<\n/FunctionType 3\n/Functions\n[\n"; > for (gint i=0;unsigned(i)vector.stops.size()-1;i++) { > float rgb[3]; > sp_color_get_rgb_floatv(&rg->vector.stops[i].color, rgb); > os << "<<\n/FunctionType 2\n/Domain [0 1]\n"; > os << "/C0 [" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "]\n"; > sp_color_get_rgb_floatv(&rg->vector.stops[i+1].color, rgb); > os << "/C1 [" << rgb[0] << " " << rgb[1] << " " << rgb[2] << "]\n"; > os << "/N 1\n>>\n"; > } > os << "]\n/Domain [0 1]\n"; > os << "/Bounds [ "; > for (gint i=0;unsigned(i)vector.stops.size()-2;i++) { > os << rg->vector.stops[i+1].offset <<" "; > } > os << "]\n"; > os << "/Encode [ "; > for (gint i=0;unsigned(i)vector.stops.size()-1;i++) { > os << "0 1 "; > } > os << "]\n"; > os << ">>\n>>\n"; > } > } 598c664 < if (style->fill.type == SP_PAINT_TYPE_COLOR) { --- > if (style->fill.type == SP_PAINT_TYPE_COLOR || SP_IS_GRADIENT (SP_STYLE_FILL_SERVER (style))) { 606c672,686 < os << "eofill\n"; --- > if (style->fill.type == SP_PAINT_TYPE_COLOR) { > os << "eofill\n"; > } else if (SP_IS_GRADIENT (SP_STYLE_FILL_SERVER (style))) { > SPGradient *g=SP_GRADIENT(SP_STYLE_FILL_SERVER (style)); > os << "eoclip\n"; > if (g->gradientTransform_set) { > os << "gsave [" << g->gradientTransform[0] << " " << g->gradientTransform[1] > << " " << g->gradientTransform[2] << " " << g->gradientTransform[3] > << " " << g->gradientTransform[4] << " " << g->gradientTransform[5] << "] concat\n"; > } > os << "shfill\n"; > if (g->gradientTransform_set) { > os << "grestore\n"; > } > } 608c688,702 < os << "fill\n"; --- > if (style->fill.type == SP_PAINT_TYPE_COLOR) { > os << "fill\n"; > } else if (SP_IS_GRADIENT (SP_STYLE_FILL_SERVER (style))) { > SPGradient *g=SP_GRADIENT(SP_STYLE_FILL_SERVER (style)); > os << "clip\n"; > if (g->gradientTransform_set) { > os << "gsave [" << g->gradientTransform[0] << " " << g->gradientTransform[1] > << " " << g->gradientTransform[2] << " " << g->gradientTransform[3] > << " " << g->gradientTransform[4] << " " << g->gradientTransform[5] << "] concat\n"; > } > os << "shfill\n"; > if (g->gradientTransform_set) { > os << "grestore\n"; > } > } 611c705 < } --- > }