copy.inc 1.7 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. Function ptc_copy_create : TPTC_COPY;
  2. Begin
  3. Try
  4. ptc_copy_create := TPTC_COPY(TPTCCopy.Create);
  5. Except
  6. On error : TPTCError Do
  7. Begin
  8. ptc_exception_handle(error);
  9. ptc_copy_create := Nil;
  10. End;
  11. End;
  12. End;
  13. Procedure ptc_copy_destroy(obj : TPTC_COPY);
  14. Begin
  15. If obj = Nil Then
  16. Exit;
  17. Try
  18. TPTCCopy(obj).Destroy;
  19. Except
  20. On error : TPTCError Do
  21. ptc_exception_handle(error);
  22. End;
  23. End;
  24. Procedure ptc_copy_request(obj : TPTC_COPY; source, destination : TPTC_FORMAT);
  25. Begin
  26. Try
  27. TPTCCopy(obj).request(TPTCFormat(source), TPTCFormat(destination));
  28. Except
  29. On error : TPTCError Do
  30. ptc_exception_handle(error);
  31. End;
  32. End;
  33. Procedure ptc_copy_palette(obj : TPTC_COPY; source, destination : TPTC_PALETTE);
  34. Begin
  35. Try
  36. TPTCCopy(obj).palette(TPTCPalette(source), TPTCPalette(destination));
  37. Except
  38. On error : TPTCError Do
  39. ptc_exception_handle(error);
  40. End;
  41. End;
  42. Procedure ptc_copy_copy(obj : TPTC_COPY; source_pixels : Pointer; source_x, source_y, source_width, source_height, source_pitch : Integer;
  43. destination_pixels : Pointer; destination_x, destination_y, destination_width, destination_height, destination_pitch : Integer);
  44. Begin
  45. Try
  46. TPTCCopy(obj).copy(source_pixels, source_x, source_y, source_width, source_height, source_pitch, destination_pixels, destination_x, destination_y, destination_width, destination_height, destination_pitch);
  47. Except
  48. On error : TPTCError Do
  49. ptc_exception_handle(error);
  50. End;
  51. End;
  52. Function ptc_copy_option(obj : TPTC_COPY; option : String) : Boolean;
  53. Begin
  54. Try
  55. TPTCCopy(obj).option(option);
  56. Except
  57. On error : TPTCError Do
  58. Begin
  59. ptc_exception_handle(error);
  60. ptc_copy_option := False;
  61. End;
  62. End;
  63. End;