mirror of
https://github.com/Swiftgram/Telegram-iOS.git
synced 2025-12-22 14:20:20 +00:00
Input node improvements
This commit is contained in:
@@ -0,0 +1,31 @@
|
||||
#import <ImageDCT/ImageDCT.h>
|
||||
|
||||
#import <memory>
|
||||
|
||||
#include "DCT.h"
|
||||
|
||||
@interface ImageDCT () {
|
||||
std::unique_ptr<dct::DCT> _dct;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@implementation ImageDCT
|
||||
|
||||
- (instancetype _Nonnull)initWithQuality:(NSInteger)quality {
|
||||
self = [super init];
|
||||
if (self != nil) {
|
||||
_dct = std::unique_ptr<dct::DCT>(new dct::DCT((int)quality));
|
||||
}
|
||||
return self;
|
||||
}
|
||||
|
||||
- (void)forwardWithPixels:(uint8_t const * _Nonnull)pixels coefficients:(int16_t * _Nonnull)coefficients width:(NSInteger)width height:(NSInteger)height bytesPerRow:(NSInteger)bytesPerRow {
|
||||
_dct->forward(pixels, coefficients, (int)width, (int)height, (int)bytesPerRow);
|
||||
}
|
||||
|
||||
- (void)inverseWithCoefficients:(int16_t const * _Nonnull)coefficients pixels:(uint8_t * _Nonnull)pixels width:(NSInteger)width height:(NSInteger)height coefficientsPerRow:(NSInteger)coefficientsPerRow bytesPerRow:(NSInteger)bytesPerRow {
|
||||
_dct->inverse(coefficients, pixels, (int)width, (int)height, (int)coefficientsPerRow, (int)bytesPerRow);
|
||||
}
|
||||
|
||||
@end
|
||||
Reference in New Issue
Block a user