JSR-234 1.1

javax.microedition.amms.control.imageeffect
Interface ImageTonalityControl

All Superinterfaces:
javax.microedition.media.Control, EffectControl

public interface ImageTonalityControl
extends EffectControl

ImageTonalityControl is an effect that can be used to set various image settings such as brightness, contrast and gamma.

Setting of the brightness, contrast and gamma can be done by setting to an absolute value between 0 and 100 or using relative setting where the level is set to PREVIOUS or NEXT level or automatic setting where the level is set to AUTO. The number of supported levels can be queried by getBrightnessLevels, getContrastLevels or getGammaLevels methods.


Field Summary
static int AUTO
          Automatic setting.
static int NEXT
          Moves the setting to the next supported level.
static int PREVIOUS
          Moves the setting to the previous supported level.
 
Fields inherited from interface javax.microedition.amms.control.EffectControl
SCOPE_LIVE_AND_RECORD, SCOPE_LIVE_ONLY, SCOPE_RECORD_ONLY
 
Method Summary
 int getBrightness()
          Returns the current brightness value.
 int getBrightnessLevels()
          Returns the number of brightness setting levels.
 int getContrast()
          Returns the contrast value.
 int getContrastLevels()
          Returns the number of contrast setting levels.
 int getGamma()
          Returns the gamma adjustment value.
 int getGammaLevels()
          Returns the number of gamma adjustment setting levels.
 int setBrightness(int level)
          Sets the brightness.
 int setContrast(int level)
          Sets the contrast value.
 int setGamma(int level)
          Sets the gamma adjustment value.
 
Methods inherited from interface javax.microedition.amms.control.EffectControl
getPreset, getPresetNames, getScope, isEnabled, isEnforced, setEnabled, setEnforced, setPreset, setScope
 

Field Detail

AUTO

static final int AUTO
Automatic setting.

See Also:
Constant Field Values

NEXT

static final int NEXT
Moves the setting to the next supported level.

See Also:
Constant Field Values

PREVIOUS

static final int PREVIOUS
Moves the setting to the previous supported level.

See Also:
Constant Field Values
Method Detail

setBrightness

int setBrightness(int level)
Sets the brightness. The default brightness value can be asked with the getBrightness method before setting the new value.

Brightness adjusts the average light value of the image.

The brightness value is in the range of 0 to 100, where 100 gives the brightest image. The value 50 means that no brightness correction will be made. Setting the value to AUTO turns on the automatic brightness setting. If the automatic brightness setting is not supported, setting automatic brightness on returns the current brightness value.

Parameters:
level - the new brightness value or NEXT or PREVIOUS to set the brightness to the next or previous supported level, respectively or AUTO to use automatic brightness setting
Returns:
brightness value after setting the new value or AUTO if in the automatic brightness setting mode
Throws:
java.lang.IllegalArgumentException - if neither of the following is true
  • level >= 0 and level <= 100
  • level is either NEXT or PREVIOUS or AUTO.

getBrightness

int getBrightness()
Returns the current brightness value.

Returns:
the current brightness value or AUTO if in the automatic brightness setting mode

getBrightnessLevels

int getBrightnessLevels()
Returns the number of brightness setting levels.

Returns:
the number of brightness setting levels

setContrast

int setContrast(int level)
Sets the contrast value. The default contrast value can be asked by getContrast before setting the new value.

The contrast adjusts the value difference between the lightest and darkest elements of an image.

The contrast value is in the range of 0 to 100 where 100 gives the image with the greatest contrast. The value 50 means that no contrast correction will be made. Setting the value to AUTO turns on the automatic contrast setting. If the automatic contrast setting is not supported, setting automatic contrast on returns the current contrast value.

Parameters:
level - the new contrast value or NEXT or PREVIOUS to set the contrast to the next or previous supported level, respectively or AUTO to use automatic contrast setting
Returns:
contrast that was actually set by the implementation or AUTO if in the automatic contrast setting mode
Throws:
java.lang.IllegalArgumentException - if neither of the following is true
  • level >= 0 and level <= 100
  • level is either NEXT or PREVIOUS or AUTO.

getContrast

int getContrast()
Returns the contrast value.

Returns:
the current contrast value or AUTO if in the automatic contrast setting mode

getContrastLevels

int getContrastLevels()
Returns the number of contrast setting levels.

Returns:
the number of contrast setting levels

setGamma

int setGamma(int level)
Sets the gamma adjustment value. The default gamma value can be asked with the getGamma method before setting the new value.

Gamma adjusts the curvature of the brightness output curve of this effect. A higher gamma value makes the pixels of middle brightness level lighter and a lower gamma makes these pixels darker. High gamma values can be used, for example, to make targets in the shadows lighter and still keeping the darkest pixels dark.

The gamma adjustment value is in the range from 0 to 100. The parameter value of 50 corresponds to the gamma adjustment of 1.0. The value AUTO sets the gamma setting to automatic.

Parameters:
level - new gamma adjustment value or NEXT or PREVIOUS to set the gamma to the next or previous supported level, respectively or AUTO to use the automatic gamma setting
Returns:
gamma adjustment value that was actually set or AUTO if in the automatic gamma setting mode
Throws:
java.lang.IllegalArgumentException - if neither of the following is true
  • level >= 0 and level <= 100.
  • level is either NEXT or PREVIOUS or AUTO.

getGamma

int getGamma()
Returns the gamma adjustment value.

Returns:
the current gamma adjustment value or AUTO if in the automatic gamma setting mode

getGammaLevels

int getGammaLevels()
Returns the number of gamma adjustment setting levels.

Returns:
the number of gamma adjustment setting levels

JSR-234 1.1

Copyright © 2004-2007 Nokia Corporation. See the Copyright for details.