developer
2023-05-20 e12c7b4c22df631ebdcd16b2f98fbef8f738f92f
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
 
// This needs a little more work, it's rotating the input tileset and there are some artifacts (I think from GL_LINEAR interpolation), but it's working
 
#import "GPUImageTwoInputFilter.h"
#import "GPUImagePicture.h"
 
@interface GPUImageMosaicFilter : GPUImageTwoInputFilter {
    GLint inputTileSizeUniform, numTilesUniform, displayTileSizeUniform, colorOnUniform;
    GPUImagePicture *pic;
}
 
//  This filter takes an input tileset, the tiles must ascend in luminance
//  It looks at the input image and replaces each display tile with an input tile 
//  according to the luminance of that tile.  The idea was to replicate the ASCII
//  video filters seen in other apps, but the tileset can be anything.
@property(readwrite, nonatomic) CGSize inputTileSize;
@property(readwrite, nonatomic) float numTiles;
@property(readwrite, nonatomic) CGSize displayTileSize;
@property(readwrite, nonatomic) BOOL colorOn;
@property(readwrite, nonatomic, copy) NSString *tileSet;
 
@end