-
Melhore o processamento de imagens RAW com Core Image
Aproveite o poder da versão 9 das APIs de processamento RAW do Core Image para melhorar drasticamente a qualidade das imagens em seus apps, com nitidez aprimorada e cores mais definidas, enquanto usa o Apple Neural Engine para obter o desempenho ideal. Aproveite a API CIRAWFilter para permitir que os usuários editem fotos RAW, alterando exposição, redução de ruído, nitidez, contraste e muito mais. Explore também as novas APIs CIImageProcessor que otimizam o desempenho ao oferecer controle preciso sobre o dimensionamento de blocos e o gerenciamento de buffers.
Capítulos
- 0:00 - Introdução
- 0:52 - Como o Core Image oferece suporte a arquivos RAW
- 2:48 - A Evolução do Suporte ao RAW
- 3:33 - Visão geral RAW 9
- 3:56 - Melhorias de Qualidade do RAW 9
- 5:50 - Habilite e edite o RAW 9 usando a CIRAWFilter API
- 8:33 - Visão geral do desempenho RAW 9
- 9:19 - Edição Interativa
- 10:52 - Exportando para outros formatos
- 11:50 - Novos recursos do CIImageProcessor
Recursos
Vídeos relacionados
WWDC22
WWDC21
-
Buscar neste vídeo...
-
-
11:08 - Contact for exports
let exportCtx = CIContext(options : [ .cacheIntermediate : false, .memoryLimit : 512 ]) -
12:23 - CIImageProcessor with explicit output tile sizes
import CoreImage class MyProcessor: CIImageProcessorKernel { override class func roi(forInput input: Int32, arguments: [String : Any]?, outputRect: CGRect) -> CGRect { return outputRect } override class func process(with inputs: [CIImageProcessorInput]?, arguments: [String : Any]?, output: CIImageProcessorOutput) throws { guard let input = inputs?.first, let iBuffer = input.pixelBuffer, let oBuffer = output.pixelBuffer else { return } let iRegion = input.region let oRegion = output.region // controlled by Core Image // MyCopyBuffer(iBuffer,iRegion, oBuffer,oRegion) } } let extent = inImg.extent let tileSize = 512.0 // whatever tile size you want var tiles: [CIVector] = [] for y in stride(from: extent.minY, to: extent.maxY, by: tileSize) { for x in stride(from: extent.minX, to: extent.maxX, by: tileSize) { let tile = CGRect(x: x, y: y, width: min(tileSize, extent.maxX - x), height: min(tileSize, extent.maxY - y)) tiles.append(CIVector(cgRect: tile)) } } let result = try MyProcessor.apply(withTiledExtent: tiles, inputs: [inImg], arguments: [:]) -
14:24 - CIImageProcessor using temporary PixelBuffer
import CoreImage class MyProcessor: CIImageProcessorKernel { override class func process(with inputs: [CIImageProcessorInput]?, arguments: [String: Any]?, output: CIImageProcessorOutput) throws { guard let input = inputs?.first, let srcPixelBuffer = input.pixelBuffer, let dstPixelBuffer = output.pixelBuffer else { return } // Get a scratch buffer from Core Image's cache guard let scratch = output.temporaryPixelBuffer(identifier : "myScratch", format: kCVPixelFormatType_64RGBAHalf, width: Int(output.region.width), height: Int(output.region.height), pixelBufferAttributes: nil) else { return } // Step 1: copy input CVPixelBuffer → scratch // Step 2: process pixels in scratch // Step 3: copy scratch → output CVPixelBuffer } }
-