2

Quick question. I want to tint a movie dynamically in C4 is there a way I could use C4Image compatible temperatureAndTint with the texture ref of the C4Movie? Or could I build a transparent C4Image and tint it on top of the movie? I have tried both of these and it complains.

Thoughts?

4

1 回答 1

1

单色是为电影着色的最简单方法。

在 C4 中,您可以通过在影片顶部添加一个图层并指定该图层的颜色来实现此目的。以下代码使用透明C4RED来为电影着色:

-(void)setup {
    C4Movie *m = [C4Movie movieNamed:@"inception.mov"];
    m.width = self.canvas.width;
    m.shouldAutoplay = YES;
    m.loops = YES;

    C4Shape *tintShape = [C4Shape rect:m.bounds];
    tintShape.lineWidth = 0.0f;
    tintShape.fillColor = [C4RED colorWithAlphaComponent:0.2f];
    [m addShape:tintShape];

    [self.canvas addMovie:m];
}

在 iOS 中应用任何其他类型的CIFilter电影真的很困难。您必须学习如何动态抓取帧并直接使用 Core Graphics 将过滤器应用于从帧缓冲区出来的单个帧。CIFilter在 iOS 中,从平淡的色调到对电影的影响,这是一个令人讨厌的大步骤。

您还可以查看 Brad Larson 的GPUImage项目,它有自己的GPUImageMovie类。

于 2014-01-30T23:05:50.413 回答