Skip to content

Commit

Permalink
sync
Browse files Browse the repository at this point in the history
  • Loading branch information
stefanmaierhofer committed Feb 8, 2024
1 parent 7eb89f5 commit ac71ae8
Showing 1 changed file with 12 additions and 3 deletions.
15 changes: 12 additions & 3 deletions src/Aardvark.Geometry.Quadtree/Layer.fs
Original file line number Diff line number Diff line change
Expand Up @@ -182,11 +182,15 @@ type Layer<'a when 'a : equality>(def : Durable.Def, data : 'a[], mapping : Data
member this.Resample (targetSampleExponent : int) =

if (targetSampleExponent = this.SampleExponent) then

// nothing to do, this layer already has desired sample exponent
this

else
if this.SampleExponent > targetSampleExponent then

// supersample
if this.SampleExponent > targetSampleExponent then

if this.Mapping.BufferOrigin.IsCenteredAtOrigin then
failwith "Resampling of layer with centered cell origin is not supported. Error 4f3d2ef0-9d9e-499d-baef-eeaa12e9ade9."

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

failwith "TODO supersample"
else
let newMapping = DataMapping(origin = w.Min, size = V2i(w.Size), exponent = e)
let result = Layer<'a>(def = this.Def, data = buffer, mapping = newMapping)

result

// subsample
else
failwith "Subsampling layers not supported. Error 88e63cb7-7be7-4136-976f-d81bd12e3246."


Expand Down

0 comments on commit ac71ae8

Please sign in to comment.