From 6429378047974979637
X-Google-Language: ENGLISH,ASCII-7-bit
X-Google-Thread: f78e5,35a35bec39c95517
X-Google-Attributes: gidf78e5,public
X-Google-ArrivalTime: 2001-03-27 16:41:11 PST
Path: supernews.google.com!sn-xit-02!supernews.com!feed1.uncensored-news.com!news.alt.net!comp-std-cpp-robomod!not-for-mail
From: legalize+jeeves@xmission.com (Rich)
Newsgroups: comp.std.c++
Subject: Re: wchar & Unicode
Date: Tue, 27 Mar 2001 18:38:21 CST
Organization: multi-cellular, biological
Lines: 54
Approved: Fergus Henderson <fjh@cs.mu.oz.au>, moderator of comp.std.c++
Message-ID: <99r788$m87$1@xmission.xmission.com>
References: <remove.haberg-1503011129330001@du130-226.ppp.su-anst.tninet.se> <remove.haberg-2603011859430001@du159-226.ppp.su-anst.tninet.se> <99odm4$fqe$1@xmission.xmission.com> <remove.haberg-2703011208380001@du187-226.ppp.su-anst.tninet.se>
Reply-To: (Rich) legalize+jeeves@mail.xmission.com
Return-Path: <devnull@stump.algebra.com>
X-Robomod: STUMP, ichudov@algebra.com (Igor Chudov)
X-Authentication-Warning: backdraft.briar.org: smap set sender to <legalize@xmission.com> using -f
X-Reply-Etiquette: No copy by email, please
Mail-Copies-To: never
Xref: supernews.google.com comp.std.c++:4045

[Please do not mail me a copy of your followup]

remove.haberg@matematik.su.se (Hans Aberg) spake the secret code
<remove.haberg-2703011208380001@du187-226.ppp.su-anst.tninet.se> thusly:

>>Have you done any graphics programming?  Dealing with 8-bit bytes is
>>common.
>
>That might be a good example, even though if one is doing it color, you
>get three bytes packed together, which aligns to a 32-bit word. Also, I
>recall that the Motorola G4 used in Mac's vectors its 128-bit CPU word
>into 4 32-bit word, and part of the motivation for that was to simplify
>graphics applications.

There are plenty of places where 8-bit byte values are used: alpha
channels, stencil buffers, grayscale images, etc.  There are plenty of
places where 1-bit values are still used as well.

>By the way, isn't "millions of colors" the emerging standard, which
>implies that one is using at least 10 bits for each color.

Generally "millions of colors" implies 24-bit RGB colors with 8 bits
per channel.  So you still manipulate 8-bit quantities when you want
to diddle one channel and leave the others alone.

>If you want to
>do float operations, then you would need to use at least 32-bits words.

People don't commonly use floating-point values for pixels, although
colors are often represented in floating-point for lighting
computations or high-dynamic range applications.  Off the top of my
head, only raytracers use floating-point pixels and maybe RenderMan
since it targets non real-time rendering where quality is the primary
concern.

>It does not seem impossible to introduce a type binary<n> where n is a
>positive integer, having exactly n bits. Then IO with the type binary<n>
>in/out-puts exactly n bits. The implementation can optimize certain sizes,
>if that is now n = 8 or whatever.

Nothing's stopping you from writing such a class and using it yourself
if you really think its that important.
-- 
Ask me about my upcoming book on Direct3D from Addison-Wesley!
Direct3D Book <http://www.xmission.com/~legalize/book/>
         Home <http://www.xmission.com/~legalize/>
    Fractals! <http://www.xmission.com/~legalize/fractals/>

---
[ comp.std.c++ is moderated.  To submit articles, try just posting with ]
[ your news-reader.  If that fails, use mailto:std-c++@ncar.ucar.edu    ]
[              --- Please see the FAQ before posting. ---               ]
[ FAQ: http://www.research.att.com/~austern/csc/faq.html                ]



