#! /usr/bin/python -t # _*_ coding: iso-8859-1 _*_ # Last edited on 2019-08-26 02:28:57 by jstolfi MODULE_NAME = "js_float_image" MODULE_DESC = "In-core format and ops for float-valued images" MODULE_VERS = "1.0" MODULE_COPYRIGHT = "Copyright © 2019 State University of Campinas (UNICAMP)" import js_disclaimers import js_float_image_IMP class t (js_float_image_IMP.t) : "In-core format for images with float samples.\n" \ "\n" \ " A {js_float_image.t} instance is a triplet {dims=(chns,cols,rows)} and a three-dimensional array {smp} of float samples. Typically the samples are intensities between 0 (black) and 1 (max device intensity), but other ranges and semantics often occur. The sample in row {iy], column {ix}, and channel {ic} is {smp[iy][ix][ic]}.\n" def get_dims(self): "Returns the array dimension triplet {dims=(chns,cols,rows)}." return js_float_image_IMP.t.get_dims(self) # --------------------------------------------------------------------- def get_samples(self): "Returns the sample array. The array is shared, not copied; therefore, assigning to an element of this array changes the image itself." return js_float_image_IMP.t.get_samples(self) # --------------------------------------------------------------------- def create(dims,val): "Creates an image with dimensions {dims}. The sample array is filled with the value {val} (which must be a float or {None})." return js_float_image_IMP.create(dims,maxval,val) help_info_NO_WARRANTY = jsdisclaimers.NO_WARRANTY help_info_STANDARD_RIGHTS = jsdisclaimers.STANDARD_RIGHTS # ----------------------------------------------------------------------