xberg 1.4.2 → 1.5.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/THIRD_PARTY_LICENSES.md +38205 -0
- data/ext/xberg_rb/native/Cargo.lock +128 -124
- data/ext/xberg_rb/native/Cargo.toml +10 -7
- data/ext/xberg_rb/src/lib.rs +2873 -2
- data/lib/xberg/native.rb +75 -1
- data/lib/xberg/version.rb +2 -2
- data/sig/types.rbs +201 -5
- metadata +3 -2
data/ext/xberg_rb/src/lib.rs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// This file is auto-generated by alef. DO NOT EDIT.
|
|
2
|
-
// alef:hash:
|
|
2
|
+
// alef:hash:0deae07d0e54bb41bbdee252d8a189cf5cc77b2fec61208fac191e0a4bb9cce6
|
|
3
3
|
// Re-generate with: alef generate
|
|
4
4
|
#![allow(dead_code, unused_imports, unused_variables)]
|
|
5
5
|
#![allow(
|
|
@@ -200,6 +200,85 @@ impl AccelerationConfig {
|
|
|
200
200
|
}
|
|
201
201
|
}
|
|
202
202
|
|
|
203
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
204
|
+
#[serde(default)]
|
|
205
|
+
#[magnus::wrap(class = "Xberg::AnnotationPoint")]
|
|
206
|
+
pub struct AnnotationPoint {
|
|
207
|
+
x: f64,
|
|
208
|
+
y: f64,
|
|
209
|
+
}
|
|
210
|
+
|
|
211
|
+
unsafe impl IntoValueFromNative for AnnotationPoint {}
|
|
212
|
+
|
|
213
|
+
impl magnus::TryConvert for AnnotationPoint {
|
|
214
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
215
|
+
if let Ok(r) = <&AnnotationPoint as magnus::TryConvert>::try_convert(val) {
|
|
216
|
+
return Ok(r.clone());
|
|
217
|
+
}
|
|
218
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
219
|
+
s
|
|
220
|
+
} else {
|
|
221
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
222
|
+
magnus::Error::new(
|
|
223
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
224
|
+
format!("no implicit conversion into AnnotationPoint: {}", e),
|
|
225
|
+
)
|
|
226
|
+
})?
|
|
227
|
+
};
|
|
228
|
+
serde_json::from_str::<AnnotationPoint>(&json_str).map_err(|e| {
|
|
229
|
+
magnus::Error::new(
|
|
230
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
231
|
+
format!("failed to deserialize AnnotationPoint: {}", e),
|
|
232
|
+
)
|
|
233
|
+
})
|
|
234
|
+
}
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
unsafe impl TryConvertOwned for AnnotationPoint {}
|
|
238
|
+
|
|
239
|
+
impl Default for AnnotationPoint {
|
|
240
|
+
fn default() -> Self {
|
|
241
|
+
xberg::AnnotationPoint::default().into()
|
|
242
|
+
}
|
|
243
|
+
}
|
|
244
|
+
|
|
245
|
+
impl AnnotationPoint {
|
|
246
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
247
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
248
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
249
|
+
let (kwargs_opt,) = args.optional;
|
|
250
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
251
|
+
Ok(Self {
|
|
252
|
+
x: match kwargs.get(ruby.to_symbol("x")) {
|
|
253
|
+
Some(v) => f64::try_convert(v).map_err(|e| {
|
|
254
|
+
magnus::Error::new(
|
|
255
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
256
|
+
format!("invalid value for `x`: {}", e),
|
|
257
|
+
)
|
|
258
|
+
})?,
|
|
259
|
+
None => Default::default(),
|
|
260
|
+
},
|
|
261
|
+
y: match kwargs.get(ruby.to_symbol("y")) {
|
|
262
|
+
Some(v) => f64::try_convert(v).map_err(|e| {
|
|
263
|
+
magnus::Error::new(
|
|
264
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
265
|
+
format!("invalid value for `y`: {}", e),
|
|
266
|
+
)
|
|
267
|
+
})?,
|
|
268
|
+
None => Default::default(),
|
|
269
|
+
},
|
|
270
|
+
})
|
|
271
|
+
}
|
|
272
|
+
|
|
273
|
+
fn x(&self) -> f64 {
|
|
274
|
+
self.x
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
fn y(&self) -> f64 {
|
|
278
|
+
self.y
|
|
279
|
+
}
|
|
280
|
+
}
|
|
281
|
+
|
|
203
282
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
204
283
|
#[magnus::wrap(class = "Xberg::ArchiveEntry")]
|
|
205
284
|
pub struct ArchiveEntry {
|
|
@@ -4349,6 +4428,7 @@ pub struct ConversionOptions {
|
|
|
4349
4428
|
infer_dimensions: bool,
|
|
4350
4429
|
max_depth: Option<usize>,
|
|
4351
4430
|
exclude_selectors: Vec<String>,
|
|
4431
|
+
data_as_elements: Option<Vec<String>>,
|
|
4352
4432
|
tier_strategy: TierStrategy,
|
|
4353
4433
|
base_url: Option<String>,
|
|
4354
4434
|
}
|
|
@@ -4817,6 +4897,15 @@ impl ConversionOptions {
|
|
|
4817
4897
|
})?,
|
|
4818
4898
|
None => Default::default(),
|
|
4819
4899
|
},
|
|
4900
|
+
data_as_elements: match kwargs.get(ruby.to_symbol("data_as_elements")).filter(|v| !v.is_nil()) {
|
|
4901
|
+
Some(v) => Some(<Vec<String>>::try_convert(v).map_err(|e| {
|
|
4902
|
+
magnus::Error::new(
|
|
4903
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
4904
|
+
format!("invalid value for `data_as_elements`: {}", e),
|
|
4905
|
+
)
|
|
4906
|
+
})?),
|
|
4907
|
+
None => None,
|
|
4908
|
+
},
|
|
4820
4909
|
tier_strategy: match kwargs.get(ruby.to_symbol("tier_strategy")) {
|
|
4821
4910
|
Some(v) => TierStrategy::try_convert(v).map_err(|e| {
|
|
4822
4911
|
magnus::Error::new(
|
|
@@ -5026,6 +5115,10 @@ impl ConversionOptions {
|
|
|
5026
5115
|
self.exclude_selectors.clone()
|
|
5027
5116
|
}
|
|
5028
5117
|
|
|
5118
|
+
fn data_as_elements(&self) -> Option<Vec<String>> {
|
|
5119
|
+
self.data_as_elements.clone()
|
|
5120
|
+
}
|
|
5121
|
+
|
|
5029
5122
|
fn tier_strategy(&self) -> TierStrategy {
|
|
5030
5123
|
self.tier_strategy.clone()
|
|
5031
5124
|
}
|
|
@@ -9188,6 +9281,25 @@ impl DocxMetadata {
|
|
|
9188
9281
|
}
|
|
9189
9282
|
}
|
|
9190
9283
|
|
|
9284
|
+
#[derive(Clone)]
|
|
9285
|
+
#[magnus::wrap(class = "Xberg::DrawingSetText")]
|
|
9286
|
+
pub struct DrawingSetText {
|
|
9287
|
+
inner: Arc<xberg::extraction::plan_geometry::drawing_set::DrawingSetText>,
|
|
9288
|
+
}
|
|
9289
|
+
|
|
9290
|
+
unsafe impl IntoValueFromNative for DrawingSetText {}
|
|
9291
|
+
|
|
9292
|
+
impl magnus::TryConvert for DrawingSetText {
|
|
9293
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
9294
|
+
let r: &DrawingSetText = magnus::TryConvert::try_convert(val)?;
|
|
9295
|
+
Ok(r.clone())
|
|
9296
|
+
}
|
|
9297
|
+
}
|
|
9298
|
+
|
|
9299
|
+
unsafe impl TryConvertOwned for DrawingSetText {}
|
|
9300
|
+
|
|
9301
|
+
impl DrawingSetText {}
|
|
9302
|
+
|
|
9191
9303
|
#[derive(Clone, Debug, serde::Serialize)]
|
|
9192
9304
|
#[magnus::wrap(class = "Xberg::Element")]
|
|
9193
9305
|
pub struct Element {
|
|
@@ -21570,6 +21682,191 @@ impl MarkdownLink {
|
|
|
21570
21682
|
}
|
|
21571
21683
|
}
|
|
21572
21684
|
|
|
21685
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
21686
|
+
#[serde(default)]
|
|
21687
|
+
#[magnus::wrap(class = "Xberg::MeasureData")]
|
|
21688
|
+
pub struct MeasureData {
|
|
21689
|
+
subtype: Option<String>,
|
|
21690
|
+
scale_ratio: Option<String>,
|
|
21691
|
+
x: Option<Vec<f64>>,
|
|
21692
|
+
y: Option<Vec<f64>>,
|
|
21693
|
+
distance: Option<Vec<f64>>,
|
|
21694
|
+
area: Option<Vec<f64>>,
|
|
21695
|
+
angle: Option<Vec<f64>>,
|
|
21696
|
+
slope: Option<Vec<f64>>,
|
|
21697
|
+
origin: Option<String>,
|
|
21698
|
+
}
|
|
21699
|
+
|
|
21700
|
+
unsafe impl IntoValueFromNative for MeasureData {}
|
|
21701
|
+
|
|
21702
|
+
impl magnus::TryConvert for MeasureData {
|
|
21703
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
21704
|
+
if let Ok(r) = <&MeasureData as magnus::TryConvert>::try_convert(val) {
|
|
21705
|
+
return Ok(r.clone());
|
|
21706
|
+
}
|
|
21707
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
21708
|
+
s
|
|
21709
|
+
} else {
|
|
21710
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
21711
|
+
magnus::Error::new(
|
|
21712
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21713
|
+
format!("no implicit conversion into MeasureData: {}", e),
|
|
21714
|
+
)
|
|
21715
|
+
})?
|
|
21716
|
+
};
|
|
21717
|
+
serde_json::from_str::<MeasureData>(&json_str).map_err(|e| {
|
|
21718
|
+
magnus::Error::new(
|
|
21719
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21720
|
+
format!("failed to deserialize MeasureData: {}", e),
|
|
21721
|
+
)
|
|
21722
|
+
})
|
|
21723
|
+
}
|
|
21724
|
+
}
|
|
21725
|
+
|
|
21726
|
+
unsafe impl TryConvertOwned for MeasureData {}
|
|
21727
|
+
impl<'de> serde::Deserialize<'de> for MeasureData {
|
|
21728
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
21729
|
+
where
|
|
21730
|
+
D: serde::Deserializer<'de>,
|
|
21731
|
+
{
|
|
21732
|
+
<xberg::MeasureData as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
21733
|
+
}
|
|
21734
|
+
}
|
|
21735
|
+
|
|
21736
|
+
impl Default for MeasureData {
|
|
21737
|
+
fn default() -> Self {
|
|
21738
|
+
xberg::MeasureData::default().into()
|
|
21739
|
+
}
|
|
21740
|
+
}
|
|
21741
|
+
|
|
21742
|
+
impl MeasureData {
|
|
21743
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
21744
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
21745
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
21746
|
+
let (kwargs_opt,) = args.optional;
|
|
21747
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
21748
|
+
Ok(Self {
|
|
21749
|
+
subtype: match kwargs.get(ruby.to_symbol("subtype")).filter(|v| !v.is_nil()) {
|
|
21750
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
21751
|
+
magnus::Error::new(
|
|
21752
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21753
|
+
format!("invalid value for `subtype`: {}", e),
|
|
21754
|
+
)
|
|
21755
|
+
})?),
|
|
21756
|
+
None => None,
|
|
21757
|
+
},
|
|
21758
|
+
scale_ratio: match kwargs.get(ruby.to_symbol("scale_ratio")).filter(|v| !v.is_nil()) {
|
|
21759
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
21760
|
+
magnus::Error::new(
|
|
21761
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21762
|
+
format!("invalid value for `scale_ratio`: {}", e),
|
|
21763
|
+
)
|
|
21764
|
+
})?),
|
|
21765
|
+
None => None,
|
|
21766
|
+
},
|
|
21767
|
+
x: match kwargs.get(ruby.to_symbol("x")).filter(|v| !v.is_nil()) {
|
|
21768
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21769
|
+
magnus::Error::new(
|
|
21770
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21771
|
+
format!("invalid value for `x`: {}", e),
|
|
21772
|
+
)
|
|
21773
|
+
})?),
|
|
21774
|
+
None => None,
|
|
21775
|
+
},
|
|
21776
|
+
y: match kwargs.get(ruby.to_symbol("y")).filter(|v| !v.is_nil()) {
|
|
21777
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21778
|
+
magnus::Error::new(
|
|
21779
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21780
|
+
format!("invalid value for `y`: {}", e),
|
|
21781
|
+
)
|
|
21782
|
+
})?),
|
|
21783
|
+
None => None,
|
|
21784
|
+
},
|
|
21785
|
+
distance: match kwargs.get(ruby.to_symbol("distance")).filter(|v| !v.is_nil()) {
|
|
21786
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21787
|
+
magnus::Error::new(
|
|
21788
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21789
|
+
format!("invalid value for `distance`: {}", e),
|
|
21790
|
+
)
|
|
21791
|
+
})?),
|
|
21792
|
+
None => None,
|
|
21793
|
+
},
|
|
21794
|
+
area: match kwargs.get(ruby.to_symbol("area")).filter(|v| !v.is_nil()) {
|
|
21795
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21796
|
+
magnus::Error::new(
|
|
21797
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21798
|
+
format!("invalid value for `area`: {}", e),
|
|
21799
|
+
)
|
|
21800
|
+
})?),
|
|
21801
|
+
None => None,
|
|
21802
|
+
},
|
|
21803
|
+
angle: match kwargs.get(ruby.to_symbol("angle")).filter(|v| !v.is_nil()) {
|
|
21804
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21805
|
+
magnus::Error::new(
|
|
21806
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21807
|
+
format!("invalid value for `angle`: {}", e),
|
|
21808
|
+
)
|
|
21809
|
+
})?),
|
|
21810
|
+
None => None,
|
|
21811
|
+
},
|
|
21812
|
+
slope: match kwargs.get(ruby.to_symbol("slope")).filter(|v| !v.is_nil()) {
|
|
21813
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
21814
|
+
magnus::Error::new(
|
|
21815
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21816
|
+
format!("invalid value for `slope`: {}", e),
|
|
21817
|
+
)
|
|
21818
|
+
})?),
|
|
21819
|
+
None => None,
|
|
21820
|
+
},
|
|
21821
|
+
origin: match kwargs.get(ruby.to_symbol("origin")).filter(|v| !v.is_nil()) {
|
|
21822
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
21823
|
+
magnus::Error::new(
|
|
21824
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
21825
|
+
format!("invalid value for `origin`: {}", e),
|
|
21826
|
+
)
|
|
21827
|
+
})?),
|
|
21828
|
+
None => None,
|
|
21829
|
+
},
|
|
21830
|
+
})
|
|
21831
|
+
}
|
|
21832
|
+
|
|
21833
|
+
fn subtype(&self) -> Option<String> {
|
|
21834
|
+
self.subtype.clone()
|
|
21835
|
+
}
|
|
21836
|
+
|
|
21837
|
+
fn scale_ratio(&self) -> Option<String> {
|
|
21838
|
+
self.scale_ratio.clone()
|
|
21839
|
+
}
|
|
21840
|
+
|
|
21841
|
+
fn x(&self) -> Option<Vec<f64>> {
|
|
21842
|
+
self.x.clone()
|
|
21843
|
+
}
|
|
21844
|
+
|
|
21845
|
+
fn y(&self) -> Option<Vec<f64>> {
|
|
21846
|
+
self.y.clone()
|
|
21847
|
+
}
|
|
21848
|
+
|
|
21849
|
+
fn distance(&self) -> Option<Vec<f64>> {
|
|
21850
|
+
self.distance.clone()
|
|
21851
|
+
}
|
|
21852
|
+
|
|
21853
|
+
fn area(&self) -> Option<Vec<f64>> {
|
|
21854
|
+
self.area.clone()
|
|
21855
|
+
}
|
|
21856
|
+
|
|
21857
|
+
fn angle(&self) -> Option<Vec<f64>> {
|
|
21858
|
+
self.angle.clone()
|
|
21859
|
+
}
|
|
21860
|
+
|
|
21861
|
+
fn slope(&self) -> Option<Vec<f64>> {
|
|
21862
|
+
self.slope.clone()
|
|
21863
|
+
}
|
|
21864
|
+
|
|
21865
|
+
fn origin(&self) -> Option<String> {
|
|
21866
|
+
self.origin.clone()
|
|
21867
|
+
}
|
|
21868
|
+
}
|
|
21869
|
+
|
|
21573
21870
|
#[cfg(feature = "presets")]
|
|
21574
21871
|
#[derive(Clone)]
|
|
21575
21872
|
#[magnus::wrap(class = "Xberg::MetaSchema")]
|
|
@@ -24929,6 +25226,107 @@ impl OrientationResult {
|
|
|
24929
25226
|
}
|
|
24930
25227
|
}
|
|
24931
25228
|
|
|
25229
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
25230
|
+
#[serde(default)]
|
|
25231
|
+
#[magnus::wrap(class = "Xberg::OrtSessionOptions")]
|
|
25232
|
+
pub struct OrtSessionOptions {
|
|
25233
|
+
memory_pattern: bool,
|
|
25234
|
+
cpu_arena: bool,
|
|
25235
|
+
max_threads: Option<i32>,
|
|
25236
|
+
}
|
|
25237
|
+
|
|
25238
|
+
unsafe impl IntoValueFromNative for OrtSessionOptions {}
|
|
25239
|
+
|
|
25240
|
+
impl magnus::TryConvert for OrtSessionOptions {
|
|
25241
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
25242
|
+
if let Ok(r) = <&OrtSessionOptions as magnus::TryConvert>::try_convert(val) {
|
|
25243
|
+
return Ok(r.clone());
|
|
25244
|
+
}
|
|
25245
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
25246
|
+
s
|
|
25247
|
+
} else {
|
|
25248
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
25249
|
+
magnus::Error::new(
|
|
25250
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
25251
|
+
format!("no implicit conversion into OrtSessionOptions: {}", e),
|
|
25252
|
+
)
|
|
25253
|
+
})?
|
|
25254
|
+
};
|
|
25255
|
+
serde_json::from_str::<OrtSessionOptions>(&json_str).map_err(|e| {
|
|
25256
|
+
magnus::Error::new(
|
|
25257
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
25258
|
+
format!("failed to deserialize OrtSessionOptions: {}", e),
|
|
25259
|
+
)
|
|
25260
|
+
})
|
|
25261
|
+
}
|
|
25262
|
+
}
|
|
25263
|
+
|
|
25264
|
+
unsafe impl TryConvertOwned for OrtSessionOptions {}
|
|
25265
|
+
impl<'de> serde::Deserialize<'de> for OrtSessionOptions {
|
|
25266
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
25267
|
+
where
|
|
25268
|
+
D: serde::Deserializer<'de>,
|
|
25269
|
+
{
|
|
25270
|
+
<xberg::OrtSessionOptions as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
25271
|
+
}
|
|
25272
|
+
}
|
|
25273
|
+
|
|
25274
|
+
impl Default for OrtSessionOptions {
|
|
25275
|
+
fn default() -> Self {
|
|
25276
|
+
xberg::OrtSessionOptions::default().into()
|
|
25277
|
+
}
|
|
25278
|
+
}
|
|
25279
|
+
|
|
25280
|
+
impl OrtSessionOptions {
|
|
25281
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
25282
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
25283
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
25284
|
+
let (kwargs_opt,) = args.optional;
|
|
25285
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
25286
|
+
Ok(Self {
|
|
25287
|
+
memory_pattern: match kwargs.get(ruby.to_symbol("memory_pattern")) {
|
|
25288
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
25289
|
+
magnus::Error::new(
|
|
25290
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
25291
|
+
format!("invalid value for `memory_pattern`: {}", e),
|
|
25292
|
+
)
|
|
25293
|
+
})?,
|
|
25294
|
+
None => true,
|
|
25295
|
+
},
|
|
25296
|
+
cpu_arena: match kwargs.get(ruby.to_symbol("cpu_arena")) {
|
|
25297
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
25298
|
+
magnus::Error::new(
|
|
25299
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
25300
|
+
format!("invalid value for `cpu_arena`: {}", e),
|
|
25301
|
+
)
|
|
25302
|
+
})?,
|
|
25303
|
+
None => true,
|
|
25304
|
+
},
|
|
25305
|
+
max_threads: match kwargs.get(ruby.to_symbol("max_threads")).filter(|v| !v.is_nil()) {
|
|
25306
|
+
Some(v) => Some(i32::try_convert(v).map_err(|e| {
|
|
25307
|
+
magnus::Error::new(
|
|
25308
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
25309
|
+
format!("invalid value for `max_threads`: {}", e),
|
|
25310
|
+
)
|
|
25311
|
+
})?),
|
|
25312
|
+
None => None,
|
|
25313
|
+
},
|
|
25314
|
+
})
|
|
25315
|
+
}
|
|
25316
|
+
|
|
25317
|
+
fn memory_pattern(&self) -> bool {
|
|
25318
|
+
self.memory_pattern
|
|
25319
|
+
}
|
|
25320
|
+
|
|
25321
|
+
fn cpu_arena(&self) -> bool {
|
|
25322
|
+
self.cpu_arena
|
|
25323
|
+
}
|
|
25324
|
+
|
|
25325
|
+
fn max_threads(&self) -> Option<i32> {
|
|
25326
|
+
self.max_threads
|
|
25327
|
+
}
|
|
25328
|
+
}
|
|
25329
|
+
|
|
24932
25330
|
#[derive(Clone, Debug, serde::Serialize)]
|
|
24933
25331
|
#[serde(default)]
|
|
24934
25332
|
#[magnus::wrap(class = "Xberg::PaddleOcrConfig")]
|
|
@@ -26184,6 +26582,8 @@ pub struct PageContent {
|
|
|
26184
26582
|
sheet_name: Option<String>,
|
|
26185
26583
|
ocr_confidence: Option<PageOcrConfidence>,
|
|
26186
26584
|
native_content: Option<String>,
|
|
26585
|
+
geometry: Option<PageGeometry>,
|
|
26586
|
+
viewports: Option<Vec<PageViewport>>,
|
|
26187
26587
|
}
|
|
26188
26588
|
|
|
26189
26589
|
unsafe impl IntoValueFromNative for PageContent {}
|
|
@@ -26238,6 +26638,8 @@ impl Default for PageContent {
|
|
|
26238
26638
|
sheet_name: None,
|
|
26239
26639
|
ocr_confidence: None,
|
|
26240
26640
|
native_content: None,
|
|
26641
|
+
geometry: None,
|
|
26642
|
+
viewports: None,
|
|
26241
26643
|
}
|
|
26242
26644
|
}
|
|
26243
26645
|
}
|
|
@@ -26369,6 +26771,24 @@ impl PageContent {
|
|
|
26369
26771
|
})?),
|
|
26370
26772
|
None => None,
|
|
26371
26773
|
},
|
|
26774
|
+
geometry: match kwargs.get(ruby.to_symbol("geometry")).filter(|v| !v.is_nil()) {
|
|
26775
|
+
Some(v) => Some(PageGeometry::try_convert(v).map_err(|e| {
|
|
26776
|
+
magnus::Error::new(
|
|
26777
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
26778
|
+
format!("invalid value for `geometry`: {}", e),
|
|
26779
|
+
)
|
|
26780
|
+
})?),
|
|
26781
|
+
None => None,
|
|
26782
|
+
},
|
|
26783
|
+
viewports: match kwargs.get(ruby.to_symbol("viewports")).filter(|v| !v.is_nil()) {
|
|
26784
|
+
Some(v) => Some(<Vec<PageViewport>>::try_convert(v).map_err(|e| {
|
|
26785
|
+
magnus::Error::new(
|
|
26786
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
26787
|
+
format!("invalid value for `viewports`: {}", e),
|
|
26788
|
+
)
|
|
26789
|
+
})?),
|
|
26790
|
+
None => None,
|
|
26791
|
+
},
|
|
26372
26792
|
})
|
|
26373
26793
|
}
|
|
26374
26794
|
|
|
@@ -26424,6 +26844,14 @@ impl PageContent {
|
|
|
26424
26844
|
self.native_content.clone()
|
|
26425
26845
|
}
|
|
26426
26846
|
|
|
26847
|
+
fn geometry(&self) -> Option<PageGeometry> {
|
|
26848
|
+
self.geometry.clone()
|
|
26849
|
+
}
|
|
26850
|
+
|
|
26851
|
+
fn viewports(&self) -> Option<Vec<PageViewport>> {
|
|
26852
|
+
self.viewports.clone()
|
|
26853
|
+
}
|
|
26854
|
+
|
|
26427
26855
|
#[allow(clippy::should_implement_trait)]
|
|
26428
26856
|
fn to_s(&self) -> String {
|
|
26429
26857
|
self.content.clone()
|
|
@@ -26509,6 +26937,93 @@ impl PageDimensions {
|
|
|
26509
26937
|
}
|
|
26510
26938
|
}
|
|
26511
26939
|
|
|
26940
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
26941
|
+
#[serde(default)]
|
|
26942
|
+
#[magnus::wrap(class = "Xberg::PageGeometry")]
|
|
26943
|
+
pub struct PageGeometry {
|
|
26944
|
+
paths: Vec<VectorPath>,
|
|
26945
|
+
regions: Vec<PlanRegion>,
|
|
26946
|
+
}
|
|
26947
|
+
|
|
26948
|
+
unsafe impl IntoValueFromNative for PageGeometry {}
|
|
26949
|
+
|
|
26950
|
+
impl magnus::TryConvert for PageGeometry {
|
|
26951
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
26952
|
+
if let Ok(r) = <&PageGeometry as magnus::TryConvert>::try_convert(val) {
|
|
26953
|
+
return Ok(r.clone());
|
|
26954
|
+
}
|
|
26955
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
26956
|
+
s
|
|
26957
|
+
} else {
|
|
26958
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
26959
|
+
magnus::Error::new(
|
|
26960
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
26961
|
+
format!("no implicit conversion into PageGeometry: {}", e),
|
|
26962
|
+
)
|
|
26963
|
+
})?
|
|
26964
|
+
};
|
|
26965
|
+
serde_json::from_str::<PageGeometry>(&json_str).map_err(|e| {
|
|
26966
|
+
magnus::Error::new(
|
|
26967
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
26968
|
+
format!("failed to deserialize PageGeometry: {}", e),
|
|
26969
|
+
)
|
|
26970
|
+
})
|
|
26971
|
+
}
|
|
26972
|
+
}
|
|
26973
|
+
|
|
26974
|
+
unsafe impl TryConvertOwned for PageGeometry {}
|
|
26975
|
+
impl<'de> serde::Deserialize<'de> for PageGeometry {
|
|
26976
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
26977
|
+
where
|
|
26978
|
+
D: serde::Deserializer<'de>,
|
|
26979
|
+
{
|
|
26980
|
+
<xberg::PageGeometry as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
26981
|
+
}
|
|
26982
|
+
}
|
|
26983
|
+
|
|
26984
|
+
impl Default for PageGeometry {
|
|
26985
|
+
fn default() -> Self {
|
|
26986
|
+
xberg::PageGeometry::default().into()
|
|
26987
|
+
}
|
|
26988
|
+
}
|
|
26989
|
+
|
|
26990
|
+
impl PageGeometry {
|
|
26991
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
26992
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
26993
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
26994
|
+
let (kwargs_opt,) = args.optional;
|
|
26995
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
26996
|
+
Ok(Self {
|
|
26997
|
+
paths: match kwargs.get(ruby.to_symbol("paths")) {
|
|
26998
|
+
Some(v) => <Vec<VectorPath>>::try_convert(v).map_err(|e| {
|
|
26999
|
+
magnus::Error::new(
|
|
27000
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27001
|
+
format!("invalid value for `paths`: {}", e),
|
|
27002
|
+
)
|
|
27003
|
+
})?,
|
|
27004
|
+
None => Default::default(),
|
|
27005
|
+
},
|
|
27006
|
+
regions: match kwargs.get(ruby.to_symbol("regions")) {
|
|
27007
|
+
Some(v) => <Vec<PlanRegion>>::try_convert(v).map_err(|e| {
|
|
27008
|
+
magnus::Error::new(
|
|
27009
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27010
|
+
format!("invalid value for `regions`: {}", e),
|
|
27011
|
+
)
|
|
27012
|
+
})?,
|
|
27013
|
+
None => Default::default(),
|
|
27014
|
+
},
|
|
27015
|
+
})
|
|
27016
|
+
}
|
|
27017
|
+
|
|
27018
|
+
fn paths(&self) -> Vec<VectorPath> {
|
|
27019
|
+
self.paths.clone()
|
|
27020
|
+
}
|
|
27021
|
+
|
|
27022
|
+
fn regions(&self) -> Vec<PlanRegion> {
|
|
27023
|
+
self.regions.clone()
|
|
27024
|
+
}
|
|
27025
|
+
}
|
|
27026
|
+
|
|
26512
27027
|
#[derive(Clone, Debug, serde::Serialize)]
|
|
26513
27028
|
#[magnus::wrap(class = "Xberg::PageHierarchy")]
|
|
26514
27029
|
pub struct PageHierarchy {
|
|
@@ -27266,6 +27781,284 @@ impl PageStructure {
|
|
|
27266
27781
|
}
|
|
27267
27782
|
}
|
|
27268
27783
|
|
|
27784
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
27785
|
+
#[serde(default)]
|
|
27786
|
+
#[magnus::wrap(class = "Xberg::PageViewport")]
|
|
27787
|
+
pub struct PageViewport {
|
|
27788
|
+
bounding_box: BoundingBox,
|
|
27789
|
+
name: Option<String>,
|
|
27790
|
+
measure: Option<MeasureData>,
|
|
27791
|
+
}
|
|
27792
|
+
|
|
27793
|
+
unsafe impl IntoValueFromNative for PageViewport {}
|
|
27794
|
+
|
|
27795
|
+
impl magnus::TryConvert for PageViewport {
|
|
27796
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
27797
|
+
if let Ok(r) = <&PageViewport as magnus::TryConvert>::try_convert(val) {
|
|
27798
|
+
return Ok(r.clone());
|
|
27799
|
+
}
|
|
27800
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
27801
|
+
s
|
|
27802
|
+
} else {
|
|
27803
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
27804
|
+
magnus::Error::new(
|
|
27805
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27806
|
+
format!("no implicit conversion into PageViewport: {}", e),
|
|
27807
|
+
)
|
|
27808
|
+
})?
|
|
27809
|
+
};
|
|
27810
|
+
serde_json::from_str::<PageViewport>(&json_str).map_err(|e| {
|
|
27811
|
+
magnus::Error::new(
|
|
27812
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27813
|
+
format!("failed to deserialize PageViewport: {}", e),
|
|
27814
|
+
)
|
|
27815
|
+
})
|
|
27816
|
+
}
|
|
27817
|
+
}
|
|
27818
|
+
|
|
27819
|
+
unsafe impl TryConvertOwned for PageViewport {}
|
|
27820
|
+
impl<'de> serde::Deserialize<'de> for PageViewport {
|
|
27821
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
27822
|
+
where
|
|
27823
|
+
D: serde::Deserializer<'de>,
|
|
27824
|
+
{
|
|
27825
|
+
<xberg::PageViewport as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
27826
|
+
}
|
|
27827
|
+
}
|
|
27828
|
+
|
|
27829
|
+
impl Default for PageViewport {
|
|
27830
|
+
fn default() -> Self {
|
|
27831
|
+
xberg::PageViewport::default().into()
|
|
27832
|
+
}
|
|
27833
|
+
}
|
|
27834
|
+
|
|
27835
|
+
impl PageViewport {
|
|
27836
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
27837
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
27838
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
27839
|
+
let (kwargs_opt,) = args.optional;
|
|
27840
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
27841
|
+
Ok(Self {
|
|
27842
|
+
bounding_box: match kwargs.get(ruby.to_symbol("bounding_box")) {
|
|
27843
|
+
Some(v) => BoundingBox::try_convert(v).map_err(|e| {
|
|
27844
|
+
magnus::Error::new(
|
|
27845
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27846
|
+
format!("invalid value for `bounding_box`: {}", e),
|
|
27847
|
+
)
|
|
27848
|
+
})?,
|
|
27849
|
+
None => Default::default(),
|
|
27850
|
+
},
|
|
27851
|
+
name: match kwargs.get(ruby.to_symbol("name")).filter(|v| !v.is_nil()) {
|
|
27852
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
27853
|
+
magnus::Error::new(
|
|
27854
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27855
|
+
format!("invalid value for `name`: {}", e),
|
|
27856
|
+
)
|
|
27857
|
+
})?),
|
|
27858
|
+
None => None,
|
|
27859
|
+
},
|
|
27860
|
+
measure: match kwargs.get(ruby.to_symbol("measure")).filter(|v| !v.is_nil()) {
|
|
27861
|
+
Some(v) => Some(MeasureData::try_convert(v).map_err(|e| {
|
|
27862
|
+
magnus::Error::new(
|
|
27863
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27864
|
+
format!("invalid value for `measure`: {}", e),
|
|
27865
|
+
)
|
|
27866
|
+
})?),
|
|
27867
|
+
None => None,
|
|
27868
|
+
},
|
|
27869
|
+
})
|
|
27870
|
+
}
|
|
27871
|
+
|
|
27872
|
+
fn bounding_box(&self) -> BoundingBox {
|
|
27873
|
+
self.bounding_box.clone()
|
|
27874
|
+
}
|
|
27875
|
+
|
|
27876
|
+
fn name(&self) -> Option<String> {
|
|
27877
|
+
self.name.clone()
|
|
27878
|
+
}
|
|
27879
|
+
|
|
27880
|
+
fn measure(&self) -> Option<MeasureData> {
|
|
27881
|
+
self.measure.clone()
|
|
27882
|
+
}
|
|
27883
|
+
}
|
|
27884
|
+
|
|
27885
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
27886
|
+
#[magnus::wrap(class = "Xberg::ParsedDimension")]
|
|
27887
|
+
pub struct ParsedDimension {
|
|
27888
|
+
text: String,
|
|
27889
|
+
inches: f64,
|
|
27890
|
+
position: VectorPoint,
|
|
27891
|
+
}
|
|
27892
|
+
|
|
27893
|
+
unsafe impl IntoValueFromNative for ParsedDimension {}
|
|
27894
|
+
|
|
27895
|
+
impl magnus::TryConvert for ParsedDimension {
|
|
27896
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
27897
|
+
if let Ok(r) = <&ParsedDimension as magnus::TryConvert>::try_convert(val) {
|
|
27898
|
+
return Ok(r.clone());
|
|
27899
|
+
}
|
|
27900
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
27901
|
+
s
|
|
27902
|
+
} else {
|
|
27903
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
27904
|
+
magnus::Error::new(
|
|
27905
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27906
|
+
format!("no implicit conversion into ParsedDimension: {}", e),
|
|
27907
|
+
)
|
|
27908
|
+
})?
|
|
27909
|
+
};
|
|
27910
|
+
serde_json::from_str::<ParsedDimension>(&json_str).map_err(|e| {
|
|
27911
|
+
magnus::Error::new(
|
|
27912
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27913
|
+
format!("failed to deserialize ParsedDimension: {}", e),
|
|
27914
|
+
)
|
|
27915
|
+
})
|
|
27916
|
+
}
|
|
27917
|
+
}
|
|
27918
|
+
|
|
27919
|
+
unsafe impl TryConvertOwned for ParsedDimension {}
|
|
27920
|
+
|
|
27921
|
+
impl ParsedDimension {
|
|
27922
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
27923
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
27924
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
27925
|
+
let (kwargs_opt,) = args.optional;
|
|
27926
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
27927
|
+
Ok(Self {
|
|
27928
|
+
text: match kwargs.get(ruby.to_symbol("text")) {
|
|
27929
|
+
Some(v) => String::try_convert(v).map_err(|e| {
|
|
27930
|
+
magnus::Error::new(
|
|
27931
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27932
|
+
format!("invalid value for `text`: {}", e),
|
|
27933
|
+
)
|
|
27934
|
+
})?,
|
|
27935
|
+
None => Default::default(),
|
|
27936
|
+
},
|
|
27937
|
+
inches: match kwargs.get(ruby.to_symbol("inches")) {
|
|
27938
|
+
Some(v) => f64::try_convert(v).map_err(|e| {
|
|
27939
|
+
magnus::Error::new(
|
|
27940
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27941
|
+
format!("invalid value for `inches`: {}", e),
|
|
27942
|
+
)
|
|
27943
|
+
})?,
|
|
27944
|
+
None => Default::default(),
|
|
27945
|
+
},
|
|
27946
|
+
position: match kwargs.get(ruby.to_symbol("position")) {
|
|
27947
|
+
Some(v) => VectorPoint::try_convert(v).map_err(|e| {
|
|
27948
|
+
magnus::Error::new(
|
|
27949
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27950
|
+
format!("invalid value for `position`: {}", e),
|
|
27951
|
+
)
|
|
27952
|
+
})?,
|
|
27953
|
+
None => {
|
|
27954
|
+
return Err(magnus::Error::new(
|
|
27955
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_arg_error(),
|
|
27956
|
+
"missing required field: position",
|
|
27957
|
+
));
|
|
27958
|
+
}
|
|
27959
|
+
},
|
|
27960
|
+
})
|
|
27961
|
+
}
|
|
27962
|
+
|
|
27963
|
+
fn text(&self) -> String {
|
|
27964
|
+
self.text.clone()
|
|
27965
|
+
}
|
|
27966
|
+
|
|
27967
|
+
fn inches(&self) -> f64 {
|
|
27968
|
+
self.inches
|
|
27969
|
+
}
|
|
27970
|
+
|
|
27971
|
+
fn position(&self) -> VectorPoint {
|
|
27972
|
+
self.position.clone()
|
|
27973
|
+
}
|
|
27974
|
+
}
|
|
27975
|
+
|
|
27976
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
27977
|
+
#[magnus::wrap(class = "Xberg::ParsedScale")]
|
|
27978
|
+
pub struct ParsedScale {
|
|
27979
|
+
drawing_inches: Option<f64>,
|
|
27980
|
+
real_inches: Option<f64>,
|
|
27981
|
+
ratio: f64,
|
|
27982
|
+
}
|
|
27983
|
+
|
|
27984
|
+
unsafe impl IntoValueFromNative for ParsedScale {}
|
|
27985
|
+
|
|
27986
|
+
impl magnus::TryConvert for ParsedScale {
|
|
27987
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
27988
|
+
if let Ok(r) = <&ParsedScale as magnus::TryConvert>::try_convert(val) {
|
|
27989
|
+
return Ok(r.clone());
|
|
27990
|
+
}
|
|
27991
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
27992
|
+
s
|
|
27993
|
+
} else {
|
|
27994
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
27995
|
+
magnus::Error::new(
|
|
27996
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
27997
|
+
format!("no implicit conversion into ParsedScale: {}", e),
|
|
27998
|
+
)
|
|
27999
|
+
})?
|
|
28000
|
+
};
|
|
28001
|
+
serde_json::from_str::<ParsedScale>(&json_str).map_err(|e| {
|
|
28002
|
+
magnus::Error::new(
|
|
28003
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28004
|
+
format!("failed to deserialize ParsedScale: {}", e),
|
|
28005
|
+
)
|
|
28006
|
+
})
|
|
28007
|
+
}
|
|
28008
|
+
}
|
|
28009
|
+
|
|
28010
|
+
unsafe impl TryConvertOwned for ParsedScale {}
|
|
28011
|
+
|
|
28012
|
+
impl ParsedScale {
|
|
28013
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
28014
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
28015
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
28016
|
+
let (kwargs_opt,) = args.optional;
|
|
28017
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
28018
|
+
Ok(Self {
|
|
28019
|
+
drawing_inches: match kwargs.get(ruby.to_symbol("drawing_inches")).filter(|v| !v.is_nil()) {
|
|
28020
|
+
Some(v) => Some(f64::try_convert(v).map_err(|e| {
|
|
28021
|
+
magnus::Error::new(
|
|
28022
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28023
|
+
format!("invalid value for `drawing_inches`: {}", e),
|
|
28024
|
+
)
|
|
28025
|
+
})?),
|
|
28026
|
+
None => None,
|
|
28027
|
+
},
|
|
28028
|
+
real_inches: match kwargs.get(ruby.to_symbol("real_inches")).filter(|v| !v.is_nil()) {
|
|
28029
|
+
Some(v) => Some(f64::try_convert(v).map_err(|e| {
|
|
28030
|
+
magnus::Error::new(
|
|
28031
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28032
|
+
format!("invalid value for `real_inches`: {}", e),
|
|
28033
|
+
)
|
|
28034
|
+
})?),
|
|
28035
|
+
None => None,
|
|
28036
|
+
},
|
|
28037
|
+
ratio: match kwargs.get(ruby.to_symbol("ratio")) {
|
|
28038
|
+
Some(v) => f64::try_convert(v).map_err(|e| {
|
|
28039
|
+
magnus::Error::new(
|
|
28040
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28041
|
+
format!("invalid value for `ratio`: {}", e),
|
|
28042
|
+
)
|
|
28043
|
+
})?,
|
|
28044
|
+
None => Default::default(),
|
|
28045
|
+
},
|
|
28046
|
+
})
|
|
28047
|
+
}
|
|
28048
|
+
|
|
28049
|
+
fn drawing_inches(&self) -> Option<f64> {
|
|
28050
|
+
self.drawing_inches
|
|
28051
|
+
}
|
|
28052
|
+
|
|
28053
|
+
fn real_inches(&self) -> Option<f64> {
|
|
28054
|
+
self.real_inches
|
|
28055
|
+
}
|
|
28056
|
+
|
|
28057
|
+
fn ratio(&self) -> f64 {
|
|
28058
|
+
self.ratio
|
|
28059
|
+
}
|
|
28060
|
+
}
|
|
28061
|
+
|
|
27269
28062
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
27270
28063
|
#[magnus::wrap(class = "Xberg::PatternMatch")]
|
|
27271
28064
|
pub struct PatternMatch {
|
|
@@ -27384,6 +28177,9 @@ pub struct PdfAnnotation {
|
|
|
27384
28177
|
subject: Option<String>,
|
|
27385
28178
|
quad_points: Option<Vec<BoundingBox>>,
|
|
27386
28179
|
marked_text: Option<String>,
|
|
28180
|
+
vertices: Option<Vec<AnnotationPoint>>,
|
|
28181
|
+
ink_list: Option<Vec<Vec<AnnotationPoint>>>,
|
|
28182
|
+
measure: Option<MeasureData>,
|
|
27387
28183
|
}
|
|
27388
28184
|
|
|
27389
28185
|
unsafe impl IntoValueFromNative for PdfAnnotation {}
|
|
@@ -27524,6 +28320,33 @@ impl PdfAnnotation {
|
|
|
27524
28320
|
})?),
|
|
27525
28321
|
None => None,
|
|
27526
28322
|
},
|
|
28323
|
+
vertices: match kwargs.get(ruby.to_symbol("vertices")).filter(|v| !v.is_nil()) {
|
|
28324
|
+
Some(v) => Some(<Vec<AnnotationPoint>>::try_convert(v).map_err(|e| {
|
|
28325
|
+
magnus::Error::new(
|
|
28326
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28327
|
+
format!("invalid value for `vertices`: {}", e),
|
|
28328
|
+
)
|
|
28329
|
+
})?),
|
|
28330
|
+
None => None,
|
|
28331
|
+
},
|
|
28332
|
+
ink_list: match kwargs.get(ruby.to_symbol("ink_list")).filter(|v| !v.is_nil()) {
|
|
28333
|
+
Some(v) => Some(<Vec<Vec<AnnotationPoint>>>::try_convert(v).map_err(|e| {
|
|
28334
|
+
magnus::Error::new(
|
|
28335
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28336
|
+
format!("invalid value for `ink_list`: {}", e),
|
|
28337
|
+
)
|
|
28338
|
+
})?),
|
|
28339
|
+
None => None,
|
|
28340
|
+
},
|
|
28341
|
+
measure: match kwargs.get(ruby.to_symbol("measure")).filter(|v| !v.is_nil()) {
|
|
28342
|
+
Some(v) => Some(MeasureData::try_convert(v).map_err(|e| {
|
|
28343
|
+
magnus::Error::new(
|
|
28344
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28345
|
+
format!("invalid value for `measure`: {}", e),
|
|
28346
|
+
)
|
|
28347
|
+
})?),
|
|
28348
|
+
None => None,
|
|
28349
|
+
},
|
|
27527
28350
|
})
|
|
27528
28351
|
}
|
|
27529
28352
|
|
|
@@ -27567,6 +28390,18 @@ impl PdfAnnotation {
|
|
|
27567
28390
|
self.marked_text.clone()
|
|
27568
28391
|
}
|
|
27569
28392
|
|
|
28393
|
+
fn vertices(&self) -> Option<Vec<AnnotationPoint>> {
|
|
28394
|
+
self.vertices.clone()
|
|
28395
|
+
}
|
|
28396
|
+
|
|
28397
|
+
fn ink_list(&self) -> Option<Vec<Vec<AnnotationPoint>>> {
|
|
28398
|
+
self.ink_list.clone()
|
|
28399
|
+
}
|
|
28400
|
+
|
|
28401
|
+
fn measure(&self) -> Option<MeasureData> {
|
|
28402
|
+
self.measure.clone()
|
|
28403
|
+
}
|
|
28404
|
+
|
|
27570
28405
|
#[allow(clippy::should_implement_trait)]
|
|
27571
28406
|
fn to_s(&self) -> String {
|
|
27572
28407
|
self.content.clone().unwrap_or_default()
|
|
@@ -27592,6 +28427,9 @@ pub struct PdfConfig {
|
|
|
27592
28427
|
extract_form_fields: bool,
|
|
27593
28428
|
reading_order: bool,
|
|
27594
28429
|
backend: PdfBackend,
|
|
28430
|
+
extract_vector_geometry: bool,
|
|
28431
|
+
#[cfg(feature = "pdf")]
|
|
28432
|
+
plan_regions: Option<PlanRegionConfig>,
|
|
27595
28433
|
}
|
|
27596
28434
|
|
|
27597
28435
|
#[cfg(feature = "pdf")]
|
|
@@ -27764,6 +28602,25 @@ impl PdfConfig {
|
|
|
27764
28602
|
})?,
|
|
27765
28603
|
None => PdfBackend::Native,
|
|
27766
28604
|
},
|
|
28605
|
+
extract_vector_geometry: match kwargs.get(ruby.to_symbol("extract_vector_geometry")) {
|
|
28606
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
28607
|
+
magnus::Error::new(
|
|
28608
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28609
|
+
format!("invalid value for `extract_vector_geometry`: {}", e),
|
|
28610
|
+
)
|
|
28611
|
+
})?,
|
|
28612
|
+
None => false,
|
|
28613
|
+
},
|
|
28614
|
+
#[cfg(feature = "pdf")]
|
|
28615
|
+
plan_regions: match kwargs.get(ruby.to_symbol("plan_regions")).filter(|v| !v.is_nil()) {
|
|
28616
|
+
Some(v) => Some(PlanRegionConfig::try_convert(v).map_err(|e| {
|
|
28617
|
+
magnus::Error::new(
|
|
28618
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
28619
|
+
format!("invalid value for `plan_regions`: {}", e),
|
|
28620
|
+
)
|
|
28621
|
+
})?),
|
|
28622
|
+
None => None,
|
|
28623
|
+
},
|
|
27767
28624
|
})
|
|
27768
28625
|
}
|
|
27769
28626
|
|
|
@@ -27820,6 +28677,15 @@ impl PdfConfig {
|
|
|
27820
28677
|
self.backend.clone()
|
|
27821
28678
|
}
|
|
27822
28679
|
|
|
28680
|
+
fn extract_vector_geometry(&self) -> bool {
|
|
28681
|
+
self.extract_vector_geometry
|
|
28682
|
+
}
|
|
28683
|
+
|
|
28684
|
+
#[cfg(feature = "pdf")]
|
|
28685
|
+
fn plan_regions(&self) -> Option<PlanRegionConfig> {
|
|
28686
|
+
self.plan_regions.clone()
|
|
28687
|
+
}
|
|
28688
|
+
|
|
27823
28689
|
#[cfg(feature = "pdf")]
|
|
27824
28690
|
fn validate(&self) -> Result<(), Error> {
|
|
27825
28691
|
#[allow(clippy::needless_update)]
|
|
@@ -27848,6 +28714,8 @@ impl PdfConfig {
|
|
|
27848
28714
|
|
|
27849
28715
|
backend: self.backend.clone().into(),
|
|
27850
28716
|
|
|
28717
|
+
extract_vector_geometry: self.extract_vector_geometry,
|
|
28718
|
+
|
|
27851
28719
|
..Default::default()
|
|
27852
28720
|
};
|
|
27853
28721
|
let result = core_self.validate().map_err(alef_magnus_err)?;
|
|
@@ -28365,6 +29233,378 @@ impl PixelDimensions {
|
|
|
28365
29233
|
}
|
|
28366
29234
|
}
|
|
28367
29235
|
|
|
29236
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
29237
|
+
#[serde(default)]
|
|
29238
|
+
#[magnus::wrap(class = "Xberg::PlanRegion")]
|
|
29239
|
+
pub struct PlanRegion {
|
|
29240
|
+
polygon: Vec<VectorPoint>,
|
|
29241
|
+
area: f64,
|
|
29242
|
+
bounding_box: BoundingBox,
|
|
29243
|
+
text: String,
|
|
29244
|
+
}
|
|
29245
|
+
|
|
29246
|
+
unsafe impl IntoValueFromNative for PlanRegion {}
|
|
29247
|
+
|
|
29248
|
+
impl magnus::TryConvert for PlanRegion {
|
|
29249
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
29250
|
+
if let Ok(r) = <&PlanRegion as magnus::TryConvert>::try_convert(val) {
|
|
29251
|
+
return Ok(r.clone());
|
|
29252
|
+
}
|
|
29253
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
29254
|
+
s
|
|
29255
|
+
} else {
|
|
29256
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
29257
|
+
magnus::Error::new(
|
|
29258
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29259
|
+
format!("no implicit conversion into PlanRegion: {}", e),
|
|
29260
|
+
)
|
|
29261
|
+
})?
|
|
29262
|
+
};
|
|
29263
|
+
serde_json::from_str::<PlanRegion>(&json_str).map_err(|e| {
|
|
29264
|
+
magnus::Error::new(
|
|
29265
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29266
|
+
format!("failed to deserialize PlanRegion: {}", e),
|
|
29267
|
+
)
|
|
29268
|
+
})
|
|
29269
|
+
}
|
|
29270
|
+
}
|
|
29271
|
+
|
|
29272
|
+
unsafe impl TryConvertOwned for PlanRegion {}
|
|
29273
|
+
impl<'de> serde::Deserialize<'de> for PlanRegion {
|
|
29274
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
29275
|
+
where
|
|
29276
|
+
D: serde::Deserializer<'de>,
|
|
29277
|
+
{
|
|
29278
|
+
<xberg::PlanRegion as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
29279
|
+
}
|
|
29280
|
+
}
|
|
29281
|
+
|
|
29282
|
+
impl Default for PlanRegion {
|
|
29283
|
+
fn default() -> Self {
|
|
29284
|
+
xberg::PlanRegion::default().into()
|
|
29285
|
+
}
|
|
29286
|
+
}
|
|
29287
|
+
|
|
29288
|
+
impl PlanRegion {
|
|
29289
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
29290
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
29291
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
29292
|
+
let (kwargs_opt,) = args.optional;
|
|
29293
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
29294
|
+
Ok(Self {
|
|
29295
|
+
polygon: match kwargs.get(ruby.to_symbol("polygon")) {
|
|
29296
|
+
Some(v) => <Vec<VectorPoint>>::try_convert(v).map_err(|e| {
|
|
29297
|
+
magnus::Error::new(
|
|
29298
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29299
|
+
format!("invalid value for `polygon`: {}", e),
|
|
29300
|
+
)
|
|
29301
|
+
})?,
|
|
29302
|
+
None => Default::default(),
|
|
29303
|
+
},
|
|
29304
|
+
area: match kwargs.get(ruby.to_symbol("area")) {
|
|
29305
|
+
Some(v) => f64::try_convert(v).map_err(|e| {
|
|
29306
|
+
magnus::Error::new(
|
|
29307
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29308
|
+
format!("invalid value for `area`: {}", e),
|
|
29309
|
+
)
|
|
29310
|
+
})?,
|
|
29311
|
+
None => Default::default(),
|
|
29312
|
+
},
|
|
29313
|
+
bounding_box: match kwargs.get(ruby.to_symbol("bounding_box")) {
|
|
29314
|
+
Some(v) => BoundingBox::try_convert(v).map_err(|e| {
|
|
29315
|
+
magnus::Error::new(
|
|
29316
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29317
|
+
format!("invalid value for `bounding_box`: {}", e),
|
|
29318
|
+
)
|
|
29319
|
+
})?,
|
|
29320
|
+
None => Default::default(),
|
|
29321
|
+
},
|
|
29322
|
+
text: match kwargs.get(ruby.to_symbol("text")) {
|
|
29323
|
+
Some(v) => String::try_convert(v).map_err(|e| {
|
|
29324
|
+
magnus::Error::new(
|
|
29325
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29326
|
+
format!("invalid value for `text`: {}", e),
|
|
29327
|
+
)
|
|
29328
|
+
})?,
|
|
29329
|
+
None => Default::default(),
|
|
29330
|
+
},
|
|
29331
|
+
})
|
|
29332
|
+
}
|
|
29333
|
+
|
|
29334
|
+
fn polygon(&self) -> Vec<VectorPoint> {
|
|
29335
|
+
self.polygon.clone()
|
|
29336
|
+
}
|
|
29337
|
+
|
|
29338
|
+
fn area(&self) -> f64 {
|
|
29339
|
+
self.area
|
|
29340
|
+
}
|
|
29341
|
+
|
|
29342
|
+
fn bounding_box(&self) -> BoundingBox {
|
|
29343
|
+
self.bounding_box.clone()
|
|
29344
|
+
}
|
|
29345
|
+
|
|
29346
|
+
fn text(&self) -> String {
|
|
29347
|
+
self.text.clone()
|
|
29348
|
+
}
|
|
29349
|
+
}
|
|
29350
|
+
|
|
29351
|
+
#[cfg(feature = "pdf")]
|
|
29352
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
29353
|
+
#[serde(default)]
|
|
29354
|
+
#[magnus::wrap(class = "Xberg::PlanRegionConfig")]
|
|
29355
|
+
pub struct PlanRegionConfig {
|
|
29356
|
+
enabled: bool,
|
|
29357
|
+
snap_tolerance: f32,
|
|
29358
|
+
gap_tolerance: f32,
|
|
29359
|
+
max_segments: usize,
|
|
29360
|
+
}
|
|
29361
|
+
|
|
29362
|
+
#[cfg(feature = "pdf")]
|
|
29363
|
+
unsafe impl IntoValueFromNative for PlanRegionConfig {}
|
|
29364
|
+
|
|
29365
|
+
#[cfg(feature = "pdf")]
|
|
29366
|
+
impl magnus::TryConvert for PlanRegionConfig {
|
|
29367
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
29368
|
+
if let Ok(r) = <&PlanRegionConfig as magnus::TryConvert>::try_convert(val) {
|
|
29369
|
+
return Ok(r.clone());
|
|
29370
|
+
}
|
|
29371
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
29372
|
+
s
|
|
29373
|
+
} else {
|
|
29374
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
29375
|
+
magnus::Error::new(
|
|
29376
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29377
|
+
format!("no implicit conversion into PlanRegionConfig: {}", e),
|
|
29378
|
+
)
|
|
29379
|
+
})?
|
|
29380
|
+
};
|
|
29381
|
+
serde_json::from_str::<PlanRegionConfig>(&json_str).map_err(|e| {
|
|
29382
|
+
magnus::Error::new(
|
|
29383
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29384
|
+
format!("failed to deserialize PlanRegionConfig: {}", e),
|
|
29385
|
+
)
|
|
29386
|
+
})
|
|
29387
|
+
}
|
|
29388
|
+
}
|
|
29389
|
+
|
|
29390
|
+
#[cfg(feature = "pdf")]
|
|
29391
|
+
unsafe impl TryConvertOwned for PlanRegionConfig {}
|
|
29392
|
+
#[cfg(feature = "pdf")]
|
|
29393
|
+
impl<'de> serde::Deserialize<'de> for PlanRegionConfig {
|
|
29394
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
29395
|
+
where
|
|
29396
|
+
D: serde::Deserializer<'de>,
|
|
29397
|
+
{
|
|
29398
|
+
<xberg::core::config::PlanRegionConfig as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
29399
|
+
}
|
|
29400
|
+
}
|
|
29401
|
+
|
|
29402
|
+
#[cfg(feature = "pdf")]
|
|
29403
|
+
impl Default for PlanRegionConfig {
|
|
29404
|
+
fn default() -> Self {
|
|
29405
|
+
xberg::core::config::PlanRegionConfig::default().into()
|
|
29406
|
+
}
|
|
29407
|
+
}
|
|
29408
|
+
|
|
29409
|
+
#[cfg(feature = "pdf")]
|
|
29410
|
+
impl PlanRegionConfig {
|
|
29411
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
29412
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
29413
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
29414
|
+
let (kwargs_opt,) = args.optional;
|
|
29415
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
29416
|
+
Ok(Self {
|
|
29417
|
+
enabled: match kwargs.get(ruby.to_symbol("enabled")) {
|
|
29418
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
29419
|
+
magnus::Error::new(
|
|
29420
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29421
|
+
format!("invalid value for `enabled`: {}", e),
|
|
29422
|
+
)
|
|
29423
|
+
})?,
|
|
29424
|
+
None => false,
|
|
29425
|
+
},
|
|
29426
|
+
snap_tolerance: match kwargs.get(ruby.to_symbol("snap_tolerance")) {
|
|
29427
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
29428
|
+
magnus::Error::new(
|
|
29429
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29430
|
+
format!("invalid value for `snap_tolerance`: {}", e),
|
|
29431
|
+
)
|
|
29432
|
+
})?,
|
|
29433
|
+
None => 0.5,
|
|
29434
|
+
},
|
|
29435
|
+
gap_tolerance: match kwargs.get(ruby.to_symbol("gap_tolerance")) {
|
|
29436
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
29437
|
+
magnus::Error::new(
|
|
29438
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29439
|
+
format!("invalid value for `gap_tolerance`: {}", e),
|
|
29440
|
+
)
|
|
29441
|
+
})?,
|
|
29442
|
+
None => 24.0,
|
|
29443
|
+
},
|
|
29444
|
+
max_segments: match kwargs.get(ruby.to_symbol("max_segments")) {
|
|
29445
|
+
Some(v) => usize::try_convert(v).map_err(|e| {
|
|
29446
|
+
magnus::Error::new(
|
|
29447
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29448
|
+
format!("invalid value for `max_segments`: {}", e),
|
|
29449
|
+
)
|
|
29450
|
+
})?,
|
|
29451
|
+
None => 20000,
|
|
29452
|
+
},
|
|
29453
|
+
})
|
|
29454
|
+
}
|
|
29455
|
+
|
|
29456
|
+
fn enabled(&self) -> bool {
|
|
29457
|
+
self.enabled
|
|
29458
|
+
}
|
|
29459
|
+
|
|
29460
|
+
fn snap_tolerance(&self) -> f32 {
|
|
29461
|
+
self.snap_tolerance
|
|
29462
|
+
}
|
|
29463
|
+
|
|
29464
|
+
fn gap_tolerance(&self) -> f32 {
|
|
29465
|
+
self.gap_tolerance
|
|
29466
|
+
}
|
|
29467
|
+
|
|
29468
|
+
fn max_segments(&self) -> usize {
|
|
29469
|
+
self.max_segments
|
|
29470
|
+
}
|
|
29471
|
+
}
|
|
29472
|
+
|
|
29473
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
29474
|
+
#[serde(default)]
|
|
29475
|
+
#[magnus::wrap(class = "Xberg::PolygonAnnotationInput")]
|
|
29476
|
+
pub struct PolygonAnnotationInput {
|
|
29477
|
+
vertices: Vec<AnnotationPoint>,
|
|
29478
|
+
rect: Option<BoundingBox>,
|
|
29479
|
+
contents: Option<String>,
|
|
29480
|
+
subject: Option<String>,
|
|
29481
|
+
measure: Option<MeasureData>,
|
|
29482
|
+
color: Option<Vec<f64>>,
|
|
29483
|
+
}
|
|
29484
|
+
|
|
29485
|
+
unsafe impl IntoValueFromNative for PolygonAnnotationInput {}
|
|
29486
|
+
|
|
29487
|
+
impl magnus::TryConvert for PolygonAnnotationInput {
|
|
29488
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
29489
|
+
if let Ok(r) = <&PolygonAnnotationInput as magnus::TryConvert>::try_convert(val) {
|
|
29490
|
+
return Ok(r.clone());
|
|
29491
|
+
}
|
|
29492
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
29493
|
+
s
|
|
29494
|
+
} else {
|
|
29495
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
29496
|
+
magnus::Error::new(
|
|
29497
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29498
|
+
format!("no implicit conversion into PolygonAnnotationInput: {}", e),
|
|
29499
|
+
)
|
|
29500
|
+
})?
|
|
29501
|
+
};
|
|
29502
|
+
serde_json::from_str::<PolygonAnnotationInput>(&json_str).map_err(|e| {
|
|
29503
|
+
magnus::Error::new(
|
|
29504
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29505
|
+
format!("failed to deserialize PolygonAnnotationInput: {}", e),
|
|
29506
|
+
)
|
|
29507
|
+
})
|
|
29508
|
+
}
|
|
29509
|
+
}
|
|
29510
|
+
|
|
29511
|
+
unsafe impl TryConvertOwned for PolygonAnnotationInput {}
|
|
29512
|
+
|
|
29513
|
+
impl Default for PolygonAnnotationInput {
|
|
29514
|
+
fn default() -> Self {
|
|
29515
|
+
xberg::extraction::plan_geometry::write::PolygonAnnotationInput::default().into()
|
|
29516
|
+
}
|
|
29517
|
+
}
|
|
29518
|
+
|
|
29519
|
+
impl PolygonAnnotationInput {
|
|
29520
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
29521
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
29522
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
29523
|
+
let (kwargs_opt,) = args.optional;
|
|
29524
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
29525
|
+
Ok(Self {
|
|
29526
|
+
vertices: match kwargs.get(ruby.to_symbol("vertices")) {
|
|
29527
|
+
Some(v) => <Vec<AnnotationPoint>>::try_convert(v).map_err(|e| {
|
|
29528
|
+
magnus::Error::new(
|
|
29529
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29530
|
+
format!("invalid value for `vertices`: {}", e),
|
|
29531
|
+
)
|
|
29532
|
+
})?,
|
|
29533
|
+
None => Default::default(),
|
|
29534
|
+
},
|
|
29535
|
+
rect: match kwargs.get(ruby.to_symbol("rect")).filter(|v| !v.is_nil()) {
|
|
29536
|
+
Some(v) => Some(BoundingBox::try_convert(v).map_err(|e| {
|
|
29537
|
+
magnus::Error::new(
|
|
29538
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29539
|
+
format!("invalid value for `rect`: {}", e),
|
|
29540
|
+
)
|
|
29541
|
+
})?),
|
|
29542
|
+
None => None,
|
|
29543
|
+
},
|
|
29544
|
+
contents: match kwargs.get(ruby.to_symbol("contents")).filter(|v| !v.is_nil()) {
|
|
29545
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
29546
|
+
magnus::Error::new(
|
|
29547
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29548
|
+
format!("invalid value for `contents`: {}", e),
|
|
29549
|
+
)
|
|
29550
|
+
})?),
|
|
29551
|
+
None => None,
|
|
29552
|
+
},
|
|
29553
|
+
subject: match kwargs.get(ruby.to_symbol("subject")).filter(|v| !v.is_nil()) {
|
|
29554
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
29555
|
+
magnus::Error::new(
|
|
29556
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29557
|
+
format!("invalid value for `subject`: {}", e),
|
|
29558
|
+
)
|
|
29559
|
+
})?),
|
|
29560
|
+
None => None,
|
|
29561
|
+
},
|
|
29562
|
+
measure: match kwargs.get(ruby.to_symbol("measure")).filter(|v| !v.is_nil()) {
|
|
29563
|
+
Some(v) => Some(MeasureData::try_convert(v).map_err(|e| {
|
|
29564
|
+
magnus::Error::new(
|
|
29565
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29566
|
+
format!("invalid value for `measure`: {}", e),
|
|
29567
|
+
)
|
|
29568
|
+
})?),
|
|
29569
|
+
None => None,
|
|
29570
|
+
},
|
|
29571
|
+
color: match kwargs.get(ruby.to_symbol("color")).filter(|v| !v.is_nil()) {
|
|
29572
|
+
Some(v) => Some(<Vec<f64>>::try_convert(v).map_err(|e| {
|
|
29573
|
+
magnus::Error::new(
|
|
29574
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
29575
|
+
format!("invalid value for `color`: {}", e),
|
|
29576
|
+
)
|
|
29577
|
+
})?),
|
|
29578
|
+
None => None,
|
|
29579
|
+
},
|
|
29580
|
+
})
|
|
29581
|
+
}
|
|
29582
|
+
|
|
29583
|
+
fn vertices(&self) -> Vec<AnnotationPoint> {
|
|
29584
|
+
self.vertices.clone()
|
|
29585
|
+
}
|
|
29586
|
+
|
|
29587
|
+
fn rect(&self) -> Option<BoundingBox> {
|
|
29588
|
+
self.rect.clone()
|
|
29589
|
+
}
|
|
29590
|
+
|
|
29591
|
+
fn contents(&self) -> Option<String> {
|
|
29592
|
+
self.contents.clone()
|
|
29593
|
+
}
|
|
29594
|
+
|
|
29595
|
+
fn subject(&self) -> Option<String> {
|
|
29596
|
+
self.subject.clone()
|
|
29597
|
+
}
|
|
29598
|
+
|
|
29599
|
+
fn measure(&self) -> Option<MeasureData> {
|
|
29600
|
+
self.measure.clone()
|
|
29601
|
+
}
|
|
29602
|
+
|
|
29603
|
+
fn color(&self) -> Option<Vec<f64>> {
|
|
29604
|
+
self.color.clone()
|
|
29605
|
+
}
|
|
29606
|
+
}
|
|
29607
|
+
|
|
28368
29608
|
#[derive(Clone, Debug, serde::Serialize)]
|
|
28369
29609
|
#[serde(default)]
|
|
28370
29610
|
#[magnus::wrap(class = "Xberg::PostProcessorConfig")]
|
|
@@ -32233,6 +33473,99 @@ impl ServerConfig {
|
|
|
32233
33473
|
}
|
|
32234
33474
|
}
|
|
32235
33475
|
|
|
33476
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
33477
|
+
#[serde(default)]
|
|
33478
|
+
#[magnus::wrap(class = "Xberg::SheetMetadata")]
|
|
33479
|
+
pub struct SheetMetadata {
|
|
33480
|
+
sheet_number: Option<String>,
|
|
33481
|
+
title: Option<String>,
|
|
33482
|
+
revision: Option<String>,
|
|
33483
|
+
}
|
|
33484
|
+
|
|
33485
|
+
unsafe impl IntoValueFromNative for SheetMetadata {}
|
|
33486
|
+
|
|
33487
|
+
impl magnus::TryConvert for SheetMetadata {
|
|
33488
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
33489
|
+
if let Ok(r) = <&SheetMetadata as magnus::TryConvert>::try_convert(val) {
|
|
33490
|
+
return Ok(r.clone());
|
|
33491
|
+
}
|
|
33492
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
33493
|
+
s
|
|
33494
|
+
} else {
|
|
33495
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
33496
|
+
magnus::Error::new(
|
|
33497
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
33498
|
+
format!("no implicit conversion into SheetMetadata: {}", e),
|
|
33499
|
+
)
|
|
33500
|
+
})?
|
|
33501
|
+
};
|
|
33502
|
+
serde_json::from_str::<SheetMetadata>(&json_str).map_err(|e| {
|
|
33503
|
+
magnus::Error::new(
|
|
33504
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
33505
|
+
format!("failed to deserialize SheetMetadata: {}", e),
|
|
33506
|
+
)
|
|
33507
|
+
})
|
|
33508
|
+
}
|
|
33509
|
+
}
|
|
33510
|
+
|
|
33511
|
+
unsafe impl TryConvertOwned for SheetMetadata {}
|
|
33512
|
+
|
|
33513
|
+
impl Default for SheetMetadata {
|
|
33514
|
+
fn default() -> Self {
|
|
33515
|
+
xberg::extraction::plan_geometry::drawing_set::SheetMetadata::default().into()
|
|
33516
|
+
}
|
|
33517
|
+
}
|
|
33518
|
+
|
|
33519
|
+
impl SheetMetadata {
|
|
33520
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
33521
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
33522
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
33523
|
+
let (kwargs_opt,) = args.optional;
|
|
33524
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
33525
|
+
Ok(Self {
|
|
33526
|
+
sheet_number: match kwargs.get(ruby.to_symbol("sheet_number")).filter(|v| !v.is_nil()) {
|
|
33527
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
33528
|
+
magnus::Error::new(
|
|
33529
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
33530
|
+
format!("invalid value for `sheet_number`: {}", e),
|
|
33531
|
+
)
|
|
33532
|
+
})?),
|
|
33533
|
+
None => None,
|
|
33534
|
+
},
|
|
33535
|
+
title: match kwargs.get(ruby.to_symbol("title")).filter(|v| !v.is_nil()) {
|
|
33536
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
33537
|
+
magnus::Error::new(
|
|
33538
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
33539
|
+
format!("invalid value for `title`: {}", e),
|
|
33540
|
+
)
|
|
33541
|
+
})?),
|
|
33542
|
+
None => None,
|
|
33543
|
+
},
|
|
33544
|
+
revision: match kwargs.get(ruby.to_symbol("revision")).filter(|v| !v.is_nil()) {
|
|
33545
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
33546
|
+
magnus::Error::new(
|
|
33547
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
33548
|
+
format!("invalid value for `revision`: {}", e),
|
|
33549
|
+
)
|
|
33550
|
+
})?),
|
|
33551
|
+
None => None,
|
|
33552
|
+
},
|
|
33553
|
+
})
|
|
33554
|
+
}
|
|
33555
|
+
|
|
33556
|
+
fn sheet_number(&self) -> Option<String> {
|
|
33557
|
+
self.sheet_number.clone()
|
|
33558
|
+
}
|
|
33559
|
+
|
|
33560
|
+
fn title(&self) -> Option<String> {
|
|
33561
|
+
self.title.clone()
|
|
33562
|
+
}
|
|
33563
|
+
|
|
33564
|
+
fn revision(&self) -> Option<String> {
|
|
33565
|
+
self.revision.clone()
|
|
33566
|
+
}
|
|
33567
|
+
}
|
|
33568
|
+
|
|
32236
33569
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
32237
33570
|
#[serde(default)]
|
|
32238
33571
|
#[magnus::wrap(class = "Xberg::SitemapUrl")]
|
|
@@ -36291,6 +37624,616 @@ impl UserChunkConfig {
|
|
|
36291
37624
|
}
|
|
36292
37625
|
}
|
|
36293
37626
|
|
|
37627
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
37628
|
+
#[serde(default)]
|
|
37629
|
+
#[magnus::wrap(class = "Xberg::VectorColor")]
|
|
37630
|
+
pub struct VectorColor {
|
|
37631
|
+
r: f32,
|
|
37632
|
+
g: f32,
|
|
37633
|
+
b: f32,
|
|
37634
|
+
}
|
|
37635
|
+
|
|
37636
|
+
unsafe impl IntoValueFromNative for VectorColor {}
|
|
37637
|
+
|
|
37638
|
+
impl magnus::TryConvert for VectorColor {
|
|
37639
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
37640
|
+
if let Ok(r) = <&VectorColor as magnus::TryConvert>::try_convert(val) {
|
|
37641
|
+
return Ok(r.clone());
|
|
37642
|
+
}
|
|
37643
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
37644
|
+
s
|
|
37645
|
+
} else {
|
|
37646
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
37647
|
+
magnus::Error::new(
|
|
37648
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37649
|
+
format!("no implicit conversion into VectorColor: {}", e),
|
|
37650
|
+
)
|
|
37651
|
+
})?
|
|
37652
|
+
};
|
|
37653
|
+
serde_json::from_str::<VectorColor>(&json_str).map_err(|e| {
|
|
37654
|
+
magnus::Error::new(
|
|
37655
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37656
|
+
format!("failed to deserialize VectorColor: {}", e),
|
|
37657
|
+
)
|
|
37658
|
+
})
|
|
37659
|
+
}
|
|
37660
|
+
}
|
|
37661
|
+
|
|
37662
|
+
unsafe impl TryConvertOwned for VectorColor {}
|
|
37663
|
+
|
|
37664
|
+
impl Default for VectorColor {
|
|
37665
|
+
fn default() -> Self {
|
|
37666
|
+
xberg::VectorColor::default().into()
|
|
37667
|
+
}
|
|
37668
|
+
}
|
|
37669
|
+
|
|
37670
|
+
impl VectorColor {
|
|
37671
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
37672
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
37673
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
37674
|
+
let (kwargs_opt,) = args.optional;
|
|
37675
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
37676
|
+
Ok(Self {
|
|
37677
|
+
r: match kwargs.get(ruby.to_symbol("r")) {
|
|
37678
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37679
|
+
magnus::Error::new(
|
|
37680
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37681
|
+
format!("invalid value for `r`: {}", e),
|
|
37682
|
+
)
|
|
37683
|
+
})?,
|
|
37684
|
+
None => Default::default(),
|
|
37685
|
+
},
|
|
37686
|
+
g: match kwargs.get(ruby.to_symbol("g")) {
|
|
37687
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37688
|
+
magnus::Error::new(
|
|
37689
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37690
|
+
format!("invalid value for `g`: {}", e),
|
|
37691
|
+
)
|
|
37692
|
+
})?,
|
|
37693
|
+
None => Default::default(),
|
|
37694
|
+
},
|
|
37695
|
+
b: match kwargs.get(ruby.to_symbol("b")) {
|
|
37696
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37697
|
+
magnus::Error::new(
|
|
37698
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37699
|
+
format!("invalid value for `b`: {}", e),
|
|
37700
|
+
)
|
|
37701
|
+
})?,
|
|
37702
|
+
None => Default::default(),
|
|
37703
|
+
},
|
|
37704
|
+
})
|
|
37705
|
+
}
|
|
37706
|
+
|
|
37707
|
+
fn r(&self) -> f32 {
|
|
37708
|
+
self.r
|
|
37709
|
+
}
|
|
37710
|
+
|
|
37711
|
+
fn g(&self) -> f32 {
|
|
37712
|
+
self.g
|
|
37713
|
+
}
|
|
37714
|
+
|
|
37715
|
+
fn b(&self) -> f32 {
|
|
37716
|
+
self.b
|
|
37717
|
+
}
|
|
37718
|
+
}
|
|
37719
|
+
|
|
37720
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
37721
|
+
#[serde(default)]
|
|
37722
|
+
#[magnus::wrap(class = "Xberg::VectorDashPattern")]
|
|
37723
|
+
pub struct VectorDashPattern {
|
|
37724
|
+
dashes: Vec<f32>,
|
|
37725
|
+
phase: f32,
|
|
37726
|
+
}
|
|
37727
|
+
|
|
37728
|
+
unsafe impl IntoValueFromNative for VectorDashPattern {}
|
|
37729
|
+
|
|
37730
|
+
impl magnus::TryConvert for VectorDashPattern {
|
|
37731
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
37732
|
+
if let Ok(r) = <&VectorDashPattern as magnus::TryConvert>::try_convert(val) {
|
|
37733
|
+
return Ok(r.clone());
|
|
37734
|
+
}
|
|
37735
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
37736
|
+
s
|
|
37737
|
+
} else {
|
|
37738
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
37739
|
+
magnus::Error::new(
|
|
37740
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37741
|
+
format!("no implicit conversion into VectorDashPattern: {}", e),
|
|
37742
|
+
)
|
|
37743
|
+
})?
|
|
37744
|
+
};
|
|
37745
|
+
serde_json::from_str::<VectorDashPattern>(&json_str).map_err(|e| {
|
|
37746
|
+
magnus::Error::new(
|
|
37747
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37748
|
+
format!("failed to deserialize VectorDashPattern: {}", e),
|
|
37749
|
+
)
|
|
37750
|
+
})
|
|
37751
|
+
}
|
|
37752
|
+
}
|
|
37753
|
+
|
|
37754
|
+
unsafe impl TryConvertOwned for VectorDashPattern {}
|
|
37755
|
+
|
|
37756
|
+
impl Default for VectorDashPattern {
|
|
37757
|
+
fn default() -> Self {
|
|
37758
|
+
xberg::VectorDashPattern::default().into()
|
|
37759
|
+
}
|
|
37760
|
+
}
|
|
37761
|
+
|
|
37762
|
+
impl VectorDashPattern {
|
|
37763
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
37764
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
37765
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
37766
|
+
let (kwargs_opt,) = args.optional;
|
|
37767
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
37768
|
+
Ok(Self {
|
|
37769
|
+
dashes: match kwargs.get(ruby.to_symbol("dashes")) {
|
|
37770
|
+
Some(v) => <Vec<f32>>::try_convert(v).map_err(|e| {
|
|
37771
|
+
magnus::Error::new(
|
|
37772
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37773
|
+
format!("invalid value for `dashes`: {}", e),
|
|
37774
|
+
)
|
|
37775
|
+
})?,
|
|
37776
|
+
None => Default::default(),
|
|
37777
|
+
},
|
|
37778
|
+
phase: match kwargs.get(ruby.to_symbol("phase")) {
|
|
37779
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37780
|
+
magnus::Error::new(
|
|
37781
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37782
|
+
format!("invalid value for `phase`: {}", e),
|
|
37783
|
+
)
|
|
37784
|
+
})?,
|
|
37785
|
+
None => Default::default(),
|
|
37786
|
+
},
|
|
37787
|
+
})
|
|
37788
|
+
}
|
|
37789
|
+
|
|
37790
|
+
fn dashes(&self) -> Vec<f32> {
|
|
37791
|
+
self.dashes.clone()
|
|
37792
|
+
}
|
|
37793
|
+
|
|
37794
|
+
fn phase(&self) -> f32 {
|
|
37795
|
+
self.phase
|
|
37796
|
+
}
|
|
37797
|
+
}
|
|
37798
|
+
|
|
37799
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
37800
|
+
#[serde(default)]
|
|
37801
|
+
#[magnus::wrap(class = "Xberg::VectorPath")]
|
|
37802
|
+
pub struct VectorPath {
|
|
37803
|
+
subpaths: Vec<VectorSubpath>,
|
|
37804
|
+
bounding_box: BoundingBox,
|
|
37805
|
+
fill_color: Option<VectorColor>,
|
|
37806
|
+
stroke: Option<VectorStroke>,
|
|
37807
|
+
layer: Option<String>,
|
|
37808
|
+
}
|
|
37809
|
+
|
|
37810
|
+
unsafe impl IntoValueFromNative for VectorPath {}
|
|
37811
|
+
|
|
37812
|
+
impl magnus::TryConvert for VectorPath {
|
|
37813
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
37814
|
+
if let Ok(r) = <&VectorPath as magnus::TryConvert>::try_convert(val) {
|
|
37815
|
+
return Ok(r.clone());
|
|
37816
|
+
}
|
|
37817
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
37818
|
+
s
|
|
37819
|
+
} else {
|
|
37820
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
37821
|
+
magnus::Error::new(
|
|
37822
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37823
|
+
format!("no implicit conversion into VectorPath: {}", e),
|
|
37824
|
+
)
|
|
37825
|
+
})?
|
|
37826
|
+
};
|
|
37827
|
+
serde_json::from_str::<VectorPath>(&json_str).map_err(|e| {
|
|
37828
|
+
magnus::Error::new(
|
|
37829
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37830
|
+
format!("failed to deserialize VectorPath: {}", e),
|
|
37831
|
+
)
|
|
37832
|
+
})
|
|
37833
|
+
}
|
|
37834
|
+
}
|
|
37835
|
+
|
|
37836
|
+
unsafe impl TryConvertOwned for VectorPath {}
|
|
37837
|
+
impl<'de> serde::Deserialize<'de> for VectorPath {
|
|
37838
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
37839
|
+
where
|
|
37840
|
+
D: serde::Deserializer<'de>,
|
|
37841
|
+
{
|
|
37842
|
+
<xberg::VectorPath as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
37843
|
+
}
|
|
37844
|
+
}
|
|
37845
|
+
|
|
37846
|
+
impl Default for VectorPath {
|
|
37847
|
+
fn default() -> Self {
|
|
37848
|
+
xberg::VectorPath::default().into()
|
|
37849
|
+
}
|
|
37850
|
+
}
|
|
37851
|
+
|
|
37852
|
+
impl VectorPath {
|
|
37853
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
37854
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
37855
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
37856
|
+
let (kwargs_opt,) = args.optional;
|
|
37857
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
37858
|
+
Ok(Self {
|
|
37859
|
+
subpaths: match kwargs.get(ruby.to_symbol("subpaths")) {
|
|
37860
|
+
Some(v) => <Vec<VectorSubpath>>::try_convert(v).map_err(|e| {
|
|
37861
|
+
magnus::Error::new(
|
|
37862
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37863
|
+
format!("invalid value for `subpaths`: {}", e),
|
|
37864
|
+
)
|
|
37865
|
+
})?,
|
|
37866
|
+
None => Default::default(),
|
|
37867
|
+
},
|
|
37868
|
+
bounding_box: match kwargs.get(ruby.to_symbol("bounding_box")) {
|
|
37869
|
+
Some(v) => BoundingBox::try_convert(v).map_err(|e| {
|
|
37870
|
+
magnus::Error::new(
|
|
37871
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37872
|
+
format!("invalid value for `bounding_box`: {}", e),
|
|
37873
|
+
)
|
|
37874
|
+
})?,
|
|
37875
|
+
None => Default::default(),
|
|
37876
|
+
},
|
|
37877
|
+
fill_color: match kwargs.get(ruby.to_symbol("fill_color")).filter(|v| !v.is_nil()) {
|
|
37878
|
+
Some(v) => Some(VectorColor::try_convert(v).map_err(|e| {
|
|
37879
|
+
magnus::Error::new(
|
|
37880
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37881
|
+
format!("invalid value for `fill_color`: {}", e),
|
|
37882
|
+
)
|
|
37883
|
+
})?),
|
|
37884
|
+
None => None,
|
|
37885
|
+
},
|
|
37886
|
+
stroke: match kwargs.get(ruby.to_symbol("stroke")).filter(|v| !v.is_nil()) {
|
|
37887
|
+
Some(v) => Some(VectorStroke::try_convert(v).map_err(|e| {
|
|
37888
|
+
magnus::Error::new(
|
|
37889
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37890
|
+
format!("invalid value for `stroke`: {}", e),
|
|
37891
|
+
)
|
|
37892
|
+
})?),
|
|
37893
|
+
None => None,
|
|
37894
|
+
},
|
|
37895
|
+
layer: match kwargs.get(ruby.to_symbol("layer")).filter(|v| !v.is_nil()) {
|
|
37896
|
+
Some(v) => Some(String::try_convert(v).map_err(|e| {
|
|
37897
|
+
magnus::Error::new(
|
|
37898
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37899
|
+
format!("invalid value for `layer`: {}", e),
|
|
37900
|
+
)
|
|
37901
|
+
})?),
|
|
37902
|
+
None => None,
|
|
37903
|
+
},
|
|
37904
|
+
})
|
|
37905
|
+
}
|
|
37906
|
+
|
|
37907
|
+
fn subpaths(&self) -> Vec<VectorSubpath> {
|
|
37908
|
+
self.subpaths.clone()
|
|
37909
|
+
}
|
|
37910
|
+
|
|
37911
|
+
fn bounding_box(&self) -> BoundingBox {
|
|
37912
|
+
self.bounding_box.clone()
|
|
37913
|
+
}
|
|
37914
|
+
|
|
37915
|
+
fn fill_color(&self) -> Option<VectorColor> {
|
|
37916
|
+
self.fill_color.clone()
|
|
37917
|
+
}
|
|
37918
|
+
|
|
37919
|
+
fn stroke(&self) -> Option<VectorStroke> {
|
|
37920
|
+
self.stroke.clone()
|
|
37921
|
+
}
|
|
37922
|
+
|
|
37923
|
+
fn layer(&self) -> Option<String> {
|
|
37924
|
+
self.layer.clone()
|
|
37925
|
+
}
|
|
37926
|
+
}
|
|
37927
|
+
|
|
37928
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
37929
|
+
#[serde(default)]
|
|
37930
|
+
#[magnus::wrap(class = "Xberg::VectorPoint")]
|
|
37931
|
+
pub struct VectorPoint {
|
|
37932
|
+
x: f32,
|
|
37933
|
+
y: f32,
|
|
37934
|
+
}
|
|
37935
|
+
|
|
37936
|
+
unsafe impl IntoValueFromNative for VectorPoint {}
|
|
37937
|
+
|
|
37938
|
+
impl magnus::TryConvert for VectorPoint {
|
|
37939
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
37940
|
+
if let Ok(r) = <&VectorPoint as magnus::TryConvert>::try_convert(val) {
|
|
37941
|
+
return Ok(r.clone());
|
|
37942
|
+
}
|
|
37943
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
37944
|
+
s
|
|
37945
|
+
} else {
|
|
37946
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
37947
|
+
magnus::Error::new(
|
|
37948
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37949
|
+
format!("no implicit conversion into VectorPoint: {}", e),
|
|
37950
|
+
)
|
|
37951
|
+
})?
|
|
37952
|
+
};
|
|
37953
|
+
serde_json::from_str::<VectorPoint>(&json_str).map_err(|e| {
|
|
37954
|
+
magnus::Error::new(
|
|
37955
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37956
|
+
format!("failed to deserialize VectorPoint: {}", e),
|
|
37957
|
+
)
|
|
37958
|
+
})
|
|
37959
|
+
}
|
|
37960
|
+
}
|
|
37961
|
+
|
|
37962
|
+
unsafe impl TryConvertOwned for VectorPoint {}
|
|
37963
|
+
|
|
37964
|
+
impl Default for VectorPoint {
|
|
37965
|
+
fn default() -> Self {
|
|
37966
|
+
xberg::VectorPoint::default().into()
|
|
37967
|
+
}
|
|
37968
|
+
}
|
|
37969
|
+
|
|
37970
|
+
impl VectorPoint {
|
|
37971
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
37972
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
37973
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
37974
|
+
let (kwargs_opt,) = args.optional;
|
|
37975
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
37976
|
+
Ok(Self {
|
|
37977
|
+
x: match kwargs.get(ruby.to_symbol("x")) {
|
|
37978
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37979
|
+
magnus::Error::new(
|
|
37980
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37981
|
+
format!("invalid value for `x`: {}", e),
|
|
37982
|
+
)
|
|
37983
|
+
})?,
|
|
37984
|
+
None => Default::default(),
|
|
37985
|
+
},
|
|
37986
|
+
y: match kwargs.get(ruby.to_symbol("y")) {
|
|
37987
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
37988
|
+
magnus::Error::new(
|
|
37989
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
37990
|
+
format!("invalid value for `y`: {}", e),
|
|
37991
|
+
)
|
|
37992
|
+
})?,
|
|
37993
|
+
None => Default::default(),
|
|
37994
|
+
},
|
|
37995
|
+
})
|
|
37996
|
+
}
|
|
37997
|
+
|
|
37998
|
+
fn x(&self) -> f32 {
|
|
37999
|
+
self.x
|
|
38000
|
+
}
|
|
38001
|
+
|
|
38002
|
+
fn y(&self) -> f32 {
|
|
38003
|
+
self.y
|
|
38004
|
+
}
|
|
38005
|
+
}
|
|
38006
|
+
|
|
38007
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
38008
|
+
#[serde(default)]
|
|
38009
|
+
#[magnus::wrap(class = "Xberg::VectorStroke")]
|
|
38010
|
+
pub struct VectorStroke {
|
|
38011
|
+
color: VectorColor,
|
|
38012
|
+
width: f32,
|
|
38013
|
+
dash_pattern: Option<VectorDashPattern>,
|
|
38014
|
+
line_cap: VectorLineCap,
|
|
38015
|
+
line_join: VectorLineJoin,
|
|
38016
|
+
}
|
|
38017
|
+
|
|
38018
|
+
unsafe impl IntoValueFromNative for VectorStroke {}
|
|
38019
|
+
|
|
38020
|
+
impl magnus::TryConvert for VectorStroke {
|
|
38021
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
38022
|
+
if let Ok(r) = <&VectorStroke as magnus::TryConvert>::try_convert(val) {
|
|
38023
|
+
return Ok(r.clone());
|
|
38024
|
+
}
|
|
38025
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
38026
|
+
s
|
|
38027
|
+
} else {
|
|
38028
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
38029
|
+
magnus::Error::new(
|
|
38030
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38031
|
+
format!("no implicit conversion into VectorStroke: {}", e),
|
|
38032
|
+
)
|
|
38033
|
+
})?
|
|
38034
|
+
};
|
|
38035
|
+
serde_json::from_str::<VectorStroke>(&json_str).map_err(|e| {
|
|
38036
|
+
magnus::Error::new(
|
|
38037
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38038
|
+
format!("failed to deserialize VectorStroke: {}", e),
|
|
38039
|
+
)
|
|
38040
|
+
})
|
|
38041
|
+
}
|
|
38042
|
+
}
|
|
38043
|
+
|
|
38044
|
+
unsafe impl TryConvertOwned for VectorStroke {}
|
|
38045
|
+
impl<'de> serde::Deserialize<'de> for VectorStroke {
|
|
38046
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
38047
|
+
where
|
|
38048
|
+
D: serde::Deserializer<'de>,
|
|
38049
|
+
{
|
|
38050
|
+
<xberg::VectorStroke as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
38051
|
+
}
|
|
38052
|
+
}
|
|
38053
|
+
|
|
38054
|
+
impl Default for VectorStroke {
|
|
38055
|
+
fn default() -> Self {
|
|
38056
|
+
xberg::VectorStroke::default().into()
|
|
38057
|
+
}
|
|
38058
|
+
}
|
|
38059
|
+
|
|
38060
|
+
impl VectorStroke {
|
|
38061
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
38062
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
38063
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
38064
|
+
let (kwargs_opt,) = args.optional;
|
|
38065
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
38066
|
+
Ok(Self {
|
|
38067
|
+
color: match kwargs.get(ruby.to_symbol("color")) {
|
|
38068
|
+
Some(v) => VectorColor::try_convert(v).map_err(|e| {
|
|
38069
|
+
magnus::Error::new(
|
|
38070
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38071
|
+
format!("invalid value for `color`: {}", e),
|
|
38072
|
+
)
|
|
38073
|
+
})?,
|
|
38074
|
+
None => Default::default(),
|
|
38075
|
+
},
|
|
38076
|
+
width: match kwargs.get(ruby.to_symbol("width")) {
|
|
38077
|
+
Some(v) => f32::try_convert(v).map_err(|e| {
|
|
38078
|
+
magnus::Error::new(
|
|
38079
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38080
|
+
format!("invalid value for `width`: {}", e),
|
|
38081
|
+
)
|
|
38082
|
+
})?,
|
|
38083
|
+
None => Default::default(),
|
|
38084
|
+
},
|
|
38085
|
+
dash_pattern: match kwargs.get(ruby.to_symbol("dash_pattern")).filter(|v| !v.is_nil()) {
|
|
38086
|
+
Some(v) => Some(VectorDashPattern::try_convert(v).map_err(|e| {
|
|
38087
|
+
magnus::Error::new(
|
|
38088
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38089
|
+
format!("invalid value for `dash_pattern`: {}", e),
|
|
38090
|
+
)
|
|
38091
|
+
})?),
|
|
38092
|
+
None => None,
|
|
38093
|
+
},
|
|
38094
|
+
line_cap: match kwargs.get(ruby.to_symbol("line_cap")) {
|
|
38095
|
+
Some(v) => VectorLineCap::try_convert(v).map_err(|e| {
|
|
38096
|
+
magnus::Error::new(
|
|
38097
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38098
|
+
format!("invalid value for `line_cap`: {}", e),
|
|
38099
|
+
)
|
|
38100
|
+
})?,
|
|
38101
|
+
None => VectorLineCap::Butt,
|
|
38102
|
+
},
|
|
38103
|
+
line_join: match kwargs.get(ruby.to_symbol("line_join")) {
|
|
38104
|
+
Some(v) => VectorLineJoin::try_convert(v).map_err(|e| {
|
|
38105
|
+
magnus::Error::new(
|
|
38106
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38107
|
+
format!("invalid value for `line_join`: {}", e),
|
|
38108
|
+
)
|
|
38109
|
+
})?,
|
|
38110
|
+
None => VectorLineJoin::Miter,
|
|
38111
|
+
},
|
|
38112
|
+
})
|
|
38113
|
+
}
|
|
38114
|
+
|
|
38115
|
+
fn color(&self) -> VectorColor {
|
|
38116
|
+
self.color.clone()
|
|
38117
|
+
}
|
|
38118
|
+
|
|
38119
|
+
fn width(&self) -> f32 {
|
|
38120
|
+
self.width
|
|
38121
|
+
}
|
|
38122
|
+
|
|
38123
|
+
fn dash_pattern(&self) -> Option<VectorDashPattern> {
|
|
38124
|
+
self.dash_pattern.clone()
|
|
38125
|
+
}
|
|
38126
|
+
|
|
38127
|
+
fn line_cap(&self) -> VectorLineCap {
|
|
38128
|
+
self.line_cap.clone()
|
|
38129
|
+
}
|
|
38130
|
+
|
|
38131
|
+
fn line_join(&self) -> VectorLineJoin {
|
|
38132
|
+
self.line_join.clone()
|
|
38133
|
+
}
|
|
38134
|
+
}
|
|
38135
|
+
|
|
38136
|
+
#[derive(Clone, Debug, serde::Serialize)]
|
|
38137
|
+
#[serde(default)]
|
|
38138
|
+
#[magnus::wrap(class = "Xberg::VectorSubpath")]
|
|
38139
|
+
pub struct VectorSubpath {
|
|
38140
|
+
start: VectorPoint,
|
|
38141
|
+
segments: Vec<VectorSegment>,
|
|
38142
|
+
closed: bool,
|
|
38143
|
+
}
|
|
38144
|
+
|
|
38145
|
+
unsafe impl IntoValueFromNative for VectorSubpath {}
|
|
38146
|
+
|
|
38147
|
+
impl magnus::TryConvert for VectorSubpath {
|
|
38148
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
38149
|
+
if let Ok(r) = <&VectorSubpath as magnus::TryConvert>::try_convert(val) {
|
|
38150
|
+
return Ok(r.clone());
|
|
38151
|
+
}
|
|
38152
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
38153
|
+
s
|
|
38154
|
+
} else {
|
|
38155
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
38156
|
+
magnus::Error::new(
|
|
38157
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38158
|
+
format!("no implicit conversion into VectorSubpath: {}", e),
|
|
38159
|
+
)
|
|
38160
|
+
})?
|
|
38161
|
+
};
|
|
38162
|
+
serde_json::from_str::<VectorSubpath>(&json_str).map_err(|e| {
|
|
38163
|
+
magnus::Error::new(
|
|
38164
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38165
|
+
format!("failed to deserialize VectorSubpath: {}", e),
|
|
38166
|
+
)
|
|
38167
|
+
})
|
|
38168
|
+
}
|
|
38169
|
+
}
|
|
38170
|
+
|
|
38171
|
+
unsafe impl TryConvertOwned for VectorSubpath {}
|
|
38172
|
+
impl<'de> serde::Deserialize<'de> for VectorSubpath {
|
|
38173
|
+
fn deserialize<D>(deserializer: D) -> ::core::result::Result<Self, D::Error>
|
|
38174
|
+
where
|
|
38175
|
+
D: serde::Deserializer<'de>,
|
|
38176
|
+
{
|
|
38177
|
+
<xberg::VectorSubpath as serde::Deserialize>::deserialize(deserializer).map(Into::into)
|
|
38178
|
+
}
|
|
38179
|
+
}
|
|
38180
|
+
|
|
38181
|
+
impl Default for VectorSubpath {
|
|
38182
|
+
fn default() -> Self {
|
|
38183
|
+
xberg::VectorSubpath::default().into()
|
|
38184
|
+
}
|
|
38185
|
+
}
|
|
38186
|
+
|
|
38187
|
+
impl VectorSubpath {
|
|
38188
|
+
fn new(args: &[magnus::Value]) -> Result<Self, magnus::Error> {
|
|
38189
|
+
let ruby = unsafe { magnus::Ruby::get_unchecked() };
|
|
38190
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::RHash>,), (), (), (), ()>(args)?;
|
|
38191
|
+
let (kwargs_opt,) = args.optional;
|
|
38192
|
+
let kwargs = kwargs_opt.unwrap_or_else(|| ruby.hash_new());
|
|
38193
|
+
Ok(Self {
|
|
38194
|
+
start: match kwargs.get(ruby.to_symbol("start")) {
|
|
38195
|
+
Some(v) => VectorPoint::try_convert(v).map_err(|e| {
|
|
38196
|
+
magnus::Error::new(
|
|
38197
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38198
|
+
format!("invalid value for `start`: {}", e),
|
|
38199
|
+
)
|
|
38200
|
+
})?,
|
|
38201
|
+
None => Default::default(),
|
|
38202
|
+
},
|
|
38203
|
+
segments: match kwargs.get(ruby.to_symbol("segments")) {
|
|
38204
|
+
Some(v) => <Vec<VectorSegment>>::try_convert(v).map_err(|e| {
|
|
38205
|
+
magnus::Error::new(
|
|
38206
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38207
|
+
format!("invalid value for `segments`: {}", e),
|
|
38208
|
+
)
|
|
38209
|
+
})?,
|
|
38210
|
+
None => Default::default(),
|
|
38211
|
+
},
|
|
38212
|
+
closed: match kwargs.get(ruby.to_symbol("closed")) {
|
|
38213
|
+
Some(v) => bool::try_convert(v).map_err(|e| {
|
|
38214
|
+
magnus::Error::new(
|
|
38215
|
+
unsafe { magnus::Ruby::get_unchecked() }.exception_type_error(),
|
|
38216
|
+
format!("invalid value for `closed`: {}", e),
|
|
38217
|
+
)
|
|
38218
|
+
})?,
|
|
38219
|
+
None => Default::default(),
|
|
38220
|
+
},
|
|
38221
|
+
})
|
|
38222
|
+
}
|
|
38223
|
+
|
|
38224
|
+
fn start(&self) -> VectorPoint {
|
|
38225
|
+
self.start.clone()
|
|
38226
|
+
}
|
|
38227
|
+
|
|
38228
|
+
fn segments(&self) -> Vec<VectorSegment> {
|
|
38229
|
+
self.segments.clone()
|
|
38230
|
+
}
|
|
38231
|
+
|
|
38232
|
+
fn closed(&self) -> bool {
|
|
38233
|
+
self.closed
|
|
38234
|
+
}
|
|
38235
|
+
}
|
|
38236
|
+
|
|
36294
38237
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
36295
38238
|
#[serde(default)]
|
|
36296
38239
|
#[magnus::wrap(class = "Xberg::XlsxAppProperties")]
|
|
@@ -43671,6 +45614,173 @@ impl magnus::TryConvert for UrlExtractionMode {
|
|
|
43671
45614
|
unsafe impl IntoValueFromNative for UrlExtractionMode {}
|
|
43672
45615
|
unsafe impl TryConvertOwned for UrlExtractionMode {}
|
|
43673
45616
|
|
|
45617
|
+
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, serde::Serialize, serde::Deserialize)]
|
|
45618
|
+
#[serde(rename_all = "snake_case")]
|
|
45619
|
+
pub enum VectorLineCap {
|
|
45620
|
+
Butt,
|
|
45621
|
+
Round,
|
|
45622
|
+
Square,
|
|
45623
|
+
}
|
|
45624
|
+
|
|
45625
|
+
impl Default for VectorLineCap {
|
|
45626
|
+
fn default() -> Self {
|
|
45627
|
+
Self::Butt
|
|
45628
|
+
}
|
|
45629
|
+
}
|
|
45630
|
+
|
|
45631
|
+
impl magnus::IntoValue for VectorLineCap {
|
|
45632
|
+
fn into_value_with(self, handle: &Ruby) -> magnus::Value {
|
|
45633
|
+
let sym = match self {
|
|
45634
|
+
VectorLineCap::Butt => "butt",
|
|
45635
|
+
VectorLineCap::Round => "round",
|
|
45636
|
+
VectorLineCap::Square => "square",
|
|
45637
|
+
};
|
|
45638
|
+
handle.to_symbol(sym).into_value_with(handle)
|
|
45639
|
+
}
|
|
45640
|
+
}
|
|
45641
|
+
|
|
45642
|
+
impl magnus::TryConvert for VectorLineCap {
|
|
45643
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
45644
|
+
// IntoValue emits Symbols, including when this enum is a Hash key.
|
|
45645
|
+
// Accept that exact representation as well as String inputs; do not
|
|
45646
|
+
// coerce arbitrary objects through to_s.
|
|
45647
|
+
let s: String = if let Some(symbol) = magnus::Symbol::from_value(val) {
|
|
45648
|
+
symbol.name()?.into_owned()
|
|
45649
|
+
} else {
|
|
45650
|
+
magnus::TryConvert::try_convert(val)?
|
|
45651
|
+
};
|
|
45652
|
+
// Accept the real serde wire value, the legacy always-snake_case symbol Magnus used to
|
|
45653
|
+
// emit unconditionally, and the verbatim PascalCase Rust variant name, so fixtures and
|
|
45654
|
+
// existing consumer code written in any of those styles keep working.
|
|
45655
|
+
match s.as_str() {
|
|
45656
|
+
"butt" | "Butt" => Ok(VectorLineCap::Butt),
|
|
45657
|
+
"round" | "Round" => Ok(VectorLineCap::Round),
|
|
45658
|
+
"square" | "Square" => Ok(VectorLineCap::Square),
|
|
45659
|
+
other => Err(magnus::Error::new(
|
|
45660
|
+
unsafe { Ruby::get_unchecked() }.exception_arg_error(),
|
|
45661
|
+
format!("invalid VectorLineCap value: {other}"),
|
|
45662
|
+
)),
|
|
45663
|
+
}
|
|
45664
|
+
}
|
|
45665
|
+
}
|
|
45666
|
+
|
|
45667
|
+
unsafe impl IntoValueFromNative for VectorLineCap {}
|
|
45668
|
+
unsafe impl TryConvertOwned for VectorLineCap {}
|
|
45669
|
+
|
|
45670
|
+
#[derive(Clone, Copy, PartialEq, Eq, Hash, Debug, serde::Serialize, serde::Deserialize)]
|
|
45671
|
+
#[serde(rename_all = "snake_case")]
|
|
45672
|
+
pub enum VectorLineJoin {
|
|
45673
|
+
Miter,
|
|
45674
|
+
Round,
|
|
45675
|
+
Bevel,
|
|
45676
|
+
}
|
|
45677
|
+
|
|
45678
|
+
impl Default for VectorLineJoin {
|
|
45679
|
+
fn default() -> Self {
|
|
45680
|
+
Self::Miter
|
|
45681
|
+
}
|
|
45682
|
+
}
|
|
45683
|
+
|
|
45684
|
+
impl magnus::IntoValue for VectorLineJoin {
|
|
45685
|
+
fn into_value_with(self, handle: &Ruby) -> magnus::Value {
|
|
45686
|
+
let sym = match self {
|
|
45687
|
+
VectorLineJoin::Miter => "miter",
|
|
45688
|
+
VectorLineJoin::Round => "round",
|
|
45689
|
+
VectorLineJoin::Bevel => "bevel",
|
|
45690
|
+
};
|
|
45691
|
+
handle.to_symbol(sym).into_value_with(handle)
|
|
45692
|
+
}
|
|
45693
|
+
}
|
|
45694
|
+
|
|
45695
|
+
impl magnus::TryConvert for VectorLineJoin {
|
|
45696
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
45697
|
+
// IntoValue emits Symbols, including when this enum is a Hash key.
|
|
45698
|
+
// Accept that exact representation as well as String inputs; do not
|
|
45699
|
+
// coerce arbitrary objects through to_s.
|
|
45700
|
+
let s: String = if let Some(symbol) = magnus::Symbol::from_value(val) {
|
|
45701
|
+
symbol.name()?.into_owned()
|
|
45702
|
+
} else {
|
|
45703
|
+
magnus::TryConvert::try_convert(val)?
|
|
45704
|
+
};
|
|
45705
|
+
// Accept the real serde wire value, the legacy always-snake_case symbol Magnus used to
|
|
45706
|
+
// emit unconditionally, and the verbatim PascalCase Rust variant name, so fixtures and
|
|
45707
|
+
// existing consumer code written in any of those styles keep working.
|
|
45708
|
+
match s.as_str() {
|
|
45709
|
+
"miter" | "Miter" => Ok(VectorLineJoin::Miter),
|
|
45710
|
+
"round" | "Round" => Ok(VectorLineJoin::Round),
|
|
45711
|
+
"bevel" | "Bevel" => Ok(VectorLineJoin::Bevel),
|
|
45712
|
+
other => Err(magnus::Error::new(
|
|
45713
|
+
unsafe { Ruby::get_unchecked() }.exception_arg_error(),
|
|
45714
|
+
format!("invalid VectorLineJoin value: {other}"),
|
|
45715
|
+
)),
|
|
45716
|
+
}
|
|
45717
|
+
}
|
|
45718
|
+
}
|
|
45719
|
+
|
|
45720
|
+
unsafe impl IntoValueFromNative for VectorLineJoin {}
|
|
45721
|
+
unsafe impl TryConvertOwned for VectorLineJoin {}
|
|
45722
|
+
|
|
45723
|
+
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
45724
|
+
#[serde(tag = "type")]
|
|
45725
|
+
#[serde(rename_all = "snake_case")]
|
|
45726
|
+
pub enum VectorSegment {
|
|
45727
|
+
Line {
|
|
45728
|
+
to: VectorPoint,
|
|
45729
|
+
},
|
|
45730
|
+
Cubic {
|
|
45731
|
+
control1: VectorPoint,
|
|
45732
|
+
control2: VectorPoint,
|
|
45733
|
+
to: VectorPoint,
|
|
45734
|
+
},
|
|
45735
|
+
}
|
|
45736
|
+
|
|
45737
|
+
impl magnus::IntoValue for VectorSegment {
|
|
45738
|
+
fn into_value_with(self, handle: &Ruby) -> magnus::Value {
|
|
45739
|
+
match serde_json::to_value(&self) {
|
|
45740
|
+
Ok(v) => json_to_ruby(handle, v),
|
|
45741
|
+
Err(_) => handle.qnil().into_value_with(handle),
|
|
45742
|
+
}
|
|
45743
|
+
}
|
|
45744
|
+
}
|
|
45745
|
+
|
|
45746
|
+
impl magnus::TryConvert for VectorSegment {
|
|
45747
|
+
fn try_convert(val: magnus::Value) -> Result<Self, magnus::Error> {
|
|
45748
|
+
// Generated Data variants carry native DTOs, not JSON-compatible display strings.
|
|
45749
|
+
let class_name: Option<String> = val.class().funcall("name", ())?; // For data enums with fields (e.g., PageAction), try to deserialize from JSON first.
|
|
45750
|
+
// For unit enums or when passed as a string, fall back to string-based conversion.
|
|
45751
|
+
let json_str: String = if let Ok(s) = <String as magnus::TryConvert>::try_convert(val) {
|
|
45752
|
+
s
|
|
45753
|
+
} else {
|
|
45754
|
+
val.funcall::<_, _, String>("to_json", ()).map_err(|e| {
|
|
45755
|
+
magnus::Error::new(
|
|
45756
|
+
unsafe { Ruby::get_unchecked() }.exception_type_error(),
|
|
45757
|
+
format!("no implicit conversion into VectorSegment: {}", e),
|
|
45758
|
+
)
|
|
45759
|
+
})?
|
|
45760
|
+
};
|
|
45761
|
+
// Try deserializing as JSON first (handles JSON strings like "\"markdown\"" or "{\"click\":{\"selector\":\"...\"}}\"")
|
|
45762
|
+
// For internally-tagged enums, a bare variant string is wrapped as {"<tag>": value}.
|
|
45763
|
+
// If that fails, try treating it as a plain string value and wrap in quotes
|
|
45764
|
+
// If both fail, try as Custom variant (for untagged enum support)
|
|
45765
|
+
serde_json::from_str(&json_str)
|
|
45766
|
+
.or_else(|_| serde_json::from_value(serde_json::json!({ "type": json_str })))
|
|
45767
|
+
.or_else(|_| serde_json::from_str(&format!("\"{json_str}\"")))
|
|
45768
|
+
.or_else(|_| {
|
|
45769
|
+
// Try as a JSON string for Custom variant (untagged enums accept any remaining value)
|
|
45770
|
+
match serde_json::to_value(&json_str) {
|
|
45771
|
+
Ok(val) => serde_json::from_value(val),
|
|
45772
|
+
Err(e) => Err(e),
|
|
45773
|
+
}
|
|
45774
|
+
})
|
|
45775
|
+
.map_err(|e| magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string()))
|
|
45776
|
+
}
|
|
45777
|
+
}
|
|
45778
|
+
|
|
45779
|
+
unsafe impl IntoValueFromNative for VectorSegment {}
|
|
45780
|
+
unsafe impl TryConvertOwned for VectorSegment {}
|
|
45781
|
+
|
|
45782
|
+
impl VectorSegment {}
|
|
45783
|
+
|
|
43674
45784
|
#[derive(Clone, Debug, serde::Serialize, serde::Deserialize)]
|
|
43675
45785
|
#[serde(tag = "mode")]
|
|
43676
45786
|
#[serde(rename_all = "snake_case")]
|
|
@@ -43841,6 +45951,29 @@ impl magnus::TryConvert for WhitespaceMode {
|
|
|
43841
45951
|
unsafe impl IntoValueFromNative for WhitespaceMode {}
|
|
43842
45952
|
unsafe impl TryConvertOwned for WhitespaceMode {}
|
|
43843
45953
|
|
|
45954
|
+
fn append_polygon_annotation(args: &[magnus::Value]) -> Result<Vec<u8>, Error> {
|
|
45955
|
+
let args = magnus::scan_args::scan_args::<(Vec<u8>, usize), (Option<magnus::Value>,), (), (), (), ()>(args)?;
|
|
45956
|
+
let (pdf, page_index) = args.required;
|
|
45957
|
+
|
|
45958
|
+
let (annotation,) = args.optional;
|
|
45959
|
+
|
|
45960
|
+
let annotation_core: xberg::extraction::plan_geometry::write::PolygonAnnotationInput = match annotation {
|
|
45961
|
+
Some(_v) if !_v.is_nil() => {
|
|
45962
|
+
let binding_val: PolygonAnnotationInput = PolygonAnnotationInput::try_convert(_v).map_err(|e| {
|
|
45963
|
+
magnus::Error::new(
|
|
45964
|
+
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
45965
|
+
e.to_string(),
|
|
45966
|
+
)
|
|
45967
|
+
})?;
|
|
45968
|
+
binding_val.into()
|
|
45969
|
+
}
|
|
45970
|
+
_ => Default::default(),
|
|
45971
|
+
};
|
|
45972
|
+
let result = xberg::extraction::plan_geometry::write::append_polygon_annotation(&pdf, page_index, &annotation_core)
|
|
45973
|
+
.map_err(alef_magnus_err)?;
|
|
45974
|
+
Ok(result.to_vec())
|
|
45975
|
+
}
|
|
45976
|
+
|
|
43844
45977
|
fn classify_chunks_owned(result: magnus::Value, config: magnus::Value) -> Result<ExtractedDocument, Error> {
|
|
43845
45978
|
let result_core: xberg::ExtractedDocument = {
|
|
43846
45979
|
let binding_val: ExtractedDocument = ExtractedDocument::try_convert(result).map_err(|e| {
|
|
@@ -44614,6 +46747,10 @@ fn ocr_backend_supports_language_for(args: &[magnus::Value]) -> Result<bool, Err
|
|
|
44614
46747
|
Ok(result)
|
|
44615
46748
|
}
|
|
44616
46749
|
|
|
46750
|
+
fn ort_session_options() -> OrtSessionOptions {
|
|
46751
|
+
xberg::ort_session_options().into()
|
|
46752
|
+
}
|
|
46753
|
+
|
|
44617
46754
|
#[cfg(feature = "pdf")]
|
|
44618
46755
|
fn pdf_page_count(args: &[magnus::Value]) -> Result<usize, Error> {
|
|
44619
46756
|
let args = magnus::scan_args::scan_args::<(Vec<u8>,), (Option<magnus::Value>,), (), (), (), ()>(args)?;
|
|
@@ -44742,6 +46879,26 @@ fn redact_external_async(args: &[magnus::Value]) -> Result<ExtractedDocument, Er
|
|
|
44742
46879
|
Ok(result.into())
|
|
44743
46880
|
}
|
|
44744
46881
|
|
|
46882
|
+
#[allow(unused_variables)]
|
|
46883
|
+
fn set_ort_session_options(args: &[magnus::Value]) -> Result<(), Error> {
|
|
46884
|
+
let args = magnus::scan_args::scan_args::<(), (Option<magnus::Value>,), (), (), (), ()>(args)?;
|
|
46885
|
+
let (options,) = args.optional;
|
|
46886
|
+
|
|
46887
|
+
let options: xberg::OrtSessionOptions = match options {
|
|
46888
|
+
Some(_v) if !_v.is_nil() => {
|
|
46889
|
+
let binding_val: OrtSessionOptions = OrtSessionOptions::try_convert(_v).map_err(|e| {
|
|
46890
|
+
magnus::Error::new(unsafe { Ruby::get_unchecked() }.exception_type_error(), e.to_string())
|
|
46891
|
+
})?;
|
|
46892
|
+
binding_val.into()
|
|
46893
|
+
}
|
|
46894
|
+
_ => Default::default(),
|
|
46895
|
+
};
|
|
46896
|
+
Err(magnus::Error::new(
|
|
46897
|
+
unsafe { Ruby::get_unchecked() }.exception_runtime_error(),
|
|
46898
|
+
"Not implemented: set_ort_session_options",
|
|
46899
|
+
))
|
|
46900
|
+
}
|
|
46901
|
+
|
|
44745
46902
|
#[cfg(feature = "markdown-footnotes")]
|
|
44746
46903
|
fn verify_excerpt(excerpt: String, source_text: String) -> bool {
|
|
44747
46904
|
xberg::verify_excerpt(&excerpt, &source_text)
|
|
@@ -49772,6 +51929,23 @@ impl From<xberg::AccelerationConfig> for AccelerationConfig {
|
|
|
49772
51929
|
}
|
|
49773
51930
|
}
|
|
49774
51931
|
|
|
51932
|
+
#[allow(clippy::needless_update)]
|
|
51933
|
+
impl From<AnnotationPoint> for xberg::AnnotationPoint {
|
|
51934
|
+
fn from(val: AnnotationPoint) -> Self {
|
|
51935
|
+
Self {
|
|
51936
|
+
x: val.x,
|
|
51937
|
+
y: val.y,
|
|
51938
|
+
..Default::default()
|
|
51939
|
+
}
|
|
51940
|
+
}
|
|
51941
|
+
}
|
|
51942
|
+
|
|
51943
|
+
impl From<xberg::AnnotationPoint> for AnnotationPoint {
|
|
51944
|
+
fn from(val: xberg::AnnotationPoint) -> Self {
|
|
51945
|
+
Self { x: val.x, y: val.y }
|
|
51946
|
+
}
|
|
51947
|
+
}
|
|
51948
|
+
|
|
49775
51949
|
#[allow(clippy::useless_conversion)]
|
|
49776
51950
|
impl From<ArchiveEntry> for xberg::ArchiveEntry {
|
|
49777
51951
|
fn from(val: ArchiveEntry) -> Self {
|
|
@@ -50569,7 +52743,7 @@ impl From<xberg::ContributorRole> for ContributorRole {
|
|
|
50569
52743
|
}
|
|
50570
52744
|
|
|
50571
52745
|
#[allow(clippy::needless_update)]
|
|
50572
|
-
#[allow(clippy::useless_conversion)]
|
|
52746
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
50573
52747
|
impl From<ConversionOptions> for html_to_markdown_rs::ConversionOptions {
|
|
50574
52748
|
fn from(val: ConversionOptions) -> Self {
|
|
50575
52749
|
Self {
|
|
@@ -50620,6 +52794,7 @@ impl From<ConversionOptions> for html_to_markdown_rs::ConversionOptions {
|
|
|
50620
52794
|
infer_dimensions: val.infer_dimensions,
|
|
50621
52795
|
max_depth: val.max_depth,
|
|
50622
52796
|
exclude_selectors: val.exclude_selectors.into_iter().collect(),
|
|
52797
|
+
data_as_elements: val.data_as_elements.map(|v| v.into_iter().collect()),
|
|
50623
52798
|
tier_strategy: val.tier_strategy.into(),
|
|
50624
52799
|
base_url: val.base_url,
|
|
50625
52800
|
..Default::default()
|
|
@@ -50678,6 +52853,7 @@ impl From<html_to_markdown_rs::ConversionOptions> for ConversionOptions {
|
|
|
50678
52853
|
infer_dimensions: val.infer_dimensions,
|
|
50679
52854
|
max_depth: val.max_depth,
|
|
50680
52855
|
exclude_selectors: val.exclude_selectors.into_iter().collect(),
|
|
52856
|
+
data_as_elements: val.data_as_elements.map(|v| v.into_iter().collect()),
|
|
50681
52857
|
tier_strategy: val.tier_strategy.into(),
|
|
50682
52858
|
base_url: val.base_url.map(|v| v.to_string()),
|
|
50683
52859
|
}
|
|
@@ -53748,6 +55924,42 @@ impl From<xberg::MarkdownLink> for MarkdownLink {
|
|
|
53748
55924
|
}
|
|
53749
55925
|
}
|
|
53750
55926
|
|
|
55927
|
+
#[allow(clippy::needless_update)]
|
|
55928
|
+
#[allow(clippy::redundant_closure)]
|
|
55929
|
+
impl From<MeasureData> for xberg::MeasureData {
|
|
55930
|
+
fn from(val: MeasureData) -> Self {
|
|
55931
|
+
Self {
|
|
55932
|
+
subtype: val.subtype,
|
|
55933
|
+
scale_ratio: val.scale_ratio,
|
|
55934
|
+
x: val.x.map(|v| v.into_iter().collect()),
|
|
55935
|
+
y: val.y.map(|v| v.into_iter().collect()),
|
|
55936
|
+
distance: val.distance.map(|v| v.into_iter().collect()),
|
|
55937
|
+
area: val.area.map(|v| v.into_iter().collect()),
|
|
55938
|
+
angle: val.angle.map(|v| v.into_iter().collect()),
|
|
55939
|
+
slope: val.slope.map(|v| v.into_iter().collect()),
|
|
55940
|
+
origin: val.origin,
|
|
55941
|
+
..Default::default()
|
|
55942
|
+
}
|
|
55943
|
+
}
|
|
55944
|
+
}
|
|
55945
|
+
|
|
55946
|
+
#[allow(clippy::redundant_closure)]
|
|
55947
|
+
impl From<xberg::MeasureData> for MeasureData {
|
|
55948
|
+
fn from(val: xberg::MeasureData) -> Self {
|
|
55949
|
+
Self {
|
|
55950
|
+
subtype: val.subtype.map(|v| v.to_string()),
|
|
55951
|
+
scale_ratio: val.scale_ratio.map(|v| v.to_string()),
|
|
55952
|
+
x: val.x.map(|v| v.into_iter().collect()),
|
|
55953
|
+
y: val.y.map(|v| v.into_iter().collect()),
|
|
55954
|
+
distance: val.distance.map(|v| v.into_iter().collect()),
|
|
55955
|
+
area: val.area.map(|v| v.into_iter().collect()),
|
|
55956
|
+
angle: val.angle.map(|v| v.into_iter().collect()),
|
|
55957
|
+
slope: val.slope.map(|v| v.into_iter().collect()),
|
|
55958
|
+
origin: val.origin.map(|v| v.to_string()),
|
|
55959
|
+
}
|
|
55960
|
+
}
|
|
55961
|
+
}
|
|
55962
|
+
|
|
53751
55963
|
#[allow(clippy::needless_update)]
|
|
53752
55964
|
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
53753
55965
|
impl From<Metadata> for xberg::Metadata {
|
|
@@ -54366,6 +56578,28 @@ impl From<xberg::OrientationResult> for OrientationResult {
|
|
|
54366
56578
|
}
|
|
54367
56579
|
}
|
|
54368
56580
|
|
|
56581
|
+
#[allow(clippy::needless_update)]
|
|
56582
|
+
impl From<OrtSessionOptions> for xberg::OrtSessionOptions {
|
|
56583
|
+
fn from(val: OrtSessionOptions) -> Self {
|
|
56584
|
+
Self {
|
|
56585
|
+
memory_pattern: val.memory_pattern,
|
|
56586
|
+
cpu_arena: val.cpu_arena,
|
|
56587
|
+
max_threads: val.max_threads,
|
|
56588
|
+
..Default::default()
|
|
56589
|
+
}
|
|
56590
|
+
}
|
|
56591
|
+
}
|
|
56592
|
+
|
|
56593
|
+
impl From<xberg::OrtSessionOptions> for OrtSessionOptions {
|
|
56594
|
+
fn from(val: xberg::OrtSessionOptions) -> Self {
|
|
56595
|
+
Self {
|
|
56596
|
+
memory_pattern: val.memory_pattern,
|
|
56597
|
+
cpu_arena: val.cpu_arena,
|
|
56598
|
+
max_threads: val.max_threads,
|
|
56599
|
+
}
|
|
56600
|
+
}
|
|
56601
|
+
}
|
|
56602
|
+
|
|
54369
56603
|
#[allow(clippy::needless_update)]
|
|
54370
56604
|
#[allow(clippy::useless_conversion)]
|
|
54371
56605
|
impl From<PaddleOcrConfig> for xberg::PaddleOcrConfig {
|
|
@@ -54532,6 +56766,8 @@ impl From<PageContent> for xberg::PageContent {
|
|
|
54532
56766
|
sheet_name: val.sheet_name,
|
|
54533
56767
|
ocr_confidence: val.ocr_confidence.map(Into::into),
|
|
54534
56768
|
native_content: val.native_content,
|
|
56769
|
+
geometry: val.geometry.map(Into::into),
|
|
56770
|
+
viewports: val.viewports.map(|v| v.into_iter().map(Into::into).collect()),
|
|
54535
56771
|
}
|
|
54536
56772
|
}
|
|
54537
56773
|
}
|
|
@@ -54553,6 +56789,8 @@ impl From<xberg::PageContent> for PageContent {
|
|
|
54553
56789
|
sheet_name: val.sheet_name.map(|v| v.to_string()),
|
|
54554
56790
|
ocr_confidence: val.ocr_confidence.map(Into::into),
|
|
54555
56791
|
native_content: val.native_content.map(|v| v.to_string()),
|
|
56792
|
+
geometry: val.geometry.map(Into::into),
|
|
56793
|
+
viewports: val.viewports.map(|v| v.into_iter().map(Into::into).collect()),
|
|
54556
56794
|
}
|
|
54557
56795
|
}
|
|
54558
56796
|
}
|
|
@@ -54577,6 +56815,28 @@ impl From<xberg::PageDimensions> for PageDimensions {
|
|
|
54577
56815
|
}
|
|
54578
56816
|
}
|
|
54579
56817
|
|
|
56818
|
+
#[allow(clippy::needless_update)]
|
|
56819
|
+
#[allow(clippy::useless_conversion)]
|
|
56820
|
+
impl From<PageGeometry> for xberg::PageGeometry {
|
|
56821
|
+
fn from(val: PageGeometry) -> Self {
|
|
56822
|
+
Self {
|
|
56823
|
+
paths: val.paths.into_iter().map(Into::into).collect(),
|
|
56824
|
+
regions: val.regions.into_iter().map(Into::into).collect(),
|
|
56825
|
+
..Default::default()
|
|
56826
|
+
}
|
|
56827
|
+
}
|
|
56828
|
+
}
|
|
56829
|
+
|
|
56830
|
+
#[allow(clippy::useless_conversion)]
|
|
56831
|
+
impl From<xberg::PageGeometry> for PageGeometry {
|
|
56832
|
+
fn from(val: xberg::PageGeometry) -> Self {
|
|
56833
|
+
Self {
|
|
56834
|
+
paths: val.paths.into_iter().map(Into::into).collect(),
|
|
56835
|
+
regions: val.regions.into_iter().map(Into::into).collect(),
|
|
56836
|
+
}
|
|
56837
|
+
}
|
|
56838
|
+
}
|
|
56839
|
+
|
|
54580
56840
|
#[allow(clippy::useless_conversion)]
|
|
54581
56841
|
impl From<PageHierarchy> for xberg::PageHierarchy {
|
|
54582
56842
|
fn from(val: PageHierarchy) -> Self {
|
|
@@ -54733,6 +56993,61 @@ impl From<xberg::PageStructure> for PageStructure {
|
|
|
54733
56993
|
}
|
|
54734
56994
|
}
|
|
54735
56995
|
|
|
56996
|
+
#[allow(clippy::needless_update)]
|
|
56997
|
+
#[allow(clippy::useless_conversion)]
|
|
56998
|
+
impl From<PageViewport> for xberg::PageViewport {
|
|
56999
|
+
fn from(val: PageViewport) -> Self {
|
|
57000
|
+
Self {
|
|
57001
|
+
bounding_box: val.bounding_box.into(),
|
|
57002
|
+
name: val.name,
|
|
57003
|
+
measure: val.measure.map(Into::into),
|
|
57004
|
+
..Default::default()
|
|
57005
|
+
}
|
|
57006
|
+
}
|
|
57007
|
+
}
|
|
57008
|
+
|
|
57009
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
57010
|
+
impl From<xberg::PageViewport> for PageViewport {
|
|
57011
|
+
fn from(val: xberg::PageViewport) -> Self {
|
|
57012
|
+
Self {
|
|
57013
|
+
bounding_box: val.bounding_box.into(),
|
|
57014
|
+
name: val.name.map(|v| v.to_string()),
|
|
57015
|
+
measure: val.measure.map(Into::into),
|
|
57016
|
+
}
|
|
57017
|
+
}
|
|
57018
|
+
}
|
|
57019
|
+
|
|
57020
|
+
#[allow(clippy::useless_conversion)]
|
|
57021
|
+
impl From<xberg::extraction::plan_geometry::drawing_set::ParsedDimension> for ParsedDimension {
|
|
57022
|
+
fn from(val: xberg::extraction::plan_geometry::drawing_set::ParsedDimension) -> Self {
|
|
57023
|
+
Self {
|
|
57024
|
+
text: val.text.to_string(),
|
|
57025
|
+
inches: val.inches,
|
|
57026
|
+
position: val.position.into(),
|
|
57027
|
+
}
|
|
57028
|
+
}
|
|
57029
|
+
}
|
|
57030
|
+
|
|
57031
|
+
impl From<ParsedScale> for xberg::extraction::plan_geometry::drawing_set::ParsedScale {
|
|
57032
|
+
fn from(val: ParsedScale) -> Self {
|
|
57033
|
+
Self {
|
|
57034
|
+
drawing_inches: val.drawing_inches,
|
|
57035
|
+
real_inches: val.real_inches,
|
|
57036
|
+
ratio: val.ratio,
|
|
57037
|
+
}
|
|
57038
|
+
}
|
|
57039
|
+
}
|
|
57040
|
+
|
|
57041
|
+
impl From<xberg::extraction::plan_geometry::drawing_set::ParsedScale> for ParsedScale {
|
|
57042
|
+
fn from(val: xberg::extraction::plan_geometry::drawing_set::ParsedScale) -> Self {
|
|
57043
|
+
Self {
|
|
57044
|
+
drawing_inches: val.drawing_inches,
|
|
57045
|
+
real_inches: val.real_inches,
|
|
57046
|
+
ratio: val.ratio,
|
|
57047
|
+
}
|
|
57048
|
+
}
|
|
57049
|
+
}
|
|
57050
|
+
|
|
54736
57051
|
#[allow(clippy::useless_conversion)]
|
|
54737
57052
|
impl From<xberg::text::redaction::patterns::PatternMatch> for PatternMatch {
|
|
54738
57053
|
fn from(val: xberg::text::redaction::patterns::PatternMatch) -> Self {
|
|
@@ -54759,6 +57074,13 @@ impl From<PdfAnnotation> for xberg::PdfAnnotation {
|
|
|
54759
57074
|
subject: val.subject,
|
|
54760
57075
|
quad_points: val.quad_points.map(|v| v.into_iter().map(Into::into).collect()),
|
|
54761
57076
|
marked_text: val.marked_text,
|
|
57077
|
+
vertices: val.vertices.map(|v| v.into_iter().map(Into::into).collect()),
|
|
57078
|
+
ink_list: val.ink_list.map(|v| {
|
|
57079
|
+
v.into_iter()
|
|
57080
|
+
.map(|inner| inner.into_iter().map(Into::into).collect())
|
|
57081
|
+
.collect()
|
|
57082
|
+
}),
|
|
57083
|
+
measure: val.measure.map(Into::into),
|
|
54762
57084
|
}
|
|
54763
57085
|
}
|
|
54764
57086
|
}
|
|
@@ -54777,6 +57099,13 @@ impl From<xberg::PdfAnnotation> for PdfAnnotation {
|
|
|
54777
57099
|
subject: val.subject.map(|v| v.to_string()),
|
|
54778
57100
|
quad_points: val.quad_points.map(|v| v.into_iter().map(Into::into).collect()),
|
|
54779
57101
|
marked_text: val.marked_text.map(|v| v.to_string()),
|
|
57102
|
+
vertices: val.vertices.map(|v| v.into_iter().map(Into::into).collect()),
|
|
57103
|
+
ink_list: val.ink_list.map(|v| {
|
|
57104
|
+
v.into_iter()
|
|
57105
|
+
.map(|inner| inner.into_iter().map(Into::into).collect())
|
|
57106
|
+
.collect()
|
|
57107
|
+
}),
|
|
57108
|
+
measure: val.measure.map(Into::into),
|
|
54780
57109
|
}
|
|
54781
57110
|
}
|
|
54782
57111
|
}
|
|
@@ -54801,6 +57130,9 @@ impl From<PdfConfig> for xberg::PdfConfig {
|
|
|
54801
57130
|
extract_form_fields: val.extract_form_fields,
|
|
54802
57131
|
reading_order: val.reading_order,
|
|
54803
57132
|
backend: val.backend.into(),
|
|
57133
|
+
extract_vector_geometry: val.extract_vector_geometry,
|
|
57134
|
+
#[cfg(feature = "pdf")]
|
|
57135
|
+
plan_regions: val.plan_regions.map(Into::into),
|
|
54804
57136
|
..Default::default()
|
|
54805
57137
|
}
|
|
54806
57138
|
}
|
|
@@ -54825,6 +57157,9 @@ impl From<xberg::PdfConfig> for PdfConfig {
|
|
|
54825
57157
|
extract_form_fields: val.extract_form_fields,
|
|
54826
57158
|
reading_order: val.reading_order,
|
|
54827
57159
|
backend: val.backend.into(),
|
|
57160
|
+
extract_vector_geometry: val.extract_vector_geometry,
|
|
57161
|
+
#[cfg(feature = "pdf")]
|
|
57162
|
+
plan_regions: val.plan_regions.map(Into::into),
|
|
54828
57163
|
}
|
|
54829
57164
|
}
|
|
54830
57165
|
}
|
|
@@ -54929,6 +57264,88 @@ impl From<xberg::PixelDimensions> for PixelDimensions {
|
|
|
54929
57264
|
}
|
|
54930
57265
|
}
|
|
54931
57266
|
|
|
57267
|
+
#[allow(clippy::needless_update)]
|
|
57268
|
+
#[allow(clippy::useless_conversion)]
|
|
57269
|
+
impl From<PlanRegion> for xberg::PlanRegion {
|
|
57270
|
+
fn from(val: PlanRegion) -> Self {
|
|
57271
|
+
Self {
|
|
57272
|
+
polygon: val.polygon.into_iter().map(Into::into).collect(),
|
|
57273
|
+
area: val.area,
|
|
57274
|
+
bounding_box: val.bounding_box.into(),
|
|
57275
|
+
text: val.text,
|
|
57276
|
+
..Default::default()
|
|
57277
|
+
}
|
|
57278
|
+
}
|
|
57279
|
+
}
|
|
57280
|
+
|
|
57281
|
+
#[allow(clippy::useless_conversion)]
|
|
57282
|
+
impl From<xberg::PlanRegion> for PlanRegion {
|
|
57283
|
+
fn from(val: xberg::PlanRegion) -> Self {
|
|
57284
|
+
Self {
|
|
57285
|
+
polygon: val.polygon.into_iter().map(Into::into).collect(),
|
|
57286
|
+
area: val.area,
|
|
57287
|
+
bounding_box: val.bounding_box.into(),
|
|
57288
|
+
text: val.text.to_string(),
|
|
57289
|
+
}
|
|
57290
|
+
}
|
|
57291
|
+
}
|
|
57292
|
+
|
|
57293
|
+
#[cfg(feature = "pdf")]
|
|
57294
|
+
#[allow(clippy::needless_update)]
|
|
57295
|
+
impl From<PlanRegionConfig> for xberg::core::config::PlanRegionConfig {
|
|
57296
|
+
fn from(val: PlanRegionConfig) -> Self {
|
|
57297
|
+
Self {
|
|
57298
|
+
enabled: val.enabled,
|
|
57299
|
+
snap_tolerance: val.snap_tolerance,
|
|
57300
|
+
gap_tolerance: val.gap_tolerance,
|
|
57301
|
+
max_segments: val.max_segments,
|
|
57302
|
+
..Default::default()
|
|
57303
|
+
}
|
|
57304
|
+
}
|
|
57305
|
+
}
|
|
57306
|
+
|
|
57307
|
+
#[cfg(feature = "pdf")]
|
|
57308
|
+
impl From<xberg::core::config::PlanRegionConfig> for PlanRegionConfig {
|
|
57309
|
+
fn from(val: xberg::core::config::PlanRegionConfig) -> Self {
|
|
57310
|
+
Self {
|
|
57311
|
+
enabled: val.enabled,
|
|
57312
|
+
snap_tolerance: val.snap_tolerance,
|
|
57313
|
+
gap_tolerance: val.gap_tolerance,
|
|
57314
|
+
max_segments: val.max_segments,
|
|
57315
|
+
}
|
|
57316
|
+
}
|
|
57317
|
+
}
|
|
57318
|
+
|
|
57319
|
+
#[allow(clippy::needless_update)]
|
|
57320
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
57321
|
+
impl From<PolygonAnnotationInput> for xberg::extraction::plan_geometry::write::PolygonAnnotationInput {
|
|
57322
|
+
fn from(val: PolygonAnnotationInput) -> Self {
|
|
57323
|
+
Self {
|
|
57324
|
+
vertices: val.vertices.into_iter().map(Into::into).collect(),
|
|
57325
|
+
rect: val.rect.map(Into::into),
|
|
57326
|
+
contents: val.contents,
|
|
57327
|
+
subject: val.subject,
|
|
57328
|
+
measure: val.measure.map(Into::into),
|
|
57329
|
+
color: val.color.map(|v| v.into_iter().collect()),
|
|
57330
|
+
..Default::default()
|
|
57331
|
+
}
|
|
57332
|
+
}
|
|
57333
|
+
}
|
|
57334
|
+
|
|
57335
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
57336
|
+
impl From<xberg::extraction::plan_geometry::write::PolygonAnnotationInput> for PolygonAnnotationInput {
|
|
57337
|
+
fn from(val: xberg::extraction::plan_geometry::write::PolygonAnnotationInput) -> Self {
|
|
57338
|
+
Self {
|
|
57339
|
+
vertices: val.vertices.into_iter().map(Into::into).collect(),
|
|
57340
|
+
rect: val.rect.map(Into::into),
|
|
57341
|
+
contents: val.contents.map(|v| v.to_string()),
|
|
57342
|
+
subject: val.subject.map(|v| v.to_string()),
|
|
57343
|
+
measure: val.measure.map(Into::into),
|
|
57344
|
+
color: val.color.map(|v| v.into_iter().collect()),
|
|
57345
|
+
}
|
|
57346
|
+
}
|
|
57347
|
+
}
|
|
57348
|
+
|
|
54932
57349
|
#[allow(clippy::needless_update)]
|
|
54933
57350
|
#[allow(clippy::redundant_closure)]
|
|
54934
57351
|
impl From<PostProcessorConfig> for xberg::PostProcessorConfig {
|
|
@@ -55606,6 +58023,29 @@ impl From<xberg::ServerConfig> for ServerConfig {
|
|
|
55606
58023
|
}
|
|
55607
58024
|
}
|
|
55608
58025
|
|
|
58026
|
+
#[allow(clippy::needless_update)]
|
|
58027
|
+
impl From<SheetMetadata> for xberg::extraction::plan_geometry::drawing_set::SheetMetadata {
|
|
58028
|
+
fn from(val: SheetMetadata) -> Self {
|
|
58029
|
+
Self {
|
|
58030
|
+
sheet_number: val.sheet_number,
|
|
58031
|
+
title: val.title,
|
|
58032
|
+
revision: val.revision,
|
|
58033
|
+
..Default::default()
|
|
58034
|
+
}
|
|
58035
|
+
}
|
|
58036
|
+
}
|
|
58037
|
+
|
|
58038
|
+
#[allow(clippy::redundant_closure)]
|
|
58039
|
+
impl From<xberg::extraction::plan_geometry::drawing_set::SheetMetadata> for SheetMetadata {
|
|
58040
|
+
fn from(val: xberg::extraction::plan_geometry::drawing_set::SheetMetadata) -> Self {
|
|
58041
|
+
Self {
|
|
58042
|
+
sheet_number: val.sheet_number.map(|v| v.to_string()),
|
|
58043
|
+
title: val.title.map(|v| v.to_string()),
|
|
58044
|
+
revision: val.revision.map(|v| v.to_string()),
|
|
58045
|
+
}
|
|
58046
|
+
}
|
|
58047
|
+
}
|
|
58048
|
+
|
|
55609
58049
|
#[allow(clippy::needless_update)]
|
|
55610
58050
|
impl From<SitemapUrl> for crawlberg::SitemapUrl {
|
|
55611
58051
|
fn from(val: SitemapUrl) -> Self {
|
|
@@ -56368,6 +58808,145 @@ impl From<xberg::UserChunkConfig> for UserChunkConfig {
|
|
|
56368
58808
|
}
|
|
56369
58809
|
}
|
|
56370
58810
|
|
|
58811
|
+
#[allow(clippy::needless_update)]
|
|
58812
|
+
impl From<VectorColor> for xberg::VectorColor {
|
|
58813
|
+
fn from(val: VectorColor) -> Self {
|
|
58814
|
+
Self {
|
|
58815
|
+
r: val.r,
|
|
58816
|
+
g: val.g,
|
|
58817
|
+
b: val.b,
|
|
58818
|
+
..Default::default()
|
|
58819
|
+
}
|
|
58820
|
+
}
|
|
58821
|
+
}
|
|
58822
|
+
|
|
58823
|
+
impl From<xberg::VectorColor> for VectorColor {
|
|
58824
|
+
fn from(val: xberg::VectorColor) -> Self {
|
|
58825
|
+
Self {
|
|
58826
|
+
r: val.r,
|
|
58827
|
+
g: val.g,
|
|
58828
|
+
b: val.b,
|
|
58829
|
+
}
|
|
58830
|
+
}
|
|
58831
|
+
}
|
|
58832
|
+
|
|
58833
|
+
#[allow(clippy::needless_update)]
|
|
58834
|
+
impl From<VectorDashPattern> for xberg::VectorDashPattern {
|
|
58835
|
+
fn from(val: VectorDashPattern) -> Self {
|
|
58836
|
+
Self {
|
|
58837
|
+
dashes: val.dashes.into_iter().collect(),
|
|
58838
|
+
phase: val.phase,
|
|
58839
|
+
..Default::default()
|
|
58840
|
+
}
|
|
58841
|
+
}
|
|
58842
|
+
}
|
|
58843
|
+
|
|
58844
|
+
impl From<xberg::VectorDashPattern> for VectorDashPattern {
|
|
58845
|
+
fn from(val: xberg::VectorDashPattern) -> Self {
|
|
58846
|
+
Self {
|
|
58847
|
+
dashes: val.dashes.into_iter().collect(),
|
|
58848
|
+
phase: val.phase,
|
|
58849
|
+
}
|
|
58850
|
+
}
|
|
58851
|
+
}
|
|
58852
|
+
|
|
58853
|
+
#[allow(clippy::needless_update)]
|
|
58854
|
+
#[allow(clippy::useless_conversion)]
|
|
58855
|
+
impl From<VectorPath> for xberg::VectorPath {
|
|
58856
|
+
fn from(val: VectorPath) -> Self {
|
|
58857
|
+
Self {
|
|
58858
|
+
subpaths: val.subpaths.into_iter().map(Into::into).collect(),
|
|
58859
|
+
bounding_box: val.bounding_box.into(),
|
|
58860
|
+
fill_color: val.fill_color.map(Into::into),
|
|
58861
|
+
stroke: val.stroke.map(Into::into),
|
|
58862
|
+
layer: val.layer,
|
|
58863
|
+
..Default::default()
|
|
58864
|
+
}
|
|
58865
|
+
}
|
|
58866
|
+
}
|
|
58867
|
+
|
|
58868
|
+
#[allow(clippy::redundant_closure, clippy::useless_conversion)]
|
|
58869
|
+
impl From<xberg::VectorPath> for VectorPath {
|
|
58870
|
+
fn from(val: xberg::VectorPath) -> Self {
|
|
58871
|
+
Self {
|
|
58872
|
+
subpaths: val.subpaths.into_iter().map(Into::into).collect(),
|
|
58873
|
+
bounding_box: val.bounding_box.into(),
|
|
58874
|
+
fill_color: val.fill_color.map(Into::into),
|
|
58875
|
+
stroke: val.stroke.map(Into::into),
|
|
58876
|
+
layer: val.layer.map(|v| v.to_string()),
|
|
58877
|
+
}
|
|
58878
|
+
}
|
|
58879
|
+
}
|
|
58880
|
+
|
|
58881
|
+
#[allow(clippy::needless_update)]
|
|
58882
|
+
impl From<VectorPoint> for xberg::VectorPoint {
|
|
58883
|
+
fn from(val: VectorPoint) -> Self {
|
|
58884
|
+
Self {
|
|
58885
|
+
x: val.x,
|
|
58886
|
+
y: val.y,
|
|
58887
|
+
..Default::default()
|
|
58888
|
+
}
|
|
58889
|
+
}
|
|
58890
|
+
}
|
|
58891
|
+
|
|
58892
|
+
impl From<xberg::VectorPoint> for VectorPoint {
|
|
58893
|
+
fn from(val: xberg::VectorPoint) -> Self {
|
|
58894
|
+
Self { x: val.x, y: val.y }
|
|
58895
|
+
}
|
|
58896
|
+
}
|
|
58897
|
+
|
|
58898
|
+
#[allow(clippy::needless_update)]
|
|
58899
|
+
#[allow(clippy::useless_conversion)]
|
|
58900
|
+
impl From<VectorStroke> for xberg::VectorStroke {
|
|
58901
|
+
fn from(val: VectorStroke) -> Self {
|
|
58902
|
+
Self {
|
|
58903
|
+
color: val.color.into(),
|
|
58904
|
+
width: val.width,
|
|
58905
|
+
dash_pattern: val.dash_pattern.map(Into::into),
|
|
58906
|
+
line_cap: val.line_cap.into(),
|
|
58907
|
+
line_join: val.line_join.into(),
|
|
58908
|
+
..Default::default()
|
|
58909
|
+
}
|
|
58910
|
+
}
|
|
58911
|
+
}
|
|
58912
|
+
|
|
58913
|
+
#[allow(clippy::useless_conversion)]
|
|
58914
|
+
impl From<xberg::VectorStroke> for VectorStroke {
|
|
58915
|
+
fn from(val: xberg::VectorStroke) -> Self {
|
|
58916
|
+
Self {
|
|
58917
|
+
color: val.color.into(),
|
|
58918
|
+
width: val.width,
|
|
58919
|
+
dash_pattern: val.dash_pattern.map(Into::into),
|
|
58920
|
+
line_cap: val.line_cap.into(),
|
|
58921
|
+
line_join: val.line_join.into(),
|
|
58922
|
+
}
|
|
58923
|
+
}
|
|
58924
|
+
}
|
|
58925
|
+
|
|
58926
|
+
#[allow(clippy::needless_update)]
|
|
58927
|
+
#[allow(clippy::useless_conversion)]
|
|
58928
|
+
impl From<VectorSubpath> for xberg::VectorSubpath {
|
|
58929
|
+
fn from(val: VectorSubpath) -> Self {
|
|
58930
|
+
Self {
|
|
58931
|
+
start: val.start.into(),
|
|
58932
|
+
segments: val.segments.into_iter().map(Into::into).collect(),
|
|
58933
|
+
closed: val.closed,
|
|
58934
|
+
..Default::default()
|
|
58935
|
+
}
|
|
58936
|
+
}
|
|
58937
|
+
}
|
|
58938
|
+
|
|
58939
|
+
#[allow(clippy::useless_conversion)]
|
|
58940
|
+
impl From<xberg::VectorSubpath> for VectorSubpath {
|
|
58941
|
+
fn from(val: xberg::VectorSubpath) -> Self {
|
|
58942
|
+
Self {
|
|
58943
|
+
start: val.start.into(),
|
|
58944
|
+
segments: val.segments.into_iter().map(Into::into).collect(),
|
|
58945
|
+
closed: val.closed,
|
|
58946
|
+
}
|
|
58947
|
+
}
|
|
58948
|
+
}
|
|
58949
|
+
|
|
56371
58950
|
#[allow(clippy::redundant_closure)]
|
|
56372
58951
|
impl From<xberg::extraction::office_metadata::app_properties::XlsxAppProperties> for XlsxAppProperties {
|
|
56373
58952
|
fn from(val: xberg::extraction::office_metadata::app_properties::XlsxAppProperties) -> Self {
|
|
@@ -59140,6 +61719,72 @@ impl From<xberg::UrlExtractionMode> for UrlExtractionMode {
|
|
|
59140
61719
|
}
|
|
59141
61720
|
}
|
|
59142
61721
|
|
|
61722
|
+
impl From<VectorLineCap> for xberg::VectorLineCap {
|
|
61723
|
+
fn from(val: VectorLineCap) -> Self {
|
|
61724
|
+
match val {
|
|
61725
|
+
VectorLineCap::Butt => Self::Butt,
|
|
61726
|
+
VectorLineCap::Round => Self::Round,
|
|
61727
|
+
VectorLineCap::Square => Self::Square,
|
|
61728
|
+
}
|
|
61729
|
+
}
|
|
61730
|
+
}
|
|
61731
|
+
|
|
61732
|
+
impl From<xberg::VectorLineCap> for VectorLineCap {
|
|
61733
|
+
fn from(val: xberg::VectorLineCap) -> Self {
|
|
61734
|
+
match val {
|
|
61735
|
+
xberg::VectorLineCap::Butt => Self::Butt,
|
|
61736
|
+
xberg::VectorLineCap::Round => Self::Round,
|
|
61737
|
+
xberg::VectorLineCap::Square => Self::Square,
|
|
61738
|
+
}
|
|
61739
|
+
}
|
|
61740
|
+
}
|
|
61741
|
+
|
|
61742
|
+
impl From<VectorLineJoin> for xberg::VectorLineJoin {
|
|
61743
|
+
fn from(val: VectorLineJoin) -> Self {
|
|
61744
|
+
match val {
|
|
61745
|
+
VectorLineJoin::Miter => Self::Miter,
|
|
61746
|
+
VectorLineJoin::Round => Self::Round,
|
|
61747
|
+
VectorLineJoin::Bevel => Self::Bevel,
|
|
61748
|
+
}
|
|
61749
|
+
}
|
|
61750
|
+
}
|
|
61751
|
+
|
|
61752
|
+
impl From<xberg::VectorLineJoin> for VectorLineJoin {
|
|
61753
|
+
fn from(val: xberg::VectorLineJoin) -> Self {
|
|
61754
|
+
match val {
|
|
61755
|
+
xberg::VectorLineJoin::Miter => Self::Miter,
|
|
61756
|
+
xberg::VectorLineJoin::Round => Self::Round,
|
|
61757
|
+
xberg::VectorLineJoin::Bevel => Self::Bevel,
|
|
61758
|
+
}
|
|
61759
|
+
}
|
|
61760
|
+
}
|
|
61761
|
+
|
|
61762
|
+
impl From<VectorSegment> for xberg::VectorSegment {
|
|
61763
|
+
fn from(val: VectorSegment) -> Self {
|
|
61764
|
+
match val {
|
|
61765
|
+
VectorSegment::Line { to } => Self::Line { to: to.into() },
|
|
61766
|
+
VectorSegment::Cubic { control1, control2, to } => Self::Cubic {
|
|
61767
|
+
control1: control1.into(),
|
|
61768
|
+
control2: control2.into(),
|
|
61769
|
+
to: to.into(),
|
|
61770
|
+
},
|
|
61771
|
+
}
|
|
61772
|
+
}
|
|
61773
|
+
}
|
|
61774
|
+
|
|
61775
|
+
impl From<xberg::VectorSegment> for VectorSegment {
|
|
61776
|
+
fn from(val: xberg::VectorSegment) -> Self {
|
|
61777
|
+
match val {
|
|
61778
|
+
xberg::VectorSegment::Line { to } => Self::Line { to: to.into() },
|
|
61779
|
+
xberg::VectorSegment::Cubic { control1, control2, to } => Self::Cubic {
|
|
61780
|
+
control1: control1.into(),
|
|
61781
|
+
control2: control2.into(),
|
|
61782
|
+
to: to.into(),
|
|
61783
|
+
},
|
|
61784
|
+
}
|
|
61785
|
+
}
|
|
61786
|
+
}
|
|
61787
|
+
|
|
59143
61788
|
impl From<VlmFallbackPolicy> for xberg::VlmFallbackPolicy {
|
|
59144
61789
|
fn from(val: VlmFallbackPolicy) -> Self {
|
|
59145
61790
|
match val {
|
|
@@ -59352,6 +61997,14 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
59352
61997
|
|
|
59353
61998
|
class.define_method("device_id", method!(AccelerationConfig::device_id, 0))?;
|
|
59354
61999
|
|
|
62000
|
+
let class = module.define_class("AnnotationPoint", ruby.class_object())?;
|
|
62001
|
+
|
|
62002
|
+
class.define_singleton_method("new", function!(AnnotationPoint::new, -1))?;
|
|
62003
|
+
|
|
62004
|
+
class.define_method("x", method!(AnnotationPoint::x, 0))?;
|
|
62005
|
+
|
|
62006
|
+
class.define_method("y", method!(AnnotationPoint::y, 0))?;
|
|
62007
|
+
|
|
59355
62008
|
let class = module.define_class("ArchiveEntry", ruby.class_object())?;
|
|
59356
62009
|
|
|
59357
62010
|
class.define_singleton_method("new", function!(ArchiveEntry::new, -1))?;
|
|
@@ -59996,6 +62649,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
59996
62649
|
|
|
59997
62650
|
class.define_method("exclude_selectors", method!(ConversionOptions::exclude_selectors, 0))?;
|
|
59998
62651
|
|
|
62652
|
+
class.define_method("data_as_elements", method!(ConversionOptions::data_as_elements, 0))?;
|
|
62653
|
+
|
|
59999
62654
|
class.define_method("tier_strategy", method!(ConversionOptions::tier_strategy, 0))?;
|
|
60000
62655
|
|
|
60001
62656
|
class.define_method("base_url", method!(ConversionOptions::base_url, 0))?;
|
|
@@ -60581,6 +63236,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
60581
63236
|
#[cfg(feature = "office")]
|
|
60582
63237
|
class.define_method("custom_properties", method!(DocxMetadata::custom_properties, 0))?;
|
|
60583
63238
|
|
|
63239
|
+
let class = module.define_class("DrawingSetText", ruby.class_object())?;
|
|
63240
|
+
|
|
60584
63241
|
let class = module.define_class("Element", ruby.class_object())?;
|
|
60585
63242
|
|
|
60586
63243
|
class.define_singleton_method("new", function!(Element::new, -1))?;
|
|
@@ -62271,6 +64928,28 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
62271
64928
|
|
|
62272
64929
|
class.define_method("url", method!(MarkdownLink::url, 0))?;
|
|
62273
64930
|
|
|
64931
|
+
let class = module.define_class("MeasureData", ruby.class_object())?;
|
|
64932
|
+
|
|
64933
|
+
class.define_singleton_method("new", function!(MeasureData::new, -1))?;
|
|
64934
|
+
|
|
64935
|
+
class.define_method("subtype", method!(MeasureData::subtype, 0))?;
|
|
64936
|
+
|
|
64937
|
+
class.define_method("scale_ratio", method!(MeasureData::scale_ratio, 0))?;
|
|
64938
|
+
|
|
64939
|
+
class.define_method("x", method!(MeasureData::x, 0))?;
|
|
64940
|
+
|
|
64941
|
+
class.define_method("y", method!(MeasureData::y, 0))?;
|
|
64942
|
+
|
|
64943
|
+
class.define_method("distance", method!(MeasureData::distance, 0))?;
|
|
64944
|
+
|
|
64945
|
+
class.define_method("area", method!(MeasureData::area, 0))?;
|
|
64946
|
+
|
|
64947
|
+
class.define_method("angle", method!(MeasureData::angle, 0))?;
|
|
64948
|
+
|
|
64949
|
+
class.define_method("slope", method!(MeasureData::slope, 0))?;
|
|
64950
|
+
|
|
64951
|
+
class.define_method("origin", method!(MeasureData::origin, 0))?;
|
|
64952
|
+
|
|
62274
64953
|
let class = module.define_class("MetaSchema", ruby.class_object())?;
|
|
62275
64954
|
|
|
62276
64955
|
#[cfg(feature = "presets")]
|
|
@@ -62754,6 +65433,16 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
62754
65433
|
#[cfg(feature = "auto-rotate-types")]
|
|
62755
65434
|
class.define_method("confidence", method!(OrientationResult::confidence, 0))?;
|
|
62756
65435
|
|
|
65436
|
+
let class = module.define_class("OrtSessionOptions", ruby.class_object())?;
|
|
65437
|
+
|
|
65438
|
+
class.define_singleton_method("new", function!(OrtSessionOptions::new, -1))?;
|
|
65439
|
+
|
|
65440
|
+
class.define_method("memory_pattern", method!(OrtSessionOptions::memory_pattern, 0))?;
|
|
65441
|
+
|
|
65442
|
+
class.define_method("cpu_arena", method!(OrtSessionOptions::cpu_arena, 0))?;
|
|
65443
|
+
|
|
65444
|
+
class.define_method("max_threads", method!(OrtSessionOptions::max_threads, 0))?;
|
|
65445
|
+
|
|
62757
65446
|
let class = module.define_class("PaddleOcrConfig", ruby.class_object())?;
|
|
62758
65447
|
|
|
62759
65448
|
class.define_singleton_method("new", function!(PaddleOcrConfig::new, -1))?;
|
|
@@ -62920,6 +65609,10 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
62920
65609
|
|
|
62921
65610
|
class.define_method("native_content", method!(PageContent::native_content, 0))?;
|
|
62922
65611
|
|
|
65612
|
+
class.define_method("geometry", method!(PageContent::geometry, 0))?;
|
|
65613
|
+
|
|
65614
|
+
class.define_method("viewports", method!(PageContent::viewports, 0))?;
|
|
65615
|
+
|
|
62923
65616
|
class.define_method("to_s", method!(PageContent::to_s, 0))?;
|
|
62924
65617
|
|
|
62925
65618
|
let class = module.define_class("PageDimensions", ruby.class_object())?;
|
|
@@ -62930,6 +65623,14 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
62930
65623
|
|
|
62931
65624
|
class.define_method("height", method!(PageDimensions::height, 0))?;
|
|
62932
65625
|
|
|
65626
|
+
let class = module.define_class("PageGeometry", ruby.class_object())?;
|
|
65627
|
+
|
|
65628
|
+
class.define_singleton_method("new", function!(PageGeometry::new, -1))?;
|
|
65629
|
+
|
|
65630
|
+
class.define_method("paths", method!(PageGeometry::paths, 0))?;
|
|
65631
|
+
|
|
65632
|
+
class.define_method("regions", method!(PageGeometry::regions, 0))?;
|
|
65633
|
+
|
|
62933
65634
|
let class = module.define_class("PageHierarchy", ruby.class_object())?;
|
|
62934
65635
|
|
|
62935
65636
|
class.define_singleton_method("new", function!(PageHierarchy::new, -1))?;
|
|
@@ -63031,6 +65732,36 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
63031
65732
|
|
|
63032
65733
|
class.define_method("pages", method!(PageStructure::pages, 0))?;
|
|
63033
65734
|
|
|
65735
|
+
let class = module.define_class("PageViewport", ruby.class_object())?;
|
|
65736
|
+
|
|
65737
|
+
class.define_singleton_method("new", function!(PageViewport::new, -1))?;
|
|
65738
|
+
|
|
65739
|
+
class.define_method("bounding_box", method!(PageViewport::bounding_box, 0))?;
|
|
65740
|
+
|
|
65741
|
+
class.define_method("name", method!(PageViewport::name, 0))?;
|
|
65742
|
+
|
|
65743
|
+
class.define_method("measure", method!(PageViewport::measure, 0))?;
|
|
65744
|
+
|
|
65745
|
+
let class = module.define_class("ParsedDimension", ruby.class_object())?;
|
|
65746
|
+
|
|
65747
|
+
class.define_singleton_method("new", function!(ParsedDimension::new, -1))?;
|
|
65748
|
+
|
|
65749
|
+
class.define_method("text", method!(ParsedDimension::text, 0))?;
|
|
65750
|
+
|
|
65751
|
+
class.define_method("inches", method!(ParsedDimension::inches, 0))?;
|
|
65752
|
+
|
|
65753
|
+
class.define_method("position", method!(ParsedDimension::position, 0))?;
|
|
65754
|
+
|
|
65755
|
+
let class = module.define_class("ParsedScale", ruby.class_object())?;
|
|
65756
|
+
|
|
65757
|
+
class.define_singleton_method("new", function!(ParsedScale::new, -1))?;
|
|
65758
|
+
|
|
65759
|
+
class.define_method("drawing_inches", method!(ParsedScale::drawing_inches, 0))?;
|
|
65760
|
+
|
|
65761
|
+
class.define_method("real_inches", method!(ParsedScale::real_inches, 0))?;
|
|
65762
|
+
|
|
65763
|
+
class.define_method("ratio", method!(ParsedScale::ratio, 0))?;
|
|
65764
|
+
|
|
63034
65765
|
let class = module.define_class("PatternMatch", ruby.class_object())?;
|
|
63035
65766
|
|
|
63036
65767
|
class.define_singleton_method("new", function!(PatternMatch::new, -1))?;
|
|
@@ -63067,6 +65798,12 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
63067
65798
|
|
|
63068
65799
|
class.define_method("marked_text", method!(PdfAnnotation::marked_text, 0))?;
|
|
63069
65800
|
|
|
65801
|
+
class.define_method("vertices", method!(PdfAnnotation::vertices, 0))?;
|
|
65802
|
+
|
|
65803
|
+
class.define_method("ink_list", method!(PdfAnnotation::ink_list, 0))?;
|
|
65804
|
+
|
|
65805
|
+
class.define_method("measure", method!(PdfAnnotation::measure, 0))?;
|
|
65806
|
+
|
|
63070
65807
|
class.define_method("to_s", method!(PdfAnnotation::to_s, 0))?;
|
|
63071
65808
|
|
|
63072
65809
|
let class = module.define_class("PdfConfig", ruby.class_object())?;
|
|
@@ -63116,6 +65853,15 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
63116
65853
|
#[cfg(feature = "pdf")]
|
|
63117
65854
|
class.define_method("backend", method!(PdfConfig::backend, 0))?;
|
|
63118
65855
|
|
|
65856
|
+
#[cfg(feature = "pdf")]
|
|
65857
|
+
class.define_method(
|
|
65858
|
+
"extract_vector_geometry",
|
|
65859
|
+
method!(PdfConfig::extract_vector_geometry, 0),
|
|
65860
|
+
)?;
|
|
65861
|
+
|
|
65862
|
+
#[cfg(feature = "pdf")]
|
|
65863
|
+
class.define_method("plan_regions", method!(PdfConfig::plan_regions, 0))?;
|
|
65864
|
+
|
|
63119
65865
|
#[cfg(feature = "pdf")]
|
|
63120
65866
|
class.define_method("validate", method!(PdfConfig::validate, 0))?;
|
|
63121
65867
|
|
|
@@ -63195,6 +65941,51 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
63195
65941
|
|
|
63196
65942
|
class.define_method("height", method!(PixelDimensions::height, 0))?;
|
|
63197
65943
|
|
|
65944
|
+
let class = module.define_class("PlanRegion", ruby.class_object())?;
|
|
65945
|
+
|
|
65946
|
+
class.define_singleton_method("new", function!(PlanRegion::new, -1))?;
|
|
65947
|
+
|
|
65948
|
+
class.define_method("polygon", method!(PlanRegion::polygon, 0))?;
|
|
65949
|
+
|
|
65950
|
+
class.define_method("area", method!(PlanRegion::area, 0))?;
|
|
65951
|
+
|
|
65952
|
+
class.define_method("bounding_box", method!(PlanRegion::bounding_box, 0))?;
|
|
65953
|
+
|
|
65954
|
+
class.define_method("text", method!(PlanRegion::text, 0))?;
|
|
65955
|
+
|
|
65956
|
+
let class = module.define_class("PlanRegionConfig", ruby.class_object())?;
|
|
65957
|
+
|
|
65958
|
+
#[cfg(feature = "pdf")]
|
|
65959
|
+
class.define_singleton_method("new", function!(PlanRegionConfig::new, -1))?;
|
|
65960
|
+
|
|
65961
|
+
#[cfg(feature = "pdf")]
|
|
65962
|
+
class.define_method("enabled", method!(PlanRegionConfig::enabled, 0))?;
|
|
65963
|
+
|
|
65964
|
+
#[cfg(feature = "pdf")]
|
|
65965
|
+
class.define_method("snap_tolerance", method!(PlanRegionConfig::snap_tolerance, 0))?;
|
|
65966
|
+
|
|
65967
|
+
#[cfg(feature = "pdf")]
|
|
65968
|
+
class.define_method("gap_tolerance", method!(PlanRegionConfig::gap_tolerance, 0))?;
|
|
65969
|
+
|
|
65970
|
+
#[cfg(feature = "pdf")]
|
|
65971
|
+
class.define_method("max_segments", method!(PlanRegionConfig::max_segments, 0))?;
|
|
65972
|
+
|
|
65973
|
+
let class = module.define_class("PolygonAnnotationInput", ruby.class_object())?;
|
|
65974
|
+
|
|
65975
|
+
class.define_singleton_method("new", function!(PolygonAnnotationInput::new, -1))?;
|
|
65976
|
+
|
|
65977
|
+
class.define_method("vertices", method!(PolygonAnnotationInput::vertices, 0))?;
|
|
65978
|
+
|
|
65979
|
+
class.define_method("rect", method!(PolygonAnnotationInput::rect, 0))?;
|
|
65980
|
+
|
|
65981
|
+
class.define_method("contents", method!(PolygonAnnotationInput::contents, 0))?;
|
|
65982
|
+
|
|
65983
|
+
class.define_method("subject", method!(PolygonAnnotationInput::subject, 0))?;
|
|
65984
|
+
|
|
65985
|
+
class.define_method("measure", method!(PolygonAnnotationInput::measure, 0))?;
|
|
65986
|
+
|
|
65987
|
+
class.define_method("color", method!(PolygonAnnotationInput::color, 0))?;
|
|
65988
|
+
|
|
63198
65989
|
let class = module.define_class("PostProcessorConfig", ruby.class_object())?;
|
|
63199
65990
|
|
|
63200
65991
|
class.define_singleton_method("new", function!(PostProcessorConfig::new, -1))?;
|
|
@@ -63742,6 +66533,16 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
63742
66533
|
method!(ServerConfig::max_multipart_field_mb, 0),
|
|
63743
66534
|
)?;
|
|
63744
66535
|
|
|
66536
|
+
let class = module.define_class("SheetMetadata", ruby.class_object())?;
|
|
66537
|
+
|
|
66538
|
+
class.define_singleton_method("new", function!(SheetMetadata::new, -1))?;
|
|
66539
|
+
|
|
66540
|
+
class.define_method("sheet_number", method!(SheetMetadata::sheet_number, 0))?;
|
|
66541
|
+
|
|
66542
|
+
class.define_method("title", method!(SheetMetadata::title, 0))?;
|
|
66543
|
+
|
|
66544
|
+
class.define_method("revision", method!(SheetMetadata::revision, 0))?;
|
|
66545
|
+
|
|
63745
66546
|
let class = module.define_class("SitemapUrl", ruby.class_object())?;
|
|
63746
66547
|
|
|
63747
66548
|
class.define_singleton_method("new", function!(SitemapUrl::new, -1))?;
|
|
@@ -64342,6 +67143,70 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
64342
67143
|
#[cfg(feature = "heuristics")]
|
|
64343
67144
|
class.define_method("disable_chunking", method!(UserChunkConfig::disable_chunking, 0))?;
|
|
64344
67145
|
|
|
67146
|
+
let class = module.define_class("VectorColor", ruby.class_object())?;
|
|
67147
|
+
|
|
67148
|
+
class.define_singleton_method("new", function!(VectorColor::new, -1))?;
|
|
67149
|
+
|
|
67150
|
+
class.define_method("r", method!(VectorColor::r, 0))?;
|
|
67151
|
+
|
|
67152
|
+
class.define_method("g", method!(VectorColor::g, 0))?;
|
|
67153
|
+
|
|
67154
|
+
class.define_method("b", method!(VectorColor::b, 0))?;
|
|
67155
|
+
|
|
67156
|
+
let class = module.define_class("VectorDashPattern", ruby.class_object())?;
|
|
67157
|
+
|
|
67158
|
+
class.define_singleton_method("new", function!(VectorDashPattern::new, -1))?;
|
|
67159
|
+
|
|
67160
|
+
class.define_method("dashes", method!(VectorDashPattern::dashes, 0))?;
|
|
67161
|
+
|
|
67162
|
+
class.define_method("phase", method!(VectorDashPattern::phase, 0))?;
|
|
67163
|
+
|
|
67164
|
+
let class = module.define_class("VectorPath", ruby.class_object())?;
|
|
67165
|
+
|
|
67166
|
+
class.define_singleton_method("new", function!(VectorPath::new, -1))?;
|
|
67167
|
+
|
|
67168
|
+
class.define_method("subpaths", method!(VectorPath::subpaths, 0))?;
|
|
67169
|
+
|
|
67170
|
+
class.define_method("bounding_box", method!(VectorPath::bounding_box, 0))?;
|
|
67171
|
+
|
|
67172
|
+
class.define_method("fill_color", method!(VectorPath::fill_color, 0))?;
|
|
67173
|
+
|
|
67174
|
+
class.define_method("stroke", method!(VectorPath::stroke, 0))?;
|
|
67175
|
+
|
|
67176
|
+
class.define_method("layer", method!(VectorPath::layer, 0))?;
|
|
67177
|
+
|
|
67178
|
+
let class = module.define_class("VectorPoint", ruby.class_object())?;
|
|
67179
|
+
|
|
67180
|
+
class.define_singleton_method("new", function!(VectorPoint::new, -1))?;
|
|
67181
|
+
|
|
67182
|
+
class.define_method("x", method!(VectorPoint::x, 0))?;
|
|
67183
|
+
|
|
67184
|
+
class.define_method("y", method!(VectorPoint::y, 0))?;
|
|
67185
|
+
|
|
67186
|
+
let class = module.define_class("VectorStroke", ruby.class_object())?;
|
|
67187
|
+
|
|
67188
|
+
class.define_singleton_method("new", function!(VectorStroke::new, -1))?;
|
|
67189
|
+
|
|
67190
|
+
class.define_method("color", method!(VectorStroke::color, 0))?;
|
|
67191
|
+
|
|
67192
|
+
class.define_method("width", method!(VectorStroke::width, 0))?;
|
|
67193
|
+
|
|
67194
|
+
class.define_method("dash_pattern", method!(VectorStroke::dash_pattern, 0))?;
|
|
67195
|
+
|
|
67196
|
+
class.define_method("line_cap", method!(VectorStroke::line_cap, 0))?;
|
|
67197
|
+
|
|
67198
|
+
class.define_method("line_join", method!(VectorStroke::line_join, 0))?;
|
|
67199
|
+
|
|
67200
|
+
let class = module.define_class("VectorSubpath", ruby.class_object())?;
|
|
67201
|
+
|
|
67202
|
+
class.define_singleton_method("new", function!(VectorSubpath::new, -1))?;
|
|
67203
|
+
|
|
67204
|
+
class.define_method("start", method!(VectorSubpath::start, 0))?;
|
|
67205
|
+
|
|
67206
|
+
class.define_method("segments", method!(VectorSubpath::segments, 0))?;
|
|
67207
|
+
|
|
67208
|
+
class.define_method("closed", method!(VectorSubpath::closed, 0))?;
|
|
67209
|
+
|
|
64345
67210
|
let class = module.define_class("XlsxAppProperties", ruby.class_object())?;
|
|
64346
67211
|
|
|
64347
67212
|
class.define_singleton_method("new", function!(XlsxAppProperties::new, -1))?;
|
|
@@ -64406,6 +67271,8 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
64406
67271
|
|
|
64407
67272
|
class.define_singleton_method("legibility", function!(ConfidenceSemantics::_factory_legibility, 1))?;
|
|
64408
67273
|
|
|
67274
|
+
module.define_module_function("append_polygon_annotation", function!(append_polygon_annotation, -1))?;
|
|
67275
|
+
|
|
64409
67276
|
module.define_module_function("classify_chunks_owned", function!(classify_chunks_owned_async, 2))?;
|
|
64410
67277
|
|
|
64411
67278
|
module.define_module_function("doctor", function!(doctor, -1))?;
|
|
@@ -64492,12 +67359,16 @@ fn ruby_init(ruby: &Ruby) -> Result<(), Error> {
|
|
|
64492
67359
|
function!(ocr_backend_supports_language_for, -1),
|
|
64493
67360
|
)?;
|
|
64494
67361
|
|
|
67362
|
+
module.define_module_function("ort_session_options", function!(ort_session_options, 0))?;
|
|
67363
|
+
|
|
64495
67364
|
#[cfg(feature = "pdf")]
|
|
64496
67365
|
module.define_module_function("pdf_page_count", function!(pdf_page_count, -1))?;
|
|
64497
67366
|
|
|
64498
67367
|
#[cfg(feature = "redaction")]
|
|
64499
67368
|
module.define_module_function("redact_external", function!(redact_external_async, -1))?;
|
|
64500
67369
|
|
|
67370
|
+
module.define_module_function("set_ort_session_options", function!(set_ort_session_options, -1))?;
|
|
67371
|
+
|
|
64501
67372
|
#[cfg(feature = "markdown-footnotes")]
|
|
64502
67373
|
module.define_module_function("verify_excerpt", function!(verify_excerpt, 2))?;
|
|
64503
67374
|
|