mirror of
https://github.com/lovell/sharp.git
synced 2025-12-19 07:15:08 +01:00
Expose stylesheet and highBitdepth SVG input params
This commit is contained in:
@@ -101,6 +101,13 @@ namespace sharp {
|
||||
if (HasAttr(input, "page")) {
|
||||
descriptor->page = AttrAsUint32(input, "page");
|
||||
}
|
||||
// SVG
|
||||
if (HasAttr(input, "svgStylesheet")) {
|
||||
descriptor->svgStylesheet = AttrAsStr(input, "svgStylesheet");
|
||||
}
|
||||
if (HasAttr(input, "svgHighBitdepth")) {
|
||||
descriptor->svgHighBitdepth = AttrAsBool(input, "svgHighBitdepth");
|
||||
}
|
||||
// Multi-level input (OpenSlide)
|
||||
if (HasAttr(input, "level")) {
|
||||
descriptor->level = AttrAsUint32(input, "level");
|
||||
@@ -429,6 +436,10 @@ namespace sharp {
|
||||
option->set("n", descriptor->pages);
|
||||
option->set("page", descriptor->page);
|
||||
}
|
||||
if (imageType == ImageType::SVG) {
|
||||
option->set("stylesheet", descriptor->svgStylesheet.data());
|
||||
option->set("high_bitdepth", descriptor->svgHighBitdepth);
|
||||
}
|
||||
if (imageType == ImageType::OPENSLIDE) {
|
||||
option->set("level", descriptor->level);
|
||||
}
|
||||
|
||||
@@ -77,6 +77,8 @@ namespace sharp {
|
||||
std::vector<double> joinBackground;
|
||||
VipsAlign joinHalign;
|
||||
VipsAlign joinValign;
|
||||
std::string svgStylesheet;
|
||||
bool svgHighBitdepth;
|
||||
std::vector<double> pdfBackground;
|
||||
bool jp2Oneshot;
|
||||
|
||||
@@ -121,6 +123,7 @@ namespace sharp {
|
||||
joinBackground{ 0.0, 0.0, 0.0, 255.0 },
|
||||
joinHalign(VIPS_ALIGN_LOW),
|
||||
joinValign(VIPS_ALIGN_LOW),
|
||||
svgHighBitdepth(false),
|
||||
pdfBackground{ 255.0, 255.0, 255.0, 255.0 },
|
||||
jp2Oneshot(false) {}
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user