Class ImageDataMapping (version 0.20)

Description: A structure describing the data mapping of an image object

Data mapping is the process of transforming the data into RGB pixel values. This implementation provides four adjustment steps: first, in the case of monochrome data, the data is converted to a RGB triplet using the color map. The default color map will copy the value to all channels rendering a gray scale. After having normalized the data to 0..1 cooresponding to the min_value and max_value settings of the image, a color channel-independent brightness and contrast adjustment is applied. Then, a per-channel multiplier (red_gain, green_gain, blue_gain) is applied. Finally, the gamma function is applied and the result converted into a 0..255 pixel value range and clipped.

Class overview

Index

Method Overview

[static] ImageDataMapping newCreate a new data mapping object with default settings
clear_colormapThe the color map of this data mapping object.
add_colormap_entry( double value, unsigned int color )Add a colormap entry for this data mapping object.
[const] unsigned int num_colormap_entriesReturns the current number of color map entries.
[const] unsigned int colormap_color( unsigned int n )Returns the color for a given color map entry.
[const] double colormap_value( unsigned int n )Returns the vlue for a given color map entry.
brightness=( double brightness )Set the brightness
[const] double brightnessThe brightness value
contrast=( double contrast )Set the contrast
[const] double contrastThe contrast value
gamma=( double gamma )Set the gamma
[const] double gammaThe gamma value
red_gain=( double red_gain )Set the red_gain
[const] double red_gainThe red channel gain
green_gain=( double green_gain )Set the green_gain
[const] double green_gainThe green channel gain
blue_gain=( double blue_gain )Set the blue_gain
[const] double blue_gainThe blue channel gain
assign( ImageDataMapping other )Assign the contents of another object to self
[const] ImageDataMapping dupCreates a copy of self.
destroyExplicitly destroy the object
[const] bool destroyedTell, if the object was destroyed

add_colormap_entry( double value, unsigned int color )

Description: Add a colormap entry for this data mapping object.

This settings establishes a color mapping for a given value in the monochrome channel. The color must be given as a 32 bit integer, where the lowest order byte describes the blue component (0 to 255), the second byte the green component and the third byte the red component, i.e. 0xff0000 is red and 0x0000ff is blue.

value:The value at which the given color should be applied.
color:The color to apply (a 32 bit RGB value).

assign( ImageDataMapping other )

Description: Assign the contents of another object to self

This method assigns the contents of another object to self. This is a deep copy that does not only copy the reference but the actual content.

[const] double blue_gain

Description: The blue channel gain

This value is the multiplier by which the blue channel is scaled after applying false color transformation and contrast/brightness/gamma.

1.0 is a neutral value. The gain should be >=0.0.

blue_gain=( double blue_gain )

Description: Set the blue_gain

See blue_gain for a description of this property.

[const] double brightness

Description: The brightness value

The brightness is a double value between roughly -1.0 and 1.0. Neutral (original) brightness is 0.0.

brightness=( double brightness )

Description: Set the brightness

See brightness for a description of this property.

clear_colormap

Description: The the color map of this data mapping object.

[const] unsigned int colormap_color( unsigned int n )

Description: Returns the color for a given color map entry.

n:The index of the entry (0..num_colormap_entries-1)
returns:The color (see add_colormap_entry for a description).

[const] double colormap_value( unsigned int n )

Description: Returns the vlue for a given color map entry.

n:The index of the entry (0..num_colormap_entries-1)
returns:The value (see add_colormap_entry for a description).

[const] double contrast

Description: The contrast value

The contrast is a double value between roughly -1.0 and 1.0. Neutral (original) contrast is 0.0.

contrast=( double contrast )

Description: Set the contrast

See contrast for a description of this property.

destroy

Description: Explicitly destroy the object

Explicitly destroy the object on C++ side if it was owned by the Ruby interpreter. Subsequent access to this object will throw an exception. If the object is not owned by Ruby, this method will do nothing.

[const] bool destroyed

Description: Tell, if the object was destroyed

This method returns true, if the object was destroyed, either explicitly or by the C++ side. The latter may happen, if the object is owned by a C++ object which got destroyed itself.

[const] ImageDataMapping dup

Description: Creates a copy of self.

[const] double gamma

Description: The gamma value

The gamma value allows to adjust for non-linearities in the display chain and to enhance contrast. A value for linear intensity reproduction on the screen is roughly 0.5. The exact value depends on the monitor calibration. Values below 1.0 give a "softer" appearance while values above 1.0 give a "harder" appearance.

gamma=( double gamma )

Description: Set the gamma

See gamma for a description of this property.

[const] double green_gain

Description: The green channel gain

This value is the multiplier by which the green channel is scaled after applying false color transformation and contrast/brightness/gamma.

1.0 is a neutral value. The gain should be >=0.0.

green_gain=( double green_gain )

Description: Set the green_gain

See green_gain for a description of this property.

[static] ImageDataMapping new

Description: Create a new data mapping object with default settings

[const] unsigned int num_colormap_entries

Description: Returns the current number of color map entries.

returns:The number of entries.

[const] double red_gain

Description: The red channel gain

This value is the multiplier by which the red channel is scaled after applying false color transformation and contrast/brightness/gamma.

1.0 is a neutral value. The gain should be >=0.0.

red_gain=( double red_gain )

Description: Set the red_gain

See red_gain for a description of this property.