none
How to understand Wmf BitCount Enumeration BI_BITCOUNT_5 ? RRS feed

  • Question

  • Hello,

    In the MS-WMF specification i look: 

    2.1.1.3 BitCount Enumeration

    BI_BITCOUNT_5: The bitmap has a maximum of 2^24 colors, and the Colors field of DIB is
    NUL
    L. Each 3-byte triplet in the bitmap array represents the relative intensities of blue, green,
    and red, respectively, for a pixel. The Colors color table is used for optimizing colors used on
    palette-based devices, and MUST contain the number of entries specified by the ColorUsed
    field of the BitmapInfoHeader Object.



    I can not understand: Colors field of DIB is NULL and The Colors color table is used for optimizing colors used,

    but Colors is null?

    And how to implement "optimizing colors used on palette-based devices", similary in BI_BITCOUNT_4 and  BI_BITCOUNT_6, explain with an example please.

    Also similary ColorUsed (4 bytes) field of the 2.2.2.3 BitmapInfoHeader Object.

    Friday, July 31, 2015 7:05 AM

All replies

  • Hi,

    Thank you for this question. One of our engineers will follow-up soon.

    Regards,

    Edgar

    Friday, July 31, 2015 3:11 PM
    Moderator
  • Hello box0547,

    I will be working with you on this issue. I'm currently researching the information you provided.

    Thanks,
    Kamil Sykora

    Friday, July 31, 2015 5:12 PM
  • Hello box0547,

    I am still researching the BI_BITCOUNT_5 specific description. I believe the two statements that you hightlighted:
    "Colors field of DIB is NULL"
    and
    "The Colors color table is used for optimizing colors used"

    are in conflict. I believe the statements should have included the same qualifier that BI_BITCOUNT_4/BI_BITCOUNT_6 used but I need to double check other related information to make sure this is correct. If verified, the text should read:
    If the Compression field of the BitmapInfoHeader Object is set to BI_RGB, the Colors field of DIB is set to NULL.

    If the color table is included, its size is specified by the ColorUsed field of the BitmapInfoHeader Object:

    2.2.2.3 BitmapInfoHeader Object
    ...
    ColorUsed (4 bytes): A 32-bit unsigned integer that specifies the number of indexes in the color table used by the DIB, as follows:
    - If this value is zero, the DIB uses the maximum number of colors that correspond to the BitCount value.
    - If this value is nonzero and the BitCount value is less than 16, this value specifies the number of colors used by the DIB.
    - If this value is nonzero and the BitCount value is 16 or greater, this value specifies the size of the color table used to optimize performance of the system palette.

    The last statement is relevant to the BI_BITCOUNT_4/BI_BITCOUNT_6 statement that you referenced:
    "optimizing colors on palette-based devices."
    If I confirm the above information, it would also be applicable to BI_BITCOUNT_5.

    I wasn't sure if you were inquiring about the color table in general or only in the context of the conflicting BI_BITCOUNT_5 enumeration statement. If you have a question on how to interpret the color table for the BI_BITCOUNT_4/BI_BITCOUNT_6 enumeration values, please post a new forum topic and I will research that further.

    Thanks,
    Kamil Sykora


    Tuesday, August 4, 2015 5:05 PM
  • Hello Ildar,

    I have verified that 24-bit bitmaps do not include a Color Table and so the text should read this way:

    BI_BITCOUNT_5:  The bitmap has a maximum of 2^24 colors, and the Colors field of DIB is NULL. Each 3-byte triplet in the bitmap array represents the relative intensities of blue, green, and red, respectively, for a pixel.

    I have started the documentation update process so that the specification is updated as such. Please let me know if you have any other questions about this. If you have additional questions about the Color Table in general with other BitCount values, please post a new forum topic.

    Thanks,
    Kamil Sykora

    Thursday, August 20, 2015 7:53 PM