[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[libcaca] Re: What is pitch?



On Mon, Jan 12, 2004, Zeeshan Ali wrote:

>   Mr. Sam or anyone else: can you please explain what
> 'pitch' means in context to libcaca? I thought of it as 
> the number of bytes in a row & therefore defined it
> as:  image_width * bpp/8.

   Yes, this is the definition in libcaca (and also in VLC).

> Then i saw this formula in
> the vlc's libcaca plugin: ((image_width + 15) & ~15)
> which is not understandable for me. Thanks in advance.

   VLC can use anything bigger than image_width for pitch, because the
visible part will only be image_width. ((foo + 15) & ~15) just pads the
framebuffer width to a multiple of 16 pixels. You do not need to do
this, but sometimes you have no choice but to use padding and it is a
good example of how to do it.

-- 
Sam.
-- 
This is the libcaca mailing-list, see http://sam.zoy.org/projects/libcaca/
Trouble unsubscribing? Please contact <sam@zoy.org>
List archives are at http://sam.zoy.org/projects/libcaca/threads.html