Pour créer un CVPixelBuffer attributs dans Objective-C je ferais quelque chose comme ceci:Comment créer CVPixelBuffer attributs dictionnaire Swift
NSDictionary *attributes = [NSDictionary dictionaryWithObjectsAndKeys:
[NSNumber numberWithBool:YES], kCVPixelBufferCGImageCompatibilityKey,
[NSNumber numberWithBool:YES], kCVPixelBufferCGBitmapContextCompatibilityKey,
nil];
Et puis dans le CVPixelBufferCreate
meathod je passerais (__bridge CFDictionaryRef) attributes
comme paramètre.
Dans Swift Je tente de créer mon dictionnaire comme celui-ci:
let attributes:[CFString : NSNumber] = [
kCVPixelBufferCGImageCompatibilityKey : NSNumber(bool: true),
kCVPixelBufferCGBitmapContextCompatibilityKey : NSNumber(bool: true)
]
mais je découvre que CFString n'est pas indexables et bien, je suis incapable d'obtenir que cela fonctionne. Est-ce que quelqu'un peut donner un exemple de comment cela fonctionne dans Swift?