<!--
{
  "availability" : [
    "iOS: 10.0.0 -",
    "iPadOS: 10.0.0 -",
    "macCatalyst: 13.1.0 -",
    "macOS: 10.12.0 -",
    "tvOS: 10.0.0 -",
    "visionOS: 1.0.0 -"
  ],
  "documentType" : "symbol",
  "framework" : "CoreImage",
  "identifier" : "/documentation/CoreImage/CIImageProcessorKernel/formatForInput(at:)",
  "metadataVersion" : "0.1.0",
  "role" : "Type Method",
  "symbol" : {
    "kind" : "Type Method",
    "modules" : [
      "Core Image"
    ],
    "preciseIdentifier" : "c:objc(cs)CIImageProcessorKernel(cm)formatForInputAtIndex:"
  },
  "title" : "formatForInput(at:)"
}
-->

# formatForInput(at:)

Override this class method if you want your any of the inputs to be in a specific pixel format.

```
class func formatForInput(at inputIndex: Int32) -> CIFormat
```

## Discussion

The format must be one of `kCIFormatBGRA8`, `kCIFormatRGBAh`, `kCIFormatRGBAf` or `kCIFormatR8`.
On iOS 12 and macOS 10.14, the formats `kCIFormatRh` and `kCIFormatRf` are also supported.

If the requested inputFormat is `0`, then the input will be a supported format that best
matches the rendering context’s `/CIContext/workingFormat`.

If a processor wants data in a colorspace other than the context’s working color space,
then call `/CIImage/imageByColorMatchingWorkingSpaceToColorSpace:` on the processor input.
If a processor wants it input as alpha-unpremultiplied RGBA data, then call
`/CIImage/imageByUnpremultiplyingAlpha` on the processor input.

---

Copyright &copy; 2026 Apple Inc. All rights reserved. | [Terms of Use](https://www.apple.com/legal/internet-services/terms/site.html) | [Privacy Policy](https://www.apple.com/privacy/privacy-policy)