[MPlayer-cvslog] CVS: main/DOCS/tech colorspaces.txt,1.14,1.15

The Wanderer inverseparadox at comcast.net
Sat Feb 25 09:59:50 CET 2006


(I'm trying to resume contributing at least a little...)

Alan Curry CVS wrote:

>  Depending upon the CPU being little- or big-endian, different 'in memory' and
>  'in register' formats will be equal (LE -> BGRA == BGR32 / BE -> ARGB == BGR32)
> +
> +Practical coding guide:
> +
> +The 4, 8, 15, and 16 bit formats are defined so that the portable way to
> +access them is to load the pixel into an integer and use bitmasks.

By my memory of hyphenation policy, this is the correct way to say "4-,
8-, 15-, and 16-bit"; however, immediately above there is the form
"little- or big-endian", which uses the other approach, Does one of
these in fact need to be corrected, to be in line with policy?

> +The 24 bit formats are defined so that the portable way to access them is
> +to address the 3 components as separate bytes, as in ((uint8_t *)pixel)[0],
> +((uint8_t *)pixel)[1], ((uint8_t *)pixel)[2].
> +
> +When a 32-bit format is identified by the four characters A, R, G, and B in
> +some order, the portable way to access it is by addressing the 4 components
> +as separate bytes.
> +
> +When a 32-bit format is identified by the 3 characters R, G, and B in some
> +order followed by the number 32, the portable way to access it is to load
> +the pixel into an integer and use bitmasks.

In the above three pragraphs, you have "3 components", "four
characters", "4 components", and "3 characters"; the numbers should be
made consistent. The smallest change would be to use "4" instead of
"four", but as it happens I think that writing the numbers out instead
of using the digits flows better; still, I'll leave ithe decision to
you.

> +When the above portable access methods are not used, you will need to write
> +2 versions of your code, and use #ifdef WORDS_BIGENDIAN to choose the correct
> +one.

Similarly, I'd prefer "two versions" here.

-- 
       The Wanderer

Warning: Simply because I argue an issue does not mean I agree with any
side of it.

Secrecy is the beginning of tyranny.




More information about the MPlayer-cvslog mailing list