Start line:  
End line:  

Snippet Preview

Snippet HTML Code

Stack Overflow Questions
  /*
   * @(#)DefaultImageAdjustmentModel.java  1.0  2012-01-18
   * 
   * Copyright (c) 2012 Werner Randelshofer, Goldau, Switzerland.
   * All rights reserved.
   * 
   * You may not use, copy or modify this file, except in compliance with the
   * license agreement you entered into with Werner Randelshofer.
   * For details see accompanying license terms.
  */
 package org.monte.media.converter;
 
DefaultImageAdjustmentModel.

Author(s):
Werner Randelshofer
Version:
1.0 2012-01-18 Created.
 
 public class DefaultColorAdjustModel
         extends AbstractBean implements ColorAdjustModel {

    
Level adjustment: white point in the range [0,1].
 
     protected float whitePoint = 1.0f;
    
Level adjustment: black point in the range [0,1].
 
     protected float blackPoint = 0.0f;
    
Level adjustment: mid point in the range [0,1].
 
     protected float midPoint = 0.5f;
    
Brightness adjustment in the range [-1,1].
 
     protected float brightness = 0f;
    
Exposure adjustment in the range [-1,1].
 
     protected float exposure = 0f;
    
Contrast adjustment in the range [-1,1].
 
     protected float contrast = 0f;
    
Saturation adjustment in the range [0,1].
 
     protected float saturation = 0.5f;
    
Definition adjustment in the range [0,1].
 
     protected float definition = 0f;
    
Higlights adjustment in the range [0,1].
 
     protected float highlights = 0f;
    
Shadows adjustment in the range [0,1].
 
     protected float shadows = 0f;
    
Sharpness adjustment in the range [0,1].
 
     protected float sharpness = 0f;
    
De-noise adjustment in the range [0,1].
 
     protected float denoise = 0f;
    
Temperature adjustment in the range [-1,1].
 
     protected float temperature = 0f;
    
Tint adjustment in the range [-1,1].
 
     protected float tint = 0f;
    
White balance terms {Rmu,Rnu, Bmu, Bnu}.
 
     private float[] whiteBalanceQM = {0, 1, 0, 1};
     private boolean whiteBalanceTTEnabled = true;
     private boolean whiteBalanceQMEnabled = true;
 
     public DefaultColorAdjustModel() {
         reset();
     }
 
     @Override
     public void reset() {
         setWhitePoint(1);
         setBlackPoint(0);
         setMidPoint(0.5f);
         setBrightness(0f);
         setExposure(0f);
         setContrast(0f);
         setSaturation(0.5f);
         setDefinition(0f);
         setHighlights(0f);
         setShadows(0f);
         setSharpness(0f);
         setDenoise(0f);
         setTemperature(0f);
         setTint(0f);
         setWhiteBalanceQM(new float[]{0, 1, 0, 1});
         setWhiteBalanceQMEnabled(false);
         setWhiteBalanceTTEnabled(true);
     }

    
Get the value of whitePoint

Returns:
the value of whitePoint
    @Override
    public float getWhitePoint() {
        return ;
    }

    
Set the value of whitePoint

Parameters:
newValue new value of whitePoint
    @Override
    public void setWhitePoint(float newValue) {
        float oldValue = ;
         = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getBlackPoint() {
        return ;
    }
    @Override
    public void setBlackPoint(float newValue) {
        float oldValue = ;
         = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getMidPoint() {
        return ;
    }
    @Override
    public void setMidPoint(float newValue) {
        float oldValue = ;
         = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getContrast() {
        return ;
    }
    @Override
    public void setContrast(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getDefinition() {
        return ;
    }
    @Override
    public void setDefinition(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getDenoise() {
        return ;
    }
    @Override
    public void setDenoise(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getBrightness() {
        return ;
    }
    @Override
    public void setBrightness(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getExposure() {
        return ;
    }
    @Override
    public void setExposure(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getHighlights() {
        return ;
    }
    @Override
    public void setHighlights(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getSaturation() {
        return ;
    }
    @Override
    public void setSaturation(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getShadows() {
        return ;
    }
    @Override
    public void setShadows(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getSharpness() {
        return ;
    }
    @Override
    public void setSharpness(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getTemperature() {
        return ;
    }
    @Override
    public void setTemperature(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float getTint() {
        return ;
    }
    @Override
    public void setTint(float newValue) {
        float oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public void setWhiteBalanceQM(float[] newValue) {
        float[] oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public float[] getWhiteBalanceQM() {
        return  == null ? null : .clone();
    }
    @Override
    public void setWhiteBalanceQMEnabled(boolean newValue) {
        boolean oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public boolean isWhiteBalanceQMEnabled() {
        return ;
    }
    @Override
    public void setWhiteBalanceTTEnabled(boolean newValue) {
        boolean oldValue = ;
        this. = newValue;
        firePropertyChange(oldValuenewValue);
    }
    @Override
    public boolean isWhiteBalanceTTEnabled() {
        return ;
    }
    @Override
    public void setTo(ColorAdjustModel that) {
         = that.getWhitePoint();
         = that.getBlackPoint();
         = that.getMidPoint();
        =that.getBrightness();
         = that.getExposure();
         = that.getContrast();
         = that.getSaturation();
         = that.getDefinition();
         = that.getHighlights();
         = that.getShadows();
         = that.getSharpness();
         = that.getDenoise();
         = that.getTemperature();
         = that.getTint();
         = that.getWhiteBalanceQM();
        firePropertyChange(nullfalsetrue);
    }
    @Override
    public boolean isIdentity() {
        return  == 1//
                &&  == 0//
                &&  == 0.5//
                &&  == 0//
                &&  == 0//
                &&  == 0//
                &&  == 0.5//
                &&  == 0//
                &&  == 0//
                &&  == 0//
                &&  == 0//
                &&  == 0//
                && (!
                ||  == 0//
                &&  == 0)//
                && (!
                || [0] == 0//
                && [1] == 1//
                && [2] == 0//
                && [3] == 1)//
                ;
    }
New to GrepCode? Check out our FAQ X