*/}}

ourpaint.h 18 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663
  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. uint16_t *TextureTileData;
  397. our_XYZ2RGBFunc XYZ2RGB;
  398. our_Pigment2FinalFunc Pigment2Final;
  399. OurPigmentData* canvas;
  400. real** coeff;
  401. int SX,SY;
  402. real alpha;
  403. };
  404. NEED_STRUCTURE(OurThreadImportPNGDataMain);
  405. STRUCTURE(OurThreadImportPNGData){
  406. OurThreadImportPNGDataMain* main;
  407. void* data;
  408. OurLayer* l;
  409. int starty;
  410. };
  411. STRUCTURE(OurThreadImportPNGDataMain){
  412. OurThreadImportPNGData* data;
  413. int next,max;
  414. SYSLOCK lock;
  415. };
  416. STRUCTURE(OurUsePigment){
  417. laListItem Item;
  418. OurPigment* pigment;
  419. };
  420. STRUCTURE(BrushUniforms){
  421. GLint uCanvasType;
  422. GLint uCanvasRandom;
  423. GLint uCanvasFactor;
  424. GLint uImageOffset;
  425. GLint uBrushCorner;
  426. GLint uBrushCenter;
  427. GLint uBrushSize;
  428. GLint uBrushHardness;
  429. GLint uBrushSmudge;
  430. GLint uBrushRecentness;
  431. GLint uBrushColor;
  432. GLint uBrushSlender;
  433. GLint uBrushAngle;
  434. GLint uBrushDirection;
  435. GLint uBrushForce;
  436. GLint uBrushGunkyness;
  437. GLint uBrushRoutineSelection;
  438. GLint uBrushRoutineSelectionES;
  439. GLint uMixRoutineSelection;
  440. GLint uMixRoutineSelectionES;
  441. GLint uBrushErasing;
  442. GLint uBrushMix;
  443. GLint uBrushSmudgeLifting;
  444. GLint RoutineDoDabs;
  445. GLint RoutineDoSample;
  446. GLint RoutineDoMixNormal;
  447. GLint RoutineDoMixSpectral;
  448. GLint uBlendMode;
  449. GLint uAlphaTop;
  450. GLint uAlphaBottom;
  451. GLsizei SubroutineUniformLocations;
  452. GLint uMixingTop;
  453. };
  454. STRUCTURE(OurRecentFile){
  455. laListItem Item;
  456. laSafeString* Name;
  457. laSafeString* Path;
  458. };
  459. STRUCTURE(OurPaint){
  460. real pad;
  461. laListHandle CanvasSaverDummyList;
  462. laProp* CanvasSaverDummyProp;
  463. laListHandle RecentFiles;
  464. OurRecentFile* PendingRecentFile;
  465. laListHandle BadEvents;
  466. tnsImage* SplashImage;
  467. tnsImage* SplashImageHigh;
  468. laListHandle Palettes;
  469. OurColorPalette* CurrentPalette;
  470. laListHandle Layers;
  471. OurLayer* CurrentLayer;
  472. laListHandle Brushes;
  473. OurBrush* CurrentBrush;
  474. laListHandle Pigments;
  475. OurPigment* CurrentPigment;
  476. laListHandle Lights;
  477. laListHandle CanvasSurfaces;
  478. real SaveBrushSize,SaveEraserSize;
  479. OurDab* Dabs; int NextDab,MaxDab;
  480. float LastBrushCenter[2];
  481. int CanvasVersion;
  482. int MaxRecentFiles;
  483. laSafeString* Notes;
  484. real Smoothness,Hardness;
  485. real MixingSpeed;
  486. real LastX, LastY;
  487. real CurrentScale;
  488. real DefaultScale;
  489. int BrushNumber;
  490. real BrushBaseSize;
  491. real BrushSize;
  492. int BrushPage;
  493. int Tool,ActiveTool,Erasing,EventErasing,BrushMix;
  494. int LockBackground;
  495. int BackgroundType;
  496. int BackgroundRandom;
  497. real BackgroundFactor;
  498. OurBrush* PenBrush,*EraserBrush; real LastPigmentLoading;
  499. int X,Y,W,H; //border
  500. real BorderFadeWidth;
  501. int ColorInterpretation;
  502. int ShowBorder,UseBorder;
  503. int ShowTiles;
  504. int BrushCircleTiltMode;
  505. int AllowNonPressure,PaintProcessedEvents;
  506. int BadEventsLimit,BadEventCount,BadEventsGiveUp;
  507. int EnableBrushCircle,ShowBrushName,ShowBrushNumber;
  508. int EventHasTwist; real EventTwistAngle; real EventTiltOrientation;
  509. int DefaultBitDepth;
  510. int DefaultColorProfile;
  511. int PaintUndoLimit;
  512. int SpectralMode;
  513. int PigmentMode;
  514. int BrushNumbersOnHeader;
  515. int MixModeOnHeader;
  516. int ToolsOnHeader;
  517. int UndoOnHeader;
  518. int LightsOnHeader;
  519. int SketchMode;
  520. int SegmentedWrite;
  521. int PigmentDisplayMethod;
  522. int PaletteInColorsPanel;
  523. int DefaultCanvasType;
  524. int ToolUndo;
  525. tnsTexture* SmudgeTexture;
  526. GLuint CanvasShader; GLuint CanvasProgram;
  527. GLuint CanvasStraightShader; GLuint CanvasStraightProgram;
  528. GLuint CanvasPigmentShader; GLuint CanvasPigmentProgram;
  529. GLuint CompositionShader; GLuint CompositionProgram;
  530. GLuint CompositionStraightShader; GLuint CompositionStraightProgram;
  531. GLuint LayerShader; GLuint LayerProgram;
  532. GLuint DisplayShader; GLuint DisplayProgram;
  533. GLuint PigmentCompositionShader; GLuint PigmentCompositionProgram;
  534. GLuint PigmentLayeringShader; tnsShader* PigmentLayeringProgramT;
  535. GLuint PigmentDisplayShader; tnsShader* PigmentDisplayProgramT;
  536. GLuint uPigmentFragOffset,uPigmentTextureScale,uPigmentDisplayMode;
  537. GLint uboBrushPigment,uboBrushPigmentLocation;
  538. GLint uboCanvasPigment,uboCanvasPigmentLocation;
  539. BrushUniforms *u,uRGBA,uRGBStraightA,uPigment;
  540. int AlphaMode;
  541. int ReorderPigmnets;
  542. OurCanvasSurface *CanvasSurface; // not ptr to list
  543. OurLight *CanvasLight;
  544. OurPigmentData PickedPigment;
  545. OurPigmentData MixedPigment;
  546. laListHandle UsePigments;
  547. OurPigment* UseWhite;
  548. OurPigment* UseBlack;
  549. int ExposureCompensation;
  550. real CurrentColor[3];
  551. real BackgroundColor[3];
  552. uint16_t BColorU16[4];
  553. uint8_t BColorU8[4];
  554. real BorderAlpha;
  555. int ShowStripes;
  556. int ShowGrid;
  557. int ShowRef;
  558. int RefSize;
  559. int RefCategory;
  560. int RefOrientation;
  561. int RefCutHalf;
  562. real RefMargins[3],RefPaddings[2];
  563. int RefBiases[2];
  564. real RefAlpha;
  565. real xmin,xmax,ymin,ymax; // stroke bbox for undo region
  566. int ResetBrush;
  567. int SaveFailed;
  568. int FileRegistered;
  569. uint16_t *ImageBuffer;
  570. int ImageW,ImageH,ImageX,ImageY,LoadX,LoadY,TempLoadX,TempLoadY;
  571. uint8_t* ThumbnailBuffer;
  572. void* icc_LinearsRGB; int iccsize_LinearsRGB;
  573. void* icc_LinearClay; int iccsize_LinearClay;
  574. void* icc_LinearD65P3; int iccsize_LinearD65P3;
  575. void* icc_sRGB; int iccsize_sRGB;
  576. void* icc_Clay; int iccsize_Clay;
  577. void* icc_D65P3; int iccsize_D65P3;
  578. void* ProofTablesRGB, *ProofTableClay, *ProofTableD65;
  579. };
  580. void ourreset_Canvas(OurPaint* op);
  581. int ourProcessInitArgs(int argc, char* argv[]);
  582. int ourInit();
  583. void ourFinalize(int anyload);
  584. void ourRegisterNodes();
  585. int ourRebuildBrushEval();
  586. int ourEvalBrush();
  587. void ourMakeTranslations_zh_hans();
  588. void ourMakeTranslations_es_ES();
  589. void our_EnableSplashPanel();