Changeset 39 for trunk/Packages/FastGraphics/ColorFormats
- Timestamp:
- Oct 10, 2018, 3:48:47 PM (6 years ago)
- Location:
- trunk/Packages/FastGraphics/ColorFormats
- Files:
-
- 4 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Packages/FastGraphics/ColorFormats/UColorGray1.pas
r32 r39 36 36 { TBPixmapGray1 } 37 37 38 TBPixmapGray1 = class(TB Image)38 TBPixmapGray1 = class(TBPixmap) 39 39 private 40 40 FillCallBack: TGetColorPos; … … 73 73 BitDepth := 1; 74 74 BackendColorClass := TBColorGray1; 75 Backend ImageClass := TBPixmapGray1;75 BackendPixmapClass := TBPixmapGray1; 76 76 AddChannel('Gray', 0, 1); 77 77 end; -
trunk/Packages/FastGraphics/ColorFormats/UColorGray2.pas
r30 r39 35 35 { TBPixmapGray2 } 36 36 37 TBPixmapGray2 = class(TB Image)37 TBPixmapGray2 = class(TBPixmap) 38 38 private 39 39 FillCallBack: TGetColorPos; … … 71 71 BitDepth := 2; 72 72 BackendColorClass := TBColorGray2; 73 Backend ImageClass := TBPixmapGray2;73 BackendPixmapClass := TBPixmapGray2; 74 74 AddChannel('Gray', 0, 2); 75 75 end; -
trunk/Packages/FastGraphics/ColorFormats/UColorGray4.pas
r30 r39 31 31 procedure SetColorName(ColorName: TColorName); override; 32 32 procedure SetRandom; override; 33 procedure SetColor(Color: TColor); override; 33 34 end; 34 35 35 36 { TBPixmapGray4 } 36 37 37 TBPixmapGray4 = class(TB Image)38 TBPixmapGray4 = class(TBPixmap) 38 39 private 39 40 FillCallBack: TGetColorPos; 40 41 function FillGetColor(Position: TPoint): TColorGray4; 42 function NegativeFunc(Position: TPoint): TColorGray4; 41 43 protected 42 44 procedure SetSize(AValue: TPoint); override; … … 45 47 public 46 48 Pixmap: TPixmapGray4; 49 procedure Flip; override; 50 procedure Mirror; override; 51 procedure Negative; override; 47 52 procedure Fill(Color: IBColor); override; 48 53 procedure Fill(Func: TGetColorPos); override; … … 70 75 BitDepth := 4; 71 76 BackendColorClass := TBColorGray4; 72 Backend ImageClass := TBPixmapGray4;77 BackendPixmapClass := TBPixmapGray4; 73 78 AddChannel('Gray', 0, 4); 74 79 end; … … 110 115 end; 111 116 117 procedure TBColorGray4.SetColor(Color: TColor); 118 begin 119 Value := ((Color shr 0) and $ff + (Color shr 8) and $ff + (Color shr 16) and $ff) div (3 * 16); 120 end; 121 112 122 { TBPixmapGray2 } 113 123 … … 115 125 begin 116 126 Result := (FillCallBack(Position) as TBColorGray4).Value; 127 end; 128 129 function TBPixmapGray4.NegativeFunc(Position: TPoint): TColorGray4; 130 var 131 C: TColorGray4; 132 begin 133 C := Pixmap.Pixels[Position.X, Position.Y]; 134 Result := 16 - (C and $f); 117 135 end; 118 136 … … 131 149 begin 132 150 Pixmap.Pixels[X, Y] := (AValue as TBColorGray4).Value; 151 end; 152 153 procedure TBPixmapGray4.Flip; 154 begin 155 Pixmap.Flip; 156 end; 157 158 procedure TBPixmapGray4.Mirror; 159 begin 160 Pixmap.Mirror; 161 end; 162 163 procedure TBPixmapGray4.Negative; 164 begin 165 Pixmap.Fill(NegativeFunc); 133 166 end; 134 167 -
trunk/Packages/FastGraphics/ColorFormats/UColorRGB8.pas
r36 r39 43 43 { TBPixmapRGB8 } 44 44 45 TBPixmapRGB8 = class(TB Image)45 TBPixmapRGB8 = class(TBPixmap) 46 46 private 47 47 FillCallBack: TGetColorPos; … … 81 81 BitDepth := 24; 82 82 Name := 'RGB8'; 83 Backend ImageClass := TBPixmapRGB8;83 BackendPixmapClass := TBPixmapRGB8; 84 84 BackendColorClass := TBColorRGB8; 85 85 AddChannel('Red', 0, 8);
Note:
See TracChangeset
for help on using the changeset viewer.