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
#public YxyDiagramGeometry(RectangleF frame)
Create a new diagram.
Parameters:
| frame (RectangleF) | Frame. |
Properties
Grid
#public RectangleF Grid { get; }
Gets the grid rectangle. It takes up 80% of the frame width and 90% of the frame height.
YxyUnit
#public RectangleF YxyUnit { get; }
Gets the texture rectangle unit target rectangle. It exceeds the frame, but is used only to position Yxy vectorial unitised geometry within the grid.
Methods
DrawDiagramFill
#Draw the Yxy diagram texture.
Parameters:
| context (Context) | Graphics context. |
| texture (Bitmap) | Yxy texture. You should generate this using a YxyDiagramCache instance. |
DrawGamutBoundary
#Draw the sRGB gamut boundary.
Parameters:
| context (Context) | Graphics context. |
| edge (Pen) | Pen to use for gamut boundary. |
| labelColour (Color) | Colour of gamut label. |
| font (Font) | Font of gamut label. |
DrawGamutExcession
#Draw the region outside the sRGB gamut.
DrawGrid
#Draw the Yxy grid lines.
Parameters:
| context (Context) | Context to draw with. |
| border (Pen) | Pen for grid border. |
| line (Pen) | Pen for grid lines. |
DrawGrid
#Draw the Yxy grid lines.
Parameters:
| context (Context) | Context to draw with. |
| border (Pen) | Pen for grid border. |
| majorLine (Pen) | Pen for 0.1 grid lines. |
| minorLine (Pen) | Pen for 0.05 grid lines. |
DrawGridLabels
#Draw the grid labels. Note that the labels exceed the Frame rectangle and are typically not included.
Parameters:
| context (Context) | Graphics context. |
| font (Font) | Font to use. |
| colour (Color) | Colour of labels. |
DrawPurpleShadow
#Draw a drop shadow along the line of purples.
DrawSpectralLoci
#Draw the spectral loci at ~5nm intervals.
Parameters:
| context (Context) | Graphics context. |
| font (Font) | Font to use. |
| colour (Color) | Colour to use. |
DrawSpectralLocus
#Draw the spectral locus and the line of purples.
LimitChromaticityToGrid
#Limit a chromaticity coordinate to the interior of the grid, thus avoiding colours exceeding the chromaticity diagram.
LimitChromaticityToSpectrum
#Limit a chromaticity coordinate to the interior of the spectrum, thus avoiding a imaginary colours.