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: How to get 24 bit RGB data ?



To follow up my own post responding to a developer's problem with 24 bit RGB data:

On Oct 14, 2005, at 11:01 AM, David Gelphman wrote:

Regarding:
On Oct 12, 2005, at 5:01 PM, g w wrote:

hi, everyone!
    I have met a problem when I get 24 bit RGB data. In the hp SamplePM, I set the kPMRequestedPixelFormatKey as kPMRGB_24, the kPMRequiredBandHeightKey as 48*5, the kPMConverterResHorizontalKey as 600, the kPMConverterResVerticalKey as 600  in converterSetupTicket. I printed document in A4 paper.
    When debugging, I get the print data from the method of TEnginePCL::PrintBand(). In the bandBuffer data, the first line data is 24 bit RGB and it is correct. But from the second line to the last line, the data is 32 bit (kPMXRGB_32 pixel format) RGB data.
    Why the second line data is 32 bit RGB data ??
    And does the second line data begin from "bandBuffer + bandWidth * 4" ? ( bandWidth = (pageWidth * 600) / 72)
Thanks a lot!

I'm not certain that you've provided enough information to allow an answer to your questions, however:

While inspecting the code for the kPMRGB_24 code path, I see what looks like a bug. I suggest that you consider using the format kPMXRGB_32 and manual discard the X component of the data. This is what would be done for you if the kPMRGB_24 code path worked properly.


Actually upon further inspection, the bug I was concerned about simply results in a lower efficiency implementation than is strictly necessary. There is extra data in the band buffer AFTER the end of the valid band data and that data is indeed XRGB data.

I suspect you are advancing from one scanline to the next in a manner that is incorrect. I couldn't tell for sure but I believe you indicated that you advanced to the next scanline with:

bandBuffer + bandWidth * 4

For 24 bit RGB data, I would expect 3 bytes of data per pixel, not four. That doesn't completely explain your problem however since from your complaint you say it is the second scanline which has XRGB data. I do suspect that your problem is the way you advance from one scanline to the next.

Re:
Have others successfully used the kPMRGB_24 code path? If so, it would be helpful to know.
This information would still be useful to know.

David

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

This email sent to email@hidden

References: 
 >How to get 24 bit RGB data ? (From: g w <email@hidden>)
 >Re: How to get 24 bit RGB data ? (From: David Gelphman <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.