#! /usr/bin/python -t # _*_ coding: iso-8859-1 _*_ # Last edited on 2019-08-25 21:42:59 by jstolfi MODULE_NAME = "js_int_image" MODULE_DESC = "In-core format and ops for integer-valued images" MODULE_VERS = "1.0" MODULE_COPYRIGHT = "Copyright © 2019 State University of Campinas (UNICAMP)" import js_disclaimers import js_int_image_IMP class t (js_int_image_IMP.t) : "In-core format for images with integer samples.\n" \ "\n" \ " A {js_int_image.t} instance is a triplet {dims=(chns,cols,rows)}, an" \ " integer {maxval}, and a three-dimensional array" \ " of integer samples in the range {0..maxval}. The first index of the" \ " array is the channel, then raster column and row. The number of channels" " is usually 1 (grey), 2 (grey+alpha), 3 (RGB), or 4 (RGB+alpha).\n" def get_dims(self): "Returns the array dimension triplet {dims=(chns,cols,rows)}." return js_int_image_IMP.t.get_dims(self) # --------------------------------------------------------------------- def get_maxval(self): "Returns the maximum sample value (an integer in {0..65535})." return js_int_image_IMP.t.get_maxval(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. All array elements must be integers in {0..maxval}, or {None} " return js_int_image_IMP.t.get_samples(self) # --------------------------------------------------------------------- def create(dims,maxval,val): "Creates an image with dimensions {dims} and max sample {maxval}. The sample array is filled with the value {val} (which must be an integer in {0..maxval}." return js_int_image_IMP.create(dims,maxval,val) help_info_NO_WARRANTY = jsdisclaimers.NO_WARRANTY help_info_STANDARD_RIGHTS = jsdisclaimers.STANDARD_RIGHTS # ----------------------------------------------------------------------