Skip to content

Commit ac71ae8

Browse files
sync
1 parent 7eb89f5 commit ac71ae8

File tree

1 file changed

+12
-3
lines changed

1 file changed

+12
-3
lines changed

src/Aardvark.Geometry.Quadtree/Layer.fs

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -182,11 +182,15 @@ type Layer<'a when 'a : equality>(def : Durable.Def, data : 'a[], mapping : Data
182182
member this.Resample (targetSampleExponent : int) =
183183

184184
if (targetSampleExponent = this.SampleExponent) then
185+
185186
// nothing to do, this layer already has desired sample exponent
186187
this
188+
187189
else
188-
if this.SampleExponent > targetSampleExponent then
189190

191+
// supersample
192+
if this.SampleExponent > targetSampleExponent then
193+
190194
if this.Mapping.BufferOrigin.IsCenteredAtOrigin then
191195
failwith "Resampling of layer with centered cell origin is not supported. Error 4f3d2ef0-9d9e-499d-baef-eeaa12e9ade9."
192196

@@ -236,8 +240,13 @@ type Layer<'a when 'a : equality>(def : Durable.Def, data : 'a[], mapping : Data
236240
w <- Box2l(w.Min * 2L, w.Max * 2L)
237241
e <- e - 1
238242

239-
failwith "TODO supersample"
240-
else
243+
let newMapping = DataMapping(origin = w.Min, size = V2i(w.Size), exponent = e)
244+
let result = Layer<'a>(def = this.Def, data = buffer, mapping = newMapping)
245+
246+
result
247+
248+
// subsample
249+
else
241250
failwith "Subsampling layers not supported. Error 88e63cb7-7be7-4136-976f-d81bd12e3246."
242251

243252

0 commit comments

Comments
 (0)