#import <UIKit/UIKit.h>
#import <stdint.h>

NS_ASSUME_NONNULL_BEGIN

/**
 * Pure Obj-C bridge that lets Swift reach the C++ ThorVG renderer.
 * The header stays C++-free so it can live in the pod's umbrella and be
 * imported by Swift; the C++ include happens only in the .mm.
 */
@interface ThorRenderBridge : NSObject

/**
 * Rasterizes a scene of `count` shapes filling `width`x`height` (device pixels)
 * and returns it as a UIImage. Returns nil on failure.
 *
 * The scene is passed as tightly-packed parallel C arrays (no per-shape
 * NSDictionary / NSNumber boxing — the caller scales geometry to device pixels
 * and parses colors once). All geometry is already in device pixels:
 *  - types[i]       shape kind (0=rect, 1=circle, 2=line, 3=polygon)
 *  - fills[i]       fill color 0xAARRGGBB (alpha 0 == no fill)
 *  - strokes[i]     stroke color 0xAARRGGBB (alpha 0 == no stroke)
 *  - params[i*8..]  [strokeWidth, g1..g6, closed]; geometry slots are
 *                   type-specific (rect: x,y,w,h,rx,ry | circle: cx,cy,radius |
 *                   line: x1,y1,x2,y2), closed is 0/1 for polygons.
 *  - pointsFlat     concatenated polygon vertices (x,y pairs)
 *  - pointCounts[i] number of floats this shape consumes from pointsFlat
 */
+ (nullable UIImage *)imageWithWidth:(int)width
                              height:(int)height
                               count:(int)count
                               types:(const int32_t *)types
                               fills:(const uint32_t *)fills
                             strokes:(const uint32_t *)strokes
                              params:(const float *)params
                          pointsFlat:(const float *)pointsFlat
                         pointCounts:(const int32_t *)pointCounts;

@end

NS_ASSUME_NONNULL_END
