Ignore:
Timestamp:
Sep 22, 2014, 5:40:17 PM (10 years ago)
Author:
chronos
Message:
  • Modified: Color format properties are now initialized as variables instead by executing function.
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ColorFormats/UColorGray1.pas

    r10 r14  
    1212
    1313  TGColorFormatGray1 = class(TGColorFormat)
    14     function GetPixelSize: Integer; override;
    15     function GetBitDepth: Integer; override;
    16     function GetName: string; override;
    17     function GetChannelBitPos(Channel: TGColorChannel): Integer; override;
    18     function GetChannelBitWidth(Channel: TGColorChannel): Integer; override;
     14    constructor Create; override;
    1915  end;
    2016
     
    2319{ TGColorFormatGray1 }
    2420
    25 function TGColorFormatGray1.GetPixelSize: Integer;
     21constructor TGColorFormatGray1.Create;
    2622begin
    27   Result := 1;
    28 end;
    29 
    30 function TGColorFormatGray1.GetBitDepth: Integer;
    31 begin
    32   Result := 1;
    33 end;
    34 
    35 function TGColorFormatGray1.GetName: string;
    36 begin
    37   Result := 'Gray1';
    38 end;
    39 
    40 function TGColorFormatGray1.GetChannelBitPos(Channel: TGColorChannel): Integer;
    41 begin
    42   case Channel of
    43     ccGray: Result := 0;
    44     else Result := 0;
    45   end;
    46 end;
    47 
    48 function TGColorFormatGray1.GetChannelBitWidth(Channel: TGColorChannel
    49   ): Integer;
    50 begin
    51   if Channel = ccGray then
    52     Result := 1 else Result := 0;
     23  inherited;
     24  Name := 'Gray1';
     25  BitDepth := 1;
     26  Channels[ccGray].Position := 0;
     27  Channels[ccGray].BitWidth := 1;
    5328end;
    5429
Note: See TracChangeset for help on using the changeset viewer.