@EditPanelImage.h 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134
  1. /******************************************************************************/
  2. /******************************************************************************/
  3. class EditPanelImage : PanelImageParams
  4. {
  5. class Light
  6. {
  7. TimeStamp enabled, intensity, back, highlight, highlight_cut, specular, specular_back, specular_exp, specular_highlight, specular_highlight_cut, angle;
  8. void reset();
  9. bool newer(C Light&src)C;
  10. bool equal(C Light&src)C;
  11. void newData();
  12. bool sync(PanelImageParams::Light &val, C Light &src, C PanelImageParams::Light &src_val);
  13. bool undo(PanelImageParams::Light &val, C Light &src, C PanelImageParams::Light &src_val);
  14. // io
  15. bool save(File &f)C;
  16. bool load(File &f);
  17. };
  18. class ImageParams
  19. {
  20. TimeStamp blur_clamp, blur, uv_scale, uv_offset, uv_warp, intensity, mode;
  21. void reset();
  22. bool newer(C ImageParams&src)C;
  23. bool equal(C ImageParams&src)C;
  24. void newData();
  25. bool sync(PanelImageParams::ImageParams &val, C ImageParams &src, C PanelImageParams::ImageParams &src_val);
  26. bool undo(PanelImageParams::ImageParams &val, C ImageParams &src, C PanelImageParams::ImageParams &src_val);
  27. // io
  28. bool save(File &f)C;
  29. bool load(File &f);
  30. };
  31. class Section
  32. {
  33. TimeStamp size, top_offset, round_depth, outer_depth, inner_depth, inner_distance, specular, reflection_intensity, smooth_depth,
  34. color, outer_color, inner_color, color_top, color_bottom, color_left, color_right, outer_border_color, inner_border_color, prev_border_color,
  35. depth_overlay, color_overlay, reflection;
  36. UID depth_overlay_id, color_overlay_id, reflection_id;
  37. ImageParams depth_overlay_params, color_overlay_params, depth_noise, color_noise;
  38. void reset();
  39. void includeIDs(MemPtr<UID> ids)C;
  40. bool newer(C Section &src)C;
  41. bool equal(C Section &src)C;
  42. void newData();
  43. bool sync(PanelImageParams::Section &val, C Section &src, C PanelImageParams::Section &src_val);
  44. bool undo(PanelImageParams::Section &val, C Section &src, C PanelImageParams::Section &src_val);
  45. // io
  46. bool save(File &f)C;
  47. bool load(File &f);
  48. public:
  49. Section();
  50. };
  51. class Base
  52. {
  53. TimeStamp cut_left, cut_right, cut_bottom, cut_top,
  54. cut_corners[2][2], cut_corner_slope, cut_corner_amount,
  55. force_uniform_stretch[2],
  56. resolution, width, height,
  57. round_corners, left_slope, right_slope,
  58. max_side_stretch, extend, extend_inner_padd,
  59. border_size,
  60. outer_glow_spread, outer_glow_radius, inner_glow_radius, outer_glow_color, inner_glow_color,
  61. light_ambient,
  62. depth, round_depth, inner_distance, smooth_depth,
  63. shadow_radius, shadow_opacity, shadow_spread,
  64. color, color_top, color_bottom, color_left, color_right,
  65. images_size, top_height, bottom_height, left_right_width, top_corner_width, bottom_corner_width,
  66. top_image, bottom_image, center_image, left_image, right_image, top_left_image, top_right_image, bottom_left_image, bottom_right_image,
  67. compressed_time, mip_maps_time;
  68. bool compressed, mip_maps; // mip-maps disabled by default, because when texture is stretched lower mip maps are used which can look as if outside of the rectangle
  69. UID top_id, bottom_id, center_id, left_id, right_id, top_left_id, top_right_id, bottom_left_id, bottom_right_id;
  70. Light lights [2];
  71. Section sections[2];
  72. void reset();
  73. void includeIDs(MemPtr<UID> ids)C;
  74. bool newer(C Base &src)C;
  75. bool equal(C Base &src)C;
  76. void newData();
  77. bool sync(PanelImageParams &val, C Base &src, C PanelImageParams &src_val);
  78. bool undo(PanelImageParams &val, C Base &src, C PanelImageParams &src_val);
  79. // io
  80. bool save(File &f)C;
  81. bool load(File &f);
  82. public:
  83. Base();
  84. };
  85. Base base;
  86. void reset ( );
  87. void newData( );
  88. bool newer (C EditPanelImage &src)C;
  89. bool equal (C EditPanelImage &src)C;
  90. bool sync (C EditPanelImage &src);
  91. bool undo (C EditPanelImage &src);
  92. class Images
  93. {
  94. class Src
  95. {
  96. UID id;
  97. Image image;
  98. ImagePtr image_ptr;
  99. public:
  100. Src();
  101. };
  102. bool fast;
  103. Memb<Src> images; // use 'Memb' because pointers are returned
  104. Project &proj;
  105. Images(Project &proj, bool fast);
  106. Image* get(C UID &image_id);
  107. };
  108. void make(PanelImage &panel_image, Threads &threads, Project &proj, Image *soft=null, Image *depth_map=null, bool fast=false);
  109. // io
  110. bool save(File &f)C;
  111. bool load(File &f);
  112. bool load(C Str &name);
  113. };
  114. /******************************************************************************/
  115. /******************************************************************************/
  116. /******************************************************************************/