SignatureRenderer.h 899 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. //
  2. // SignatureRenderer.h
  3. // HelloTriangle
  4. //
  5. // Created by Rui Zhang on 4/27/23.
  6. // Copyright © 2023 Apple. All rights reserved.
  7. //
  8. #import <Foundation/Foundation.h>
  9. @import MetalKit;
  10. @import simd;
  11. NS_ASSUME_NONNULL_BEGIN
  12. typedef enum AAPLVertexInputIndex
  13. {
  14. AAPLVertexInputIndexVertices = 0,
  15. AAPLVertexInputIndexViewportSize = 1,
  16. } AAPLVertexInputIndex;
  17. struct PPSSignaturePoint
  18. {
  19. // float vertex[2]; // 2D positions,
  20. // float color[4]; //RGBA colors,
  21. vector_float2 position;
  22. vector_float4 color;
  23. };
  24. typedef struct PPSSignaturePoint PPSSignaturePoint;
  25. @interface SignatureRenderer : NSObject<MTKViewDelegate>
  26. - (nonnull instancetype)initWithMetalKitView:(nonnull MTKView *)mtkView;
  27. @property PPSSignaturePoint* SignatureVertexData;
  28. @property int vertexTotal;
  29. @property (strong,nonatomic) NSMutableArray* parts;
  30. @end
  31. NS_ASSUME_NONNULL_END