Changeset 318 for GraphicTest/UFastBitmap.pas
- Timestamp:
- Feb 1, 2012, 3:33:59 PM (13 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
GraphicTest/UFastBitmap.pas
r317 r318 9 9 10 10 type 11 TFastBitmapPixel = Integer; 12 PFastBitmapPixel = ^TFastBitmapPixel; 13 14 TFastBitmapPixelComponents = packed record 15 B, G, R, A: Byte; 16 end; 17 18 { TFastBitmap } 11 12 TFastBitmapPixel = Integer; 13 (*TFastBitmapPixel = record 14 Blue: Byte; 15 Green: Byte; 16 Red: Byte; 17 end;*) 18 PFastBitmapPixel = ^TFastBitmapPixel; 19 20 TFastBitmapPixelComponents = packed record 21 B, G, R, A: Byte; 22 end; 23 24 const 25 FastPixelSize = SizeOf(TFastBitmapPixel); 26 27 type 28 { TFastBitmap } 19 29 20 30 TFastBitmap = class … … 166 176 function TFastBitmap.GetPixel(X, Y: Integer): TFastBitmapPixel; 167 177 begin 168 Result := PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^;178 Result := PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * FastPixelSize)^; 169 179 end; 170 180 171 181 procedure TFastBitmap.SetPixel(X, Y: Integer; const AValue: TFastBitmapPixel); 172 182 begin 173 PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * SizeOf(TFastBitmapPixel))^ := AValue;183 PFastBitmapPixel(FPixelsData + (Y * FSize.X + X) * FastPixelSize)^ := AValue; 174 184 end; 175 185 … … 178 188 if (FSize.X = AValue.X) and (FSize.Y = AValue.X) then Exit; 179 189 FSize := AValue; 180 FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * SizeOf(TFastBitmapPixel));190 FPixelsData := ReAllocMem(FPixelsData, FSize.X * FSize.Y * FastPixelSize); 181 191 end; 182 192
Note:
See TracChangeset
for help on using the changeset viewer.