예제 #1
0
        //Compute a gradient
        public void ComputeGradient(int pFromColorIndex, int pThroughColorIndex, SuperColor pFromColor, SuperColor pThroughColor)
        {
            //TODO: deal with From_Color_Index > or = Thru_Color_Index and Negative Color Indices
            double tmpRed   = (double)pFromColor.Red;
            double tmpGreen = (double)pFromColor.Green;
            double tmpBlue  = (double)pFromColor.Blue;

            // Right now this is a linear walk through color space, but there could be a third point given to create interesting textures across the "arc".

            //Next we need to figure the step values, which will be Color Variance / Distance
            double tmpRedStep   = (double)((double)(pThroughColor.Red - pFromColor.Red) / (double)(pThroughColorIndex - pFromColorIndex));
            double tmpGreenStep = (double)((double)(pThroughColor.Green - pFromColor.Green) / (double)(pThroughColorIndex - pFromColorIndex));
            double tmpBlueStep  = (double)((double)(pThroughColor.Blue - pFromColor.Blue) / (double)(pThroughColorIndex - pFromColorIndex));

            this.WriteToLog("Creating Gradient From #" + pFromColorIndex.ToString() + pFromColor.DebugDisplayValue() + " To #" + pThroughColorIndex.ToString() + pThroughColor.DebugDisplayValue());



            //Hopefully this cast isn't super heavy on processing power!
            for (int tmpCounter = 0; tmpCounter <= (pThroughColorIndex - pFromColorIndex); tmpCounter++)
            {
                this._ColorList[tmpCounter + pFromColorIndex].Red   = (byte)tmpRed;
                this._ColorList[tmpCounter + pFromColorIndex].Green = (byte)tmpGreen;
                this._ColorList[tmpCounter + pFromColorIndex].Blue  = (byte)tmpBlue;

                tmpRed   += tmpRedStep;
                tmpGreen += tmpGreenStep;
                tmpBlue  += tmpBlueStep;
            }
        }
예제 #2
0
        //Create a gradient pallete
        public SuperImagePalette(SuperColor pFromColor, SuperColor pToColor, int pSteps)
        {
            this._ColorListCount = pSteps;

            this._ColorList = new SuperColor[this._ColorListCount];
            for (int tmpCounter = 0; tmpCounter < this._ColorListCount; tmpCounter++)
            {
                this._ColorList[tmpCounter] = new SuperColor();
            }

            this.ComputeGradient(0, this._ColorListCount - 1, pFromColor, pToColor);
        }
예제 #3
0
        public void MarkPixelQuad(int pX, int pY, SuperColor pColor)
        {
            this._ImageBuffers[this._CurrentImageBuffer].MarkPixel(pX, pY, pColor.Red, pColor.Green, pColor.Blue);
            if (pX < _Width - 1)
            {
                this._ImageBuffers[this._CurrentImageBuffer].MarkPixel(pX + 1, pY, pColor.Red, pColor.Green, pColor.Blue);
            }
            if (pY < _Height - 1)
            {
                this._ImageBuffers[this._CurrentImageBuffer].MarkPixel(pX, pY + 1, pColor.Red, pColor.Green, pColor.Blue);
            }

            if (pX < _Width - 1 && pY < _Height - 1)
            {
                this._ImageBuffers[this._CurrentImageBuffer].MarkPixel(pX + 1, pY + 1, pColor.Red, pColor.Green, pColor.Blue);
            }
        }
예제 #4
0
 //Others: MarkRow, MarkColumn, ModifyRow (using a modifier function type! yeah), ModifyPixel, MarkBlock (with setable size?)
 public void MarkPixel(int pX, int pY, SuperColor pColor)
 {
     this.MarkPixel(pX, pY, pColor.Red, pColor.Green, pColor.Blue);
 }
예제 #5
0
 public void MarkPixel(int pX, int pY, SuperColor pColor)
 {
     this._ImageBuffers[this._CurrentImageBuffer].MarkPixel(pX, pY, pColor.Red, pColor.Green, pColor.Blue);
 }