Commit da77114e authored by Paul McCarthy's avatar Paul McCarthy 🚵
Browse files

BF: Don't normalise vector data stored as uint8/RGB24

parent 8d1ca63e
......@@ -77,6 +77,12 @@ class GLLineVector(glvector.GLVector):
with np.errstate(invalid='ignore'):
# Vector images stored as RGB24 data
# type are assumed to map from [0, 255]
# to [-1, 1], so cannot be normalised
if image.nvals > 1:
return data
# calculate lengths
x = data[0, ...]
y = data[1, ...]
......@@ -92,7 +98,7 @@ class GLLineVector(glvector.GLVector):
def prefilterRange(dmin, dmax):
if self.opts.unitLength:
return 0, 1.0
return 0, 1
else:
return dmin, dmax
......@@ -305,7 +311,6 @@ class GLLineVertices:
# The image may either
# have shape (X, Y, Z, 3)
if image.nvals == 1:
vertices = np.array(data, dtype=np.float32)
# Or (we assume) a RGB
......
......@@ -82,6 +82,13 @@ class GLRGBVector(glvector.GLVector):
else: vecImage = image
def prefilter(data):
# Vector images stored as RGB24 data
# type are assumed to map from [0, 255]
# to [-1, 1], so cannot be normalised
if image.nvals > 1:
return data
# make absolute, and scale to unit
# length if required. We must make
# the data absolute, otherwise we
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment