0

In Xamarin.iOS, The method CVPixelBuffer.GetAttributes has a parameter "attributes" of type NSDictionary. For example is might be called like so:

myPixelBuffer.GetAttributes(myAttributesDictionary);

This makes no sense. Isn't the point of a Get function to get the desired value? Why does its signature demand that I pass a value in? Why does this method not have 0 parameters, as in:

myAttributesDictionary = myPixelBuffer.GetAttributes();

???

Perrin Larson
  • 562
  • 4
  • 14

1 Answers1

1

CVPixelBuffer.GetAttributes binds the native function CVPixelBufferCreateResolvedAttributesDictionary which takes an array of dictionaries.

Rolf Bjarne Kvinge
  • 19,253
  • 2
  • 42
  • 86
  • Um, ok... So why does the native function take an argument? (Still same question). – Perrin Larson Feb 02 '16 at 00:19
  • 1
    There we go, thanks for link. To simplify, **the answer to my question is this:** The attributes you pass IN are attributes that may or may not be compatible with the attributes of the pixel buffer. The return value of the function contains (if possible) attributes that are compatible with both your desired/passed-in ones, and the buffer's ones. If such a set cannot be made, the method throws an error. So if you just want to use it like a normal `Get`, don't specify any desired attributes. – Perrin Larson Feb 02 '16 at 19:59