ALBULA  4.0.1
dectris.albula.DColorMap Class Reference

class DColorMap lets you map image data to rgb data. More...

Static Public Member Functions

def rgb (img, foreground, background, logForeground, colorTable, format="RGBA", mask=None, viewport=None, cutoff=0, highlightDefective=False, highlightSaturated=False)
 Map img to rgb. More...
 
def legend (width, height, foreground, background, logForeground, colorTable, format="RGBA")
 Create legend containing of a color bar and its labelling. More...
 

Detailed Description

class DColorMap lets you map image data to rgb data.

Member Function Documentation

◆ legend()

def dectris.albula.DColorMap.legend (   width,
  height,
  foreground,
  background,
  logForeground,
  colorTable,
  format = "RGBA" 
)
static

Create legend containing of a color bar and its labelling.

The color varies in the vertical direction of the color bar.

Parameters
widthInteger. Width of the color bar
heightInteger. Height of the color bar
foregroundFloat
backgroundFloat
logForegroundFloat
colorTableDColorTable
formatString. The coding is 0xFFRRGGBB (0xRRGGBBFF) for "ARGB" ("RGBA")
Returns
Tuple of DImage containing the color bar and dict mapping vertical positions to intensities.

◆ rgb()

def dectris.albula.DColorMap.rgb (   img,
  foreground,
  background,
  logForeground,
  colorTable,
  format = "RGBA",
  mask = None,
  viewport = None,
  cutoff = 0,
  highlightDefective = False,
  highlightSaturated = False 
)
static

Map img to rgb.

Depending on the format parameter the color samples are coded in integers. Using the linear and logarithmic color paths of the given colorTable intensities between background and foreground are linearly mapped along the linear path. If colorTable has a logarithmic path intensities between foreground and logForeground a logarithmically mapped along the logarithmic path.

Parameters
imgDImage
foregroundFloat value
backgroundFloat value
logForegroundFloat value
colorTableDColorTable
formatString. The coding is 0xFFRRGGBB (0xRRGGBBFF) for "ARGB" ("RGBA")
maskDImage that defines the defective ( $\pm 2$) and gap pixels ( $\pm 1$).
viewportDRect. If given only the region defined by viewport is mapped
cutoffInteger. If cutoff is given and highlightSaturated is True, intensities above cutoff are highlighted by a color depending on colorTable.
highlightDefectiveBool. If mask is given and hightlightDefective is True, defective pixels are highlighted by a color depending on colorTable.
highlightSaturatedBool. If cutoff is given and highlightSaturated is True, intensities above cutoff are highlighted by a color depending on colorTable.
Returns
DImage that contains the rgb data.