十分着急!!!我看了网上仅有的几篇关于 " wu pixel "的文章, 但是恕我愚笨, 还不太明白,(比如 亮度怎么计算?)
哪位请给我再用通俗易懂的语言讲讲? 再问:哪里有delphi版的wu pixel例子程序载?
不甚感激!!!

解决方案 »

  1.   

    // 改变图像的亮度,也只需调用RGB(Bmp, X, X, X)改变三原色.// 调节Bitmap的对比度// 应用公式: 新颜色值 = (旧颜色值 - 128) * 系数 + 128procedure Contrast(var Bmp: TBitmap; Amount: Integer);// Amount: -255~255varX, Y: Integer;I: Byte;ColorTable: array[0..255] of TRGBColor;pRGB: PRGBColor;beginfor I := 0 to 126 dobeginY := (Abs(128 - I) * Amount) div 256;ColorTable[I].r := GetRValue(Byte(I - Y));ColorTable[I].g := GetGValue(Byte(I - Y));ColorTable[I].b := GetBValue(Byte(I - Y));end;for I := 127 to 255 dobeginY := (Abs(128 - I) * Amount) div 256;ColorTable[I].r := GetRValue(Byte(I + Y));ColorTable[I].g := GetGValue(Byte(I + Y));ColorTable[I].b := GetBValue(Byte(I + Y));end;for Y := 0 to Bmp.Height - 1 dobeginpRGB := Bmp.ScanLine[Y];for X := 0 to Bmp.Width - 1 dobeginpRGB.R := ColorTable[pRGB.R].R;pRGB.G := ColorTable[pRGB.G].G;pRGB.B := ColorTable[pRGB.B].B;Inc(pRGB);end;end;end;