Mailing Lists: Apple Mailing Lists

Image of Mac OS face in stamp
 
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: CVPixelBufferCreateWithBytes & YCbCr



I'll try to package the code as soon as possible (I'm still actively working on it), but for the record, I managed to make the call work by:

- Copying the data, row by row, from the original buffer to one that was twice as wide as necessary ( width in pixels * 2 bytes per YCbCr pixel * 2 )
- Using the same exact call to CVPixelBufferCreateWithBytes, using the new buffer and doubled-rowbytes


It appears that something inside CV is unable to understand that the pixel format requires half as many bytes per row, and that giving it some extra (unused) space at the end of each row fixes the problem. This guess confirms the fact that my original image had exactly as many rowbytes as needed, and once I started halving it everything started working.

Note that when the rows are not padded, you do NOT get an error message from CV. You simply get an image that doesn't look the way it should.

Gabe

On Jun 14, 2005, at 3:53 PM, Frank Doepke wrote:

Can you send me the code snippet off list and I will have a look at it as this codepath is used by other clients.

Frank

On Jun 14, 2005, at 11:28 AM, Gabriele de Simone wrote:

Hi,

I have been trying to use the new API CVPixelBufferCreateWithBytes () to create a CVImageBuffer from some data in k2vuyPixelFormat. Unfortunately the API is not working as advertised for me.
If I use the correct parameters for width, height and rowbytes, then I get a misaligned image, but If I leave rowBytes the same and halve the width, then an image half the width is correctly created (logically, this should not happen).


I have played with various values of rowbytes and width, to no avail. The
Has anyone tried this successfully? Any known bugs?


Thx
Gabe


_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden





--
Frank Doepke
Senior Engineer
Quartz Effects

Apple Computer, Inc.
M/S 302-3PG
2 Infinite Loop
Cupertino, CA 95014

phone: 408-974-1266
email: email@hidden

"I thought of this while riding my bicycle" Albert Einstein



_______________________________________________ Do not post admin requests to the list. They will be ignored. Quartz-dev mailing list (email@hidden) Help/Unsubscribe/Update your Subscription: http://lists.apple.com/mailman/options/quartz-dev/email@hidden

This email sent to email@hidden
References: 
 >CVPixelBufferCreateWithBytes & YCbCr (From: Gabriele de Simone <email@hidden>)
 >Re: CVPixelBufferCreateWithBytes & YCbCr (From: Frank Doepke <email@hidden>)



Visit the Apple Store online or at retail locations.
1-800-MY-APPLE

Contact Apple | Terms of Use | Privacy Policy

Copyright © 2007 Apple Inc. All rights reserved.