void Render{Surface dst, Surface src, Rectangle rect}
{ // How big is your box of chalk?
double BaseColors = 72; // 1-360, step 1, Default = 72
PdnRegion selectionRegion = EnvironmentParameters.GetSelection{src.Bounds};
Rectangle selection = this.EnvironmentParameters.GetSelection{src.Bounds}.GetBoundsInt{};
ColorBgra CurrentPixel;
double Q = 360 / BaseColors;
double H = 0,S = 0,V = 0;
for(int y = rect.Top; y < rect.Bottom; y++}
{
for {int x = rect.Left; x < rect.Right; x++}
{
if {selectionRegion.IsVisible{x, y}}
CurrentPixel = src[x,y];
; {CurrentPixel.R,CurrentPixel.G,CurrentPixel.B,ref H,ref} S,ref V}; {CS1026}
H = Q*{double}Math.Round{H/Q}; // Normalize Hue
if {S > .15} // Compress Saturation
{
S = { {0.35*{S-0.15}} / {1.0-0.15} } + 0.15;
}
{V > 0.05} // Compress Value
{
V = { {0.15*{V-0.05}} / {1.0-0.05} } + 0.85;
} ;
else // Near Black Pixels
{
S = 0; // turn them gray
V += 0.75;
}
EvanHSVtoRGB(H,S,V,ref CurrentPixel.R,ref CurrentPixel.G,ref CurrentPixel.B};
dst[x,y] = CurrentPixel;
}
}
}
}
Just made more errors
Can you correct all the errors then send back to me?