Path: utzoo!utgpu!jarvis.csri.toronto.edu!cs.utexas.edu!rice!sun-spots-request From: david@sun.com (what is the definition of broth?) Newsgroups: comp.sys.sun Subject: Re: Pixrect line padding Keywords: Windows Message-ID: <4540@brazos.Rice.edu> Date: 30 Jan 90 18:47:05 GMT Sender: root@rice.edu Organization: Sun-Spots Lines: 43 Approved: Sun-Spots@rice.edu X-Refs: Original: v8n217, Replies: v8n229, v9n7 X-Sun-Spots-Digest: Volume 9, Issue 17, message 1 of 12 In v8n229 canon!smith@nsfnet-relay.ac.uk (Mark Smith) is unhappy about the following exchange: >> >My 4.0.3 documentation says >> >that for pixrects of width > 16 scan lines are padded out to a 32 bit >> >boundary. >> >> Read the documentation carefully -- this is describing pixrects created by >> mem_create(). The minimum padding requirement is still 16 bits. He quotes: >In the Memory Pixrects chapter of the Pixrect Reference Manual: > > The mpr_linebytes macro computes the bytes per line of a primary memory > pixrect given its width in pixels and the bits per pixel. This includes > the padding to word bounds. It is useful for incrementing pixel addresses > in the y direction or calculating line padding in the bitmap. > >Next comes the definition of mpr_linebytes, which is *wrong* because it has >the number 15 hardcoded. Next comes a helpful example with the description: > > Note how the mpr_linebytes macro is used to find the number of bytes > used to hold a line of a memory pixrect. Mark is quite correct that these statements are misleading and should have been updated when 32 bit padded pixrects were introduced. However, the definition of mpr_linebytes() in the manual is not wrong and is in fact what you will find in . The macro has not changed, it is just not as useful as it once was. (It is now only used for static pixrects and mem_point().) >As for "look at md_linebytes instead of assuming a particular padding >algorithm", I think most people would reasonably assume that using a >provided macro should be safer than accessing a data structure member >directly. You can use the mpr_mdlinebytes() macro if you prefer. However, since the data structures are also printed in the manual it would be impractical to change them. David DiGiacomo, Sun Microsystems, Mt. View, CA sun!david david@eng.sun.com