#import <Foundation/Foundation.h>
#include <stdint.h>

NS_ASSUME_NONNULL_BEGIN
// Packed RGBA pixels, limited to maxSide before rasterization. Width/height are out parameters.
FOUNDATION_EXPORT NSData * _Nullable YokanDecodePanel(NSData *data, int maxSide, int *width, int *height);
// Reads and bounds the source dimensions (including orientation) before full-resolution decode.
// failureCode: 1 for corrupt/unsupported input, 2 for page bounds exceeded.
FOUNDATION_EXPORT NSData * _Nullable YokanDecodePanelFullPage(NSData *data, int *width, int *height, int *failureCode);
FOUNDATION_EXPORT NSData * _Nullable YokanEncodePanel(const uint32_t *argb, int width, int height);
FOUNDATION_EXPORT BOOL YokanInferPanel(NSString *modelPath, const float *input, float *output, int width, int height);
NS_ASSUME_NONNULL_END
