*/}}

ourpaint.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659
  1. /*
  2. * Our Paint: A light weight GPU powered painting program.
  3. * Copyright (C) 2022-2023 Wu Yiming
  4. *
  5. * This program is free software: you can redistribute it and/or modify
  6. * it under the terms of the GNU General Public License as published by
  7. * the Free Software Foundation, either version 3 of the License, or
  8. * (at your option) any later version.
  9. *
  10. * This program is distributed in the hope that it will be useful,
  11. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  12. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  13. * GNU General Public License for more details.
  14. *
  15. * You should have received a copy of the GNU General Public License
  16. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  17. */
  18. #include "la_5.h"
  19. #ifndef OURPAINT_GIT_BRANCH
  20. #define OURPAINT_GIT_BRANCH "Release 1"
  21. #endif
  22. // No need to show hash when not compiled from git repo.
  23. //#ifndef OURPAINT_GIT_HASH
  24. //#define OURPAINT_GIT_HASH "?"
  25. //#endif
  26. extern unsigned char DATA_SPLASH[];
  27. extern unsigned char DATA_SPLASH_HIGHDPI[];
  28. #ifdef __cplusplus
  29. extern "C" {
  30. #endif
  31. extern const char OUR_SHADER_VERSION_430[];
  32. extern const char OUR_SHADER_VERSION_320ES[];
  33. extern const char OUR_CANVAS_SHADER[];
  34. extern const char OUR_COMPOSITION_SHADER[];
  35. extern const char OUR_SHADER_COMMON[];
  36. extern const char OUR_MIME[];
  37. extern const char OUR_THUMBNAILER[];
  38. extern const char OUR_DESKTOP[];
  39. extern const char OUR_PIGMENT_TEXTURE_MIX_SHADER[];
  40. extern const char OUR_PIGMENT_COMPOSITION_SHADER[];
  41. extern const char OUR_PIGMENT_TEXTURE_DISPLAY_SHADER[];
  42. extern const char OUR_PIGMENT_COMMON[];
  43. #ifdef __cplusplus
  44. } // extern "C"
  45. #endif
  46. #define OUR_AT_CROP_CENTER 0
  47. #define OUR_AT_CROP_L 1
  48. #define OUR_AT_CROP_R 2
  49. #define OUR_AT_CROP_U 3
  50. #define OUR_AT_CROP_B 4
  51. #define OUR_AT_CROP_UL 5
  52. #define OUR_AT_CROP_UR 6
  53. #define OUR_AT_CROP_BL 7
  54. #define OUR_AT_CROP_BR 8
  55. #define OUR_VERSION_MAJOR 0
  56. #define OUR_VERSION_MINOR 5
  57. #define OUR_VERSION_SUB 0
  58. #define OUR_PAINT_NAME_STRING "Our Paint v0.5"
  59. #define OUR_SIGNAL_PICK 1
  60. #define OUR_SIGNAL_MOVE 2
  61. #define OUR_SIGNAL_PICK 3
  62. #define OUR_SIGNAL_TOGGLE_ERASING 4
  63. #define OUR_SIGNAL_ZOOM_IN 5
  64. #define OUR_SIGNAL_ZOOM_OUT 6
  65. #define OUR_SIGNAL_BRUSH_BIGGER 7
  66. #define OUR_SIGNAL_BRUSH_SMALLER 8
  67. #define OUR_SIGNAL_TOGGLE_SKETCH 9
  68. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_0 10
  69. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_1 11
  70. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_2 12
  71. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_3 13
  72. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_4 14
  73. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_5 15
  74. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_6 16
  75. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_7 17
  76. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_8 18
  77. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_9 19
  78. #define OUR_SIGNAL_SELECT_BRUSH_SIZE_FREE 20
  79. #define OUR_SIGNAL_ADJUST 21
  80. #define OUR_SIGNAL_SELECT_BRUSH_ID_0 22
  81. #define OUR_SIGNAL_SELECT_BRUSH_ID_1 23
  82. #define OUR_SIGNAL_SELECT_BRUSH_ID_2 24
  83. #define OUR_SIGNAL_SELECT_BRUSH_ID_3 25
  84. #define OUR_SIGNAL_SELECT_BRUSH_ID_4 26
  85. #define OUR_SIGNAL_SELECT_BRUSH_ID_5 27
  86. #define OUR_SIGNAL_SELECT_BRUSH_ID_6 28
  87. #define OUR_SIGNAL_SELECT_BRUSH_ID_7 29
  88. #define OUR_SIGNAL_SELECT_BRUSH_ID_8 30
  89. #define OUR_SIGNAL_SELECT_BRUSH_ID_9 31
  90. extern laWidget* OUR_WIDGET_PIGMENT;
  91. extern laUiType* _OUR_UI_PIGMENT;
  92. #define OUR_COLOR_PAD_PIGMENT_DATA LA_UI_FLAGS_KNOB
  93. #define OURU Our->u
  94. STRUCTURE(OurCanvasDraw){
  95. laCanvasExtra Base;
  96. tnsOffscreen *OffScrSave;
  97. int HideBrushCircle;
  98. int AtCrop;
  99. real CanvasLastX,CanvasLastY;
  100. real CanvasDownX,CanvasDownY;
  101. real PointerX,PointerY,DownTilt;
  102. real LastPressure;
  103. real LastTilt[2];
  104. real LastTwist;
  105. real LastSize;
  106. int LastNumber;
  107. int MovedX,MovedY;
  108. };
  109. #define OUR_DPC (600*0.3937007874)
  110. #define OUR_SPECTRAL_SLICES 14
  111. #define OUR_MIXING_SPEED (Our->MixingSpeed/10.0f)
  112. #define OUR_TILE_W 1024
  113. #define OUR_TILES_PER_ROW 100
  114. #define OUR_TILE_CTR (OUR_TILES_PER_ROW/2)
  115. #define OUR_TILE_SEAM 12
  116. #define OUR_TILE_W_USE (OUR_TILE_W-OUR_TILE_SEAM*2)
  117. #define OUR_BRUSH_ACTUAL_SIZE(b) (Our->BrushNumber?Our->BrushBaseSize*pow(2,(real)Our->BrushNumber/2+(b?b->SizeOffset:0)):pow(2,Our->BrushSize+(b?b->SizeOffset:0)))
  118. #ifdef LA_USE_GLES
  119. #define OUR_PIX_COMPACT uint8_t
  120. #define OUR_PIX_MAX 255
  121. #else
  122. #define OUR_PIX_COMPACT uint16_t
  123. #define OUR_PIX_MAX 65535
  124. #endif
  125. STRUCTURE(OurTexTile){
  126. tnsTexture* Texture;
  127. OUR_PIX_COMPACT* Data;
  128. int l,r,u,b;
  129. OUR_PIX_COMPACT* FullData;
  130. OUR_PIX_COMPACT* CopyBuffer;
  131. int cl,cr,cu,cb;
  132. };
  133. #define OUR_BLEND_NORMAL 0
  134. #define OUR_BLEND_ADD 1
  135. typedef struct OurLayerImageSegmented{
  136. uint32_t Sizes[32];
  137. int H[32];
  138. int Count; int Width,Height;
  139. }OurLayerImageSegmented;
  140. STRUCTURE(OurLayer){
  141. laListItem Item;
  142. laSafeString* Name;
  143. int OffsetX,OffsetY;
  144. real Transparency;
  145. int Lock;
  146. int Hide;
  147. int BlendMode;
  148. int AsSketch;
  149. OurTexTile** TexTiles[OUR_TILES_PER_ROW];
  150. OurLayerImageSegmented ReadSegmented;
  151. };
  152. STRUCTURE(OurLayerWrite){
  153. unsigned char* data;
  154. size_t NextData, MaxData;
  155. };
  156. STRUCTURE(OurLayerRead){
  157. unsigned char* data;
  158. size_t NextData;
  159. };
  160. STRUCTURE(OurBrushSettingsNode){
  161. laBaseNode Base;
  162. laNodeOutSocket* CanvasScale; real rCanvasScale;
  163. laNodeOutSocket* Size; real rSize;
  164. laNodeOutSocket* Transparency; real rTransparency;
  165. laNodeOutSocket* Hardness; real rHardness;
  166. laNodeOutSocket* Smudge; real rSmudge;
  167. laNodeOutSocket* DabsPerSize; real rDabsPerSize;
  168. laNodeOutSocket* SmudgeLength; real rSmudgeLength;
  169. laNodeOutSocket* SmudgeLifting;real rSmudgeLifting;
  170. laNodeOutSocket* Slender; real rSlender;
  171. laNodeOutSocket* Angle; real rAngle;
  172. laNodeOutSocket* Gunkyness; real rGunkyness;
  173. laNodeOutSocket* Accumulation; real rAccumulation;
  174. laNodeOutSocket* DepletionSpeed;real rDepletionSpeed;
  175. laNodeOutSocket* Force; real rForce;
  176. laNodeOutSocket* Color;
  177. laNodeOutSocket* Iteration; int rIteration;
  178. laNodeOutSocket* Custom1; real rCustom1;
  179. laNodeOutSocket* Custom2; real rCustom2;
  180. };
  181. STRUCTURE(OurBrushOutputsNode){
  182. laBaseNode Base;
  183. laNodeInSocket* Offset;
  184. laNodeInSocket* Size;
  185. laNodeInSocket* Transparency;
  186. laNodeInSocket* Hardness;
  187. laNodeInSocket* Smudge;
  188. laNodeInSocket* DabsPerSize;
  189. laNodeInSocket* SmudgeLength;
  190. laNodeInSocket* SmudgeLifting;
  191. laNodeInSocket* Slender;
  192. laNodeInSocket* Angle;
  193. laNodeInSocket* Color;
  194. laNodeInSocket* Gunkyness;
  195. laNodeInSocket* Accumulation;
  196. laNodeInSocket* DepletionSpeed;
  197. laNodeInSocket* Force;
  198. laNodeInSocket* Repeats;
  199. laNodeInSocket* Discard;
  200. };
  201. STRUCTURE(OurBrushDeviceNode){
  202. laBaseNode Base;
  203. laNodeOutSocket* Pressure; real rPressure;
  204. laNodeOutSocket* Position; real rPosition[2];
  205. laNodeOutSocket* Tilt; real rTilt[2];
  206. laNodeOutSocket* Twist; real rTwist;
  207. laNodeOutSocket* IsEraser; int rIsEraser;
  208. laNodeOutSocket* Speed; real rSpeed;
  209. laNodeOutSocket* Angle; real rAngle;
  210. laNodeOutSocket* Length; real rLength;
  211. laNodeOutSocket* LengthAccum; real rLengthAccum;
  212. laNodeOutSocket* PigmentLoading; real rPigmentLoading;
  213. };
  214. STRUCTURE(OurBrush){
  215. laListItem Item;
  216. laSafeString* Name; int Version;
  217. real SizeOffset;
  218. real DabsPerSize;
  219. real Hardness;
  220. real Transparency;
  221. real Smudge,SmudgeLifting;
  222. real SmudgeResampleLength; real SmudgeAccum; int SmudgeRestart; real BrushRemainingDist;
  223. real Slender;
  224. real Angle;
  225. real Force, Gunkyness;
  226. real Smoothness;
  227. real MaxStrokeLength;
  228. real Custom1,Custom2; laSafeString *Custom1Name,*Custom2Name;
  229. real Accumulation;
  230. real DepletionSpeed;
  231. int Iteration;
  232. int PressureSize,PressureHardness,PressureTransparency,PressureSmudge,PressureForce,
  233. TwistAngle,PressureDepletion,PressureAccumulation; // the simple way
  234. int Binding,DefaultAsEraser;
  235. int ShowInPages;
  236. real VisualOffset;
  237. real VisualOffsetAngle;
  238. int16_t OffsetFollowPenTilt;
  239. int16_t UseNodes; // the flexible way
  240. laRackPage* Rack;
  241. real LastX,LastY,LastAngle;
  242. real EvalColor[3];
  243. real EvalOffset[2];
  244. real EvalSize;
  245. real EvalDabsPerSize;
  246. real EvalHardness;
  247. real EvalTransparency;
  248. real EvalSmudge;
  249. real EvalSmudgeLength;
  250. real EvalSmudgeLifting;
  251. real EvalSlender;
  252. real EvalAngle;
  253. real EvalForce, EvalGunkyness;
  254. real EvalAccumulation;
  255. real EvalDepletionSpeed, PigmentLoading;
  256. real EvalSpeed;
  257. real EvalStrokeLength;
  258. real EvalStrokeLengthAccum;
  259. real EvalPressure;
  260. real EvalPosition[2];
  261. real EvalTilt[2];
  262. real EvalTwist;
  263. real EvalStrokeAngle;
  264. int EvalIsEraser;
  265. int EvalRepeats;
  266. int EvalDiscard;
  267. };
  268. STRUCTURE(OurDab){
  269. float X,Y;
  270. float Size;
  271. float Hardness;
  272. float Smudge, SmudgeLifting; int ResampleSmudge;
  273. float Color[4];
  274. float Slender;
  275. float Angle;
  276. float Direction[2];
  277. float Force;
  278. float Gunkyness;
  279. float Recentness;
  280. float Accumulation;
  281. };
  282. STRUCTURE(OurPigmentData){
  283. real Reflectance[16];
  284. real Absorption[16];
  285. real PreviewColor[3][4];
  286. };
  287. STRUCTURE(OurBrushData140){
  288. float Reflectance[64];
  289. float Absorption[64];
  290. };
  291. STRUCTURE(OurPigmentData140){
  292. float Reflectance[64];
  293. float Absorption[64];
  294. float PaperReflectance[64];
  295. float PaperAbsorption[64];
  296. };
  297. STRUCTURE(OurPigment){
  298. laListItem Item;
  299. laSafeString* Name;
  300. OurPigmentData Pigment;
  301. };
  302. STRUCTURE(OurLight){
  303. laListItem Item;
  304. laSafeString* Name;
  305. OurPigmentData Emission;
  306. };
  307. STRUCTURE(OurCanvasSurface){
  308. laListItem Item;
  309. laSafeString* Name;
  310. OurPigmentData Reflectance;
  311. };
  312. NEED_STRUCTURE(OurColorPalette);
  313. STRUCTURE(OurColorItem){
  314. laListItem Item;
  315. OurPigmentData Pigment;
  316. int IsPigment;
  317. OurColorPalette* Parent;
  318. };
  319. STRUCTURE(OurColorPalette){
  320. laListItem Item;
  321. laSafeString* Name;
  322. laListHandle Colors;
  323. };
  324. STRUCTURE(OurUndoTile){
  325. laListItem Item;
  326. int col,row;
  327. OUR_PIX_COMPACT* CopyData;
  328. int l,r,u,b;
  329. };
  330. STRUCTURE(OurUndo){
  331. OurLayer* Layer;
  332. laListHandle Tiles;
  333. };
  334. STRUCTURE(OurMoveUndo){
  335. OurLayer* Layer;
  336. int dx,dy;
  337. };
  338. #define OUR_TOOL_PAINT 0
  339. #define OUR_TOOL_CROP 1
  340. #define OUR_TOOL_MOVE 2
  341. #define OUR_PNG_READ_INPUT_FLAT 0
  342. #define OUR_PNG_READ_INPUT_ICC 1
  343. #define OUR_PNG_READ_INPUT_SRGB 2
  344. #define OUR_PNG_READ_INPUT_LINEAR_SRGB 3
  345. #define OUR_PNG_READ_INPUT_CLAY 4
  346. #define OUR_PNG_READ_INPUT_LINEAR_CLAY 5
  347. #define OUR_PNG_READ_INPUT_D65_P3 6
  348. #define OUR_PNG_READ_INPUT_LINEAR_D65_P3 7
  349. #define OUR_PNG_READ_OUTPUT_CANVAS 0
  350. #define OUR_PNG_READ_OUTPUT_LINEAR_SRGB OUR_PNG_READ_INPUT_LINEAR_SRGB
  351. #define OUR_PNG_READ_OUTPUT_LINEAR_CLAY OUR_PNG_READ_INPUT_LINEAR_CLAY
  352. #define OUR_PNG_READ_OUTPUT_LINEAR_D65_P3 OUR_PNG_READ_INPUT_LINEAR_D65_P3
  353. #define OUR_CANVAS_INTERPRETATION_SRGB 0
  354. #define OUR_CANVAS_INTERPRETATION_CLAY 1
  355. #define OUR_CANVAS_INTERPRETATION_D65_P3 2
  356. #define OUR_EXPORT_BIT_DEPTH_8 0
  357. #define OUR_EXPORT_BIT_DEPTH_16 1
  358. #define OUR_EXPORT_COLOR_MODE_SRGB OUR_CANVAS_INTERPRETATION_SRGB
  359. #define OUR_EXPORT_COLOR_MODE_CLAY OUR_CANVAS_INTERPRETATION_CLAY
  360. #define OUR_EXPORT_COLOR_MODE_D65_P3 OUR_CANVAS_INTERPRETATION_D65_P3
  361. #define OUR_EXPORT_COLOR_MODE_FLAT (OUR_CANVAS_INTERPRETATION_D65_P3+1)
  362. #define OUR_BRUSH_PAGE_LIST 128
  363. STRUCTURE(OurPNGReadExtra){
  364. int Confirming;
  365. laSafeString* FilePath;
  366. laSafeString* iccName;
  367. int HassRGB;
  368. int HasProfile;
  369. int InputMode;
  370. int OutputMode;
  371. int Offsets[2];
  372. };
  373. STRUCTURE(OurPNGWriteExtra){
  374. int Confirming;
  375. laSafeString* FilePath;
  376. int BitDepth;
  377. int ColorProfile;
  378. int Transparent;
  379. int PigmentConversionMethod;
  380. int CropX,CropY,CropW,CropH;
  381. };
  382. STRUCTURE(OurThreadExportPNGData){
  383. uint32_t* r_sizes;
  384. void** pointers;
  385. int i;
  386. int segy,h;
  387. int fail;
  388. };
  389. typedef void (*our_XYZ2RGBFunc)(tnsVector3d xyz, tnsVector3d rgb);
  390. typedef void (*our_2LogRGBFunc)(tnsVector3d rgb);
  391. typedef real (*our_Pigment2FinalFunc)(real* rgb, OurPigmentData* pd, void* buffer, int64_t index);
  392. STRUCTURE(OurPigmentConversionData){
  393. int RowStart,RowCount;
  394. int cols;
  395. uint16_t *ImageConversionBuffer;
  396. our_XYZ2RGBFunc XYZ2RGB;
  397. our_Pigment2FinalFunc Pigment2Final;
  398. OurPigmentData* canvas;
  399. real** coeff;
  400. };
  401. NEED_STRUCTURE(OurThreadImportPNGDataMain);
  402. STRUCTURE(OurThreadImportPNGData){
  403. OurThreadImportPNGDataMain* main;
  404. void* data;
  405. OurLayer* l;
  406. int starty;
  407. };
  408. STRUCTURE(OurThreadImportPNGDataMain){
  409. OurThreadImportPNGData* data;
  410. int next,max;
  411. SYSLOCK lock;
  412. };
  413. STRUCTURE(OurUsePigment){
  414. laListItem Item;
  415. OurPigment* pigment;
  416. };
  417. STRUCTURE(BrushUniforms){
  418. GLint uCanvasType;
  419. GLint uCanvasRandom;
  420. GLint uCanvasFactor;
  421. GLint uImageOffset;
  422. GLint uBrushCorner;
  423. GLint uBrushCenter;
  424. GLint uBrushSize;
  425. GLint uBrushHardness;
  426. GLint uBrushSmudge;
  427. GLint uBrushRecentness;
  428. GLint uBrushColor;
  429. GLint uBrushSlender;
  430. GLint uBrushAngle;
  431. GLint uBrushDirection;
  432. GLint uBrushForce;
  433. GLint uBrushGunkyness;
  434. GLint uBrushRoutineSelection;
  435. GLint uBrushRoutineSelectionES;
  436. GLint uMixRoutineSelection;
  437. GLint uMixRoutineSelectionES;
  438. GLint uBrushErasing;
  439. GLint uBrushMix;
  440. GLint uBrushSmudgeLifting;
  441. GLint RoutineDoDabs;
  442. GLint RoutineDoSample;
  443. GLint RoutineDoMixNormal;
  444. GLint RoutineDoMixSpectral;
  445. GLint uBlendMode;
  446. GLint uAlphaTop;
  447. GLint uAlphaBottom;
  448. GLsizei SubroutineUniformLocations;
  449. GLint uMixingTop;
  450. };
  451. STRUCTURE(OurRecentFile){
  452. laListItem Item;
  453. laSafeString* Name;
  454. laSafeString* Path;
  455. };
  456. STRUCTURE(OurPaint){
  457. real pad;
  458. laListHandle CanvasSaverDummyList;
  459. laProp* CanvasSaverDummyProp;
  460. laListHandle RecentFiles;
  461. OurRecentFile* PendingRecentFile;
  462. laListHandle BadEvents;
  463. tnsImage* SplashImage;
  464. tnsImage* SplashImageHigh;
  465. laListHandle Palettes;
  466. OurColorPalette* CurrentPalette;
  467. laListHandle Layers;
  468. OurLayer* CurrentLayer;
  469. laListHandle Brushes;
  470. OurBrush* CurrentBrush;
  471. laListHandle Pigments;
  472. OurPigment* CurrentPigment;
  473. laListHandle Lights;
  474. laListHandle CanvasSurfaces;
  475. real SaveBrushSize,SaveEraserSize;
  476. OurDab* Dabs; int NextDab,MaxDab;
  477. float LastBrushCenter[2];
  478. int CanvasVersion;
  479. int MaxRecentFiles;
  480. laSafeString* Notes;
  481. real Smoothness,Hardness;
  482. real MixingSpeed;
  483. real LastX, LastY;
  484. real CurrentScale;
  485. real DefaultScale;
  486. int BrushNumber;
  487. real BrushBaseSize;
  488. real BrushSize;
  489. int BrushPage;
  490. int Tool,ActiveTool,Erasing,EventErasing,BrushMix;
  491. int LockBackground;
  492. int BackgroundType;
  493. int BackgroundRandom;
  494. real BackgroundFactor;
  495. int PenID,EraserID;
  496. int X,Y,W,H; //border
  497. real BorderFadeWidth;
  498. int ColorInterpretation;
  499. int ShowBorder,UseBorder;
  500. int ShowTiles;
  501. int BrushCircleTiltMode;
  502. int AllowNonPressure,PaintProcessedEvents;
  503. int BadEventsLimit,BadEventCount,BadEventsGiveUp;
  504. int EnableBrushCircle,ShowBrushName,ShowBrushNumber;
  505. int EventHasTwist; real EventTwistAngle; real EventTiltOrientation;
  506. int DefaultBitDepth;
  507. int DefaultColorProfile;
  508. int PaintUndoLimit;
  509. int SpectralMode;
  510. int PigmentMode;
  511. int BrushNumbersOnHeader;
  512. int MixModeOnHeader;
  513. int ToolsOnHeader;
  514. int UndoOnHeader;
  515. int LightsOnHeader;
  516. int SketchMode;
  517. int SegmentedWrite;
  518. int PigmentDisplayMethod;
  519. int PaletteInColorsPanel;
  520. int DefaultCanvasType;
  521. int ToolUndo;
  522. tnsTexture* SmudgeTexture;
  523. GLuint CanvasShader; GLuint CanvasProgram;
  524. GLuint CanvasStraightShader; GLuint CanvasStraightProgram;
  525. GLuint CanvasPigmentShader; GLuint CanvasPigmentProgram;
  526. GLuint CompositionShader; GLuint CompositionProgram;
  527. GLuint CompositionStraightShader; GLuint CompositionStraightProgram;
  528. GLuint LayerShader; GLuint LayerProgram;
  529. GLuint DisplayShader; GLuint DisplayProgram;
  530. GLuint PigmentCompositionShader; GLuint PigmentCompositionProgram;
  531. GLuint PigmentLayeringShader; tnsShader* PigmentLayeringProgramT;
  532. GLuint PigmentDisplayShader; tnsShader* PigmentDisplayProgramT;
  533. GLuint uPigmentFragOffset,uPigmentTextureScale,uPigmentDisplayMode;
  534. GLint uboBrushPigment,uboBrushPigmentLocation;
  535. GLint uboCanvasPigment,uboCanvasPigmentLocation;
  536. BrushUniforms *u,uRGBA,uRGBStraightA,uPigment;
  537. int AlphaMode;
  538. int ReorderPigmnets;
  539. OurCanvasSurface *CanvasSurface; // not ptr to list
  540. OurLight *CanvasLight;
  541. OurPigmentData PickedPigment;
  542. OurPigmentData MixedPigment;
  543. laListHandle UsePigments;
  544. OurPigment* UseWhite;
  545. OurPigment* UseBlack;
  546. real CurrentColor[3];
  547. real BackgroundColor[3];
  548. uint16_t BColorU16[4];
  549. uint8_t BColorU8[4];
  550. real BorderAlpha;
  551. int ShowStripes;
  552. int ShowGrid;
  553. int ShowRef;
  554. int RefSize;
  555. int RefCategory;
  556. int RefOrientation;
  557. int RefCutHalf;
  558. real RefMargins[3],RefPaddings[2];
  559. int RefBiases[2];
  560. real RefAlpha;
  561. real xmin,xmax,ymin,ymax; // stroke bbox for undo region
  562. int ResetBrush;
  563. int SaveFailed;
  564. int FileRegistered;
  565. uint16_t *ImageBuffer;
  566. int ImageW,ImageH,ImageX,ImageY,LoadX,LoadY,TempLoadX,TempLoadY;
  567. uint8_t* ThumbnailBuffer;
  568. void* icc_LinearsRGB; int iccsize_LinearsRGB;
  569. void* icc_LinearClay; int iccsize_LinearClay;
  570. void* icc_LinearD65P3; int iccsize_LinearD65P3;
  571. void* icc_sRGB; int iccsize_sRGB;
  572. void* icc_Clay; int iccsize_Clay;
  573. void* icc_D65P3; int iccsize_D65P3;
  574. void* ProofTablesRGB, *ProofTableClay, *ProofTableD65;
  575. };
  576. void ourreset_Canvas(OurPaint* op);
  577. int ourProcessInitArgs(int argc, char* argv[]);
  578. int ourInit();
  579. void ourFinalize(int anyload);
  580. void ourRegisterNodes();
  581. int ourRebuildBrushEval();
  582. int ourEvalBrush();
  583. void ourMakeTranslations_zh_hans();
  584. void ourMakeTranslations_es_ES();
  585. void our_EnableSplashPanel();