YxyDiagramGeometry

public sealed class YxyDiagramGeometry
All the vector geometry part of a chromaticity diagram cached for a specific frame. Try re-using instances of this class if possible to avoid unnecessary overhead.

Constructors

YxyDiagramGeometry

#
Create a new diagram.
public YxyDiagramGeometry(
RectangleF
frame
Frame.
)

Properties

Frame

#
Gets the frame this geometry is cached for.
public RectangleF Frame { get; }

GamutBlue

#
Gets the blue corner of the sRGB gamut triangle.
public PointF GamutBlue { get; }

GamutGreen

#
Gets the green corner of the sRGB gamut triangle.
public PointF GamutGreen { get; }

GamutRed

#
Gets the red corner of the sRGB gamut triangle.
public PointF GamutRed { get; }

Grid

#
Gets the grid rectangle. It takes up 80% of the frame width and 90% of the frame height.
public RectangleF Grid { get; }

PlanckInfinity

#
Gets the end point of the Planckian locus.
public PointF PlanckInfinity { get; }

PlanckThousand

#
Gets the start point of the Planckian locus.
public PointF PlanckThousand { get; }

YxyUnit

#
Gets the texture rectangle unit target rectangle. It exceeds the frame, but is used only to position Yxy vectorial unitised geometry within the grid.
public RectangleF YxyUnit { get; }

Methods

DrawDiagramFill

#
Draw the Yxy diagram texture.
public void DrawDiagramFill(
context,
Graphics context.
Bitmap
texture
Yxy texture. You should generate this using a YxyDiagramCache instance.
)

DrawGamutBoundary

#
Draw the sRGB gamut boundary.
public void DrawGamutBoundary(
context,
Graphics context.
Pen
edge,
Pen to use for gamut boundary.
Color
labelColour,
Colour of gamut label.
Font
font
Font of gamut label.
)

DrawGamutExcession

#
Draw the region outside the sRGB gamut.
public void DrawGamutExcession(
context,
Graphics context.
strength = 0.1
Hatching darkness, the default is 0.1.
)

DrawGrid

#
Draw the Yxy grid lines.
public void DrawGrid(
context,
Context to draw with.
Pen
border,
Pen for grid border.
Pen
line
Pen for grid lines.
)

DrawGrid

#
Draw the Yxy grid lines.
public void DrawGrid(
context,
Context to draw with.
Pen
border,
Pen for grid border.
Pen
majorLine,
Pen for 0.1 grid lines.
Pen
minorLine
Pen for 0.05 grid lines.
)

DrawGridLabels

#
Draw the grid labels. Note that the labels exceed the Frame rectangle and are typically not included.
public void DrawGridLabels(
context,
Graphics context.
Font
font,
Font to use.
Color
colour
Colour of labels.
)

DrawPlanckianLocus

#
Draw the Planckian locus.
public void DrawPlanckianLocus(
context,
Graphics context.
Font
font,
Font to use for iso-planckian labels, may be null.
width,
Width of locus lines.
Color
colour1000,
Colour at 1000K.
Color
colourInfinite
Colour at infinite temperature.
)

DrawPurpleShadow

#
Draw a drop shadow along the line of purples.
public void DrawPurpleShadow(
context,
Graphics context.
darkness = 0.08
Darkness of shadow. The default is 0.08.
)

DrawSpectralLoci

#
Draw the spectral loci at ~5nm intervals.
public void DrawSpectralLoci(
context,
Graphics context.
Font
font,
Font to use.
Color
colour
Colour to use.
)

DrawSpectralLocus

#
Draw the spectral locus and the line of purples.
public void DrawSpectralLocus(
context,
Graphics context.
width,
Width of boundary curve.
Color
colour
Colour of edges.
)

LimitChromaticityToGrid

#
Limit a chromaticity coordinate to the interior of the grid, thus avoiding colours exceeding the chromaticity diagram.
public static bool LimitChromaticityToGrid(
x,
Original x coordinate.
y,
Original y coordinate.
out float
xm,
Projected x coordinate.
out float
ym
Projected y coordinate.
)
True if coordinate had to be projected.

LimitChromaticityToSpectrum

#
Limit a chromaticity coordinate to the interior of the spectrum, thus avoiding a imaginary colours.
public static bool LimitChromaticityToSpectrum(
x,
Original x coordinate.
y,
Original y coordinate.
out float
xm,
Projected x coordinate.
out float
ym
Projected y coordinate.
)
True if coordinate had to be projected.