org.sunflow.image

Class Color


public final class Color
extends java.lang.Object

Field Summary

static Color
BLACK
static Color
BLUE
static Color
CYAN
static Color
GRAY
static Color
GREEN
static Color
MAGENTA
static Color
RED
static Color
WHITE
static Color
YELLOW

Constructor Summary

Color()
Color(float gray)
Color(float r, float g, float b)
Color(int rgb)
Color(Color c)

Method Summary

Color
add(Color c)
static Color
add(Color c1, Color c2)
static Color
add(Color c1, Color c2, Color dest)
static Color
black()
static Color
blend(Color c1, Color c2, float b)
static Color
blend(Color c1, Color c2, float b, Color dest)
static Color
blend(Color c1, Color c2, Color b)
static Color
blend(Color c1, Color c2, Color b, Color dest)
Color
clamp(float min, float max)
Color
constrainRGB()
Color
copy()
Color
div(Color c)
static Color
div(Color c1, Color c2)
static Color
div(Color c1, Color c2, Color dest)
Color
exp()
float
getAverage()
float
getLuminance()
float
getMax()
float
getMin()
float[]
getRGB()
static boolean
hasContrast(Color c1, Color c2, float thresh)
boolean
isBlack()
boolean
isInf()
boolean
isNan()
Color
madd(float s, Color c)
Color
madd(Color s, Color c)
Color
mul(float s)
static Color
mul(float s, Color c)
static Color
mul(float s, Color c, Color dest)
Color
mul(Color c)
static Color
mul(Color c1, Color c2)
static Color
mul(Color c1, Color c2, Color dest)
Color
opposite()
Color
set(float r, float g, float b)
Color
set(Color c)
Color
setRGB(int rgb)
Color
setRGBE(int rgbe)
Color
sub(Color c)
static Color
sub(Color c1, Color c2)
static Color
sub(Color c1, Color c2, Color dest)
Color
toLinear()
Color
toNonLinear()
int
toRGB()
int
toRGBE()
String
toString()
static Color
white()

Field Details

BLACK

public static final Color BLACK

BLUE

public static final Color BLUE

CYAN

public static final Color CYAN

GRAY

public static final Color GRAY

GREEN

public static final Color GREEN

MAGENTA

public static final Color MAGENTA

RED

public static final Color RED

WHITE

public static final Color WHITE

YELLOW

public static final Color YELLOW

Constructor Details

Color

public Color()

Color

public Color(float gray)

Color

public Color(float r,
             float g,
             float b)

Color

public Color(int rgb)

Color

public Color(Color c)

Method Details

add

public final Color add(Color c)

add

public static final Color add(Color c1,
                              Color c2)

add

public static final Color add(Color c1,
                              Color c2,
                              Color dest)

black

public static Color black()

blend

public static final Color blend(Color c1,
                                Color c2,
                                float b)

blend

public static final Color blend(Color c1,
                                Color c2,
                                float b,
                                Color dest)

blend

public static final Color blend(Color c1,
                                Color c2,
                                Color b)

blend

public static final Color blend(Color c1,
                                Color c2,
                                Color b,
                                Color dest)

clamp

public final Color clamp(float min,
                         float max)

constrainRGB

public final Color constrainRGB()

copy

public Color copy()

div

public final Color div(Color c)

div

public static final Color div(Color c1,
                              Color c2)

div

public static final Color div(Color c1,
                              Color c2,
                              Color dest)

exp

public final Color exp()

getAverage

public final float getAverage()

getLuminance

public final float getLuminance()

getMax

public final float getMax()

getMin

public final float getMin()

getRGB

public final float[] getRGB()

hasContrast

public static final boolean hasContrast(Color c1,
                                        Color c2,
                                        float thresh)

isBlack

public final boolean isBlack()

isInf

public final boolean isInf()

isNan

public final boolean isNan()

madd

public final Color madd(float s,
                        Color c)

madd

public final Color madd(Color s,
                        Color c)

mul

public final Color mul(float s)

mul

public static final Color mul(float s,
                              Color c)

mul

public static final Color mul(float s,
                              Color c,
                              Color dest)

mul

public final Color mul(Color c)

mul

public static final Color mul(Color c1,
                              Color c2)

mul

public static final Color mul(Color c1,
                              Color c2,
                              Color dest)

opposite

public final Color opposite()

set

public final Color set(float r,
                       float g,
                       float b)

set

public final Color set(Color c)

setRGB

public final Color setRGB(int rgb)

setRGBE

public final Color setRGBE(int rgbe)

sub

public final Color sub(Color c)

sub

public static final Color sub(Color c1,
                              Color c2)

sub

public static final Color sub(Color c1,
                              Color c2,
                              Color dest)

toLinear

public Color toLinear()

toNonLinear

public Color toNonLinear()

toRGB

public final int toRGB()

toRGBE

public final int toRGBE()

toString

public String toString()

white

public static Color white()