Log in or register to post comments

Cannot get QCAR::Image of format RGBA8888

February 17, 2013 - 8:08am #1

I am using :
iPod Touch 4. iOS 5.1.1. QCAR 2.0

Here is a snapshot of my code:

- (CIImage*)toCIImage {
QCAR::Frame frame = currState.getFrame();
QCAR::setFrameFormat(QCAR::RGBA8888, true);
for (int i = 0; i const QCAR::Image *qcarImage = frame.getImage(i);
NSLog(@"%d", qcarImage->getFormat());
if (qcarImage->getFormat() == QCAR::RGBA8888) {
int width = qcarImage->getWidth();
int height = qcarImage->getHeight();
int bitsPerComponent = 8;
int bitsPerPixel = QCAR::getBitsPerPixel(QCAR::RGBA8888);
int bytesPerRow = qcarImage->getBufferWidth() * bitsPerPixel / bitsPerComponent;
int size = QCAR::getBufferSize(width, height, QCAR::RGBA8888);
NSData* nsData = [NSData dataWithBytesNoCopy:(void*)qcarImage->getPixels() length:size];
CIImage* image = [CIImage imageWithBitmapData:nsData bytesPerRow:bytesPerRow size:CGSizeMake(width, height) format:kCIFormatRGBA8 colorSpace:CGColorSpaceCreateDeviceRGB()];
return image;
return nil;

I have NSLogged qcarImage->getFormat() but no image has a format of RGBA8888. Is there any other operations I need to do before setFrameFormat? I just follow the codes from ARCommons

Cannot get QCAR::Image of format RGBA8888

February 18, 2013 - 6:14am #2

Hi ComboZhc,

I checked with the Dev team and this format is not supported, despite the current documentation, so you will probably have to use RGB888 i.e. without any Alpha.

Apologies for any confusion.


Log in or register to post comments