PIXEL_BIT_COUNT(n) ((n) shl 16)

PIXEL_BIT_COUNT(n)    ((n) shl 16)

const
   PixelType_Mono8 = PIXEL_MONO or PIXEL_BIT_COUNT(8) or $0001

Could you tell me how to define PIXEL_BIT_COUNT ?

Comments

  1. Lars Fosdal Of course not. I had not seen that use case...

    ReplyDelete
  2. In theory, it could be possible - we are after all just initializing a value.

    ReplyDelete
  3. Using an inline function is the best here.
    But if you want precalculated arrays, as cache for cpu intense work: (shl is not)

    var
    foo : array[0..10] of Integer;

    initialize
    for i := Low(foo) to High(foo) do foo[i] := i shl 16;

    // also possible on const with some compiler flag.

    ReplyDelete

Post a Comment