flutter_texture_rgba_renderer/macos/Classes/TextureRgbaApi.m
fufesou 873919902e
Feat/row align bytes (#7)
* better bytes alignment

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug macos

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* debug linux

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* windows switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

* better switch_rgba

Signed-off-by: fufesou <shuanglongchen@yeah.net>

---------

Signed-off-by: fufesou <shuanglongchen@yeah.net>
2023-03-03 09:30:05 +08:00

24 lines
722 B
Objective-C

//
// TextureRgbaApi.m
// texture_rgba_renderer
//
// Created by kingtous on 2023/2/19.
//
#import <Foundation/Foundation.h>
#import "texture_rgba_renderer/texture_rgba_renderer-Swift.h"
#if __cplusplus
extern "C" {
#endif
/// Keep the same name with Windows.
void FlutterRgbaRendererPluginOnRgba(void* texture_rgba_ptr, const uint8_t* buffer, int len, int width, int height, int row_align_bytes) {
TextRgba* texture_rgba = (__bridge TextRgba *)(texture_rgba_ptr);
NSData* data = [NSData dataWithBytesNoCopy:(void*)buffer length:len freeWhenDone:FALSE];
[texture_rgba markFrameAvaliableWithData:data width:width height:height row_align_bytes: row_align_bytes];
}
#if __cplusplus
} //Extern C
#endif