*/}}

ourpaint.h 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630
  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 0.05f
  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. #else
  121. #define OUR_PIX_COMPACT uint16_t
  122. #endif
  123. STRUCTURE(OurTexTile){
  124. tnsTexture* Texture;
  125. OUR_PIX_COMPACT* Data;
  126. int l,r,u,b;
  127. OUR_PIX_COMPACT* FullData;
  128. OUR_PIX_COMPACT* CopyBuffer;
  129. int cl,cr,cu,cb;
  130. };
  131. #define OUR_BLEND_NORMAL 0
  132. #define OUR_BLEND_ADD 1
  133. typedef struct OurLayerImageSegmented{
  134. uint32_t Sizes[32];
  135. int H[32];
  136. int Count; int Width,Height;
  137. }OurLayerImageSegmented;
  138. STRUCTURE(OurLayer){
  139. laListItem Item;
  140. laSafeString* Name;
  141. int OffsetX,OffsetY;
  142. real Transparency;
  143. int Lock;
  144. int Hide;
  145. int BlendMode;
  146. int AsSketch;
  147. OurTexTile** TexTiles[OUR_TILES_PER_ROW];
  148. OurLayerImageSegmented ReadSegmented;
  149. };
  150. STRUCTURE(OurLayerWrite){
  151. unsigned char* data;
  152. size_t NextData, MaxData;
  153. };
  154. STRUCTURE(OurLayerRead){
  155. unsigned char* data;
  156. size_t NextData;
  157. };
  158. STRUCTURE(OurBrushSettingsNode){
  159. laBaseNode Base;
  160. laNodeOutSocket* CanvasScale; real rCanvasScale;
  161. laNodeOutSocket* Size; real rSize;
  162. laNodeOutSocket* Transparency; real rTransparency;
  163. laNodeOutSocket* Hardness; real rHardness;
  164. laNodeOutSocket* Smudge; real rSmudge;
  165. laNodeOutSocket* DabsPerSize; real rDabsPerSize;
  166. laNodeOutSocket* SmudgeLength; real rSmudgeLength;
  167. laNodeOutSocket* Slender; real rSlender;
  168. laNodeOutSocket* Angle; real rAngle;
  169. laNodeOutSocket* Gunkyness; real rGunkyness;
  170. laNodeOutSocket* Accumulation; real rAccumulation;
  171. laNodeOutSocket* Force; real rForce;
  172. laNodeOutSocket* Color;
  173. laNodeOutSocket* Iteration; int rIteration;
  174. laNodeOutSocket* Custom1; real rCustom1;
  175. laNodeOutSocket* Custom2; real rCustom2;
  176. };
  177. STRUCTURE(OurBrushOutputsNode){
  178. laBaseNode Base;
  179. laNodeInSocket* Offset;
  180. laNodeInSocket* Size;
  181. laNodeInSocket* Transparency;
  182. laNodeInSocket* Hardness;
  183. laNodeInSocket* Smudge;
  184. laNodeInSocket* DabsPerSize;
  185. laNodeInSocket* SmudgeLength;
  186. laNodeInSocket* Slender;
  187. laNodeInSocket* Angle;
  188. laNodeInSocket* Color;
  189. laNodeInSocket* Gunkyness;
  190. laNodeInSocket* Accumulation;
  191. laNodeInSocket* Force;
  192. laNodeInSocket* Repeats;
  193. laNodeInSocket* Discard;
  194. };
  195. STRUCTURE(OurBrushDeviceNode){
  196. laBaseNode Base;
  197. laNodeOutSocket* Pressure; real rPressure;
  198. laNodeOutSocket* Position; real rPosition[2];
  199. laNodeOutSocket* Tilt; real rTilt[2];
  200. laNodeOutSocket* Twist; real rTwist;
  201. laNodeOutSocket* IsEraser; int rIsEraser;
  202. laNodeOutSocket* Speed; real rSpeed;
  203. laNodeOutSocket* Angle; real rAngle;
  204. laNodeOutSocket* Length; real rLength;
  205. laNodeOutSocket* LengthAccum; real rLengthAccum;
  206. };
  207. STRUCTURE(OurBrush){
  208. laListItem Item;
  209. laSafeString* Name; int Version;
  210. real SizeOffset;
  211. real DabsPerSize;
  212. real Hardness;
  213. real Transparency;
  214. real Smudge;
  215. real SmudgeResampleLength; real SmudgeAccum; int SmudgeRestart; real BrushRemainingDist;
  216. real Slender;
  217. real Angle;
  218. real Force, Gunkyness;
  219. real Smoothness;
  220. real MaxStrokeLength;
  221. real Custom1,Custom2; laSafeString *Custom1Name,*Custom2Name;
  222. real Accumulation;
  223. int Iteration;
  224. int PressureSize,PressureHardness,PressureTransparency,PressureSmudge,PressureForce,TwistAngle; // the simple way
  225. int Binding,DefaultAsEraser;
  226. int ShowInPages;
  227. real VisualOffset;
  228. real VisualOffsetAngle;
  229. int16_t OffsetFollowPenTilt;
  230. int16_t UseNodes; // the flexible way
  231. laRackPage* Rack;
  232. real LastX,LastY,LastAngle;
  233. real EvalColor[3];
  234. real EvalOffset[2];
  235. real EvalSize;
  236. real EvalDabsPerSize;
  237. real EvalHardness;
  238. real EvalTransparency;
  239. real EvalSmudge;
  240. real EvalSmudgeLength;
  241. real EvalSlender;
  242. real EvalAngle;
  243. real EvalForce, EvalGunkyness;
  244. real EvalAccumulation;
  245. real EvalSpeed;
  246. real EvalStrokeLength;
  247. real EvalStrokeLengthAccum;
  248. real EvalPressure;
  249. real EvalPosition[2];
  250. real EvalTilt[2];
  251. real EvalTwist;
  252. real EvalStrokeAngle;
  253. int EvalIsEraser;
  254. int EvalRepeats;
  255. int EvalDiscard;
  256. };
  257. STRUCTURE(OurDab){
  258. float X,Y;
  259. float Size;
  260. float Hardness;
  261. float Smudge; int ResampleSmudge;
  262. float Color[4];
  263. float Slender;
  264. float Angle;
  265. float Direction[2];
  266. float Force;
  267. float Gunkyness;
  268. float Recentness;
  269. float Accumulation;
  270. };
  271. STRUCTURE(OurPigmentData){
  272. real Reflectance[16];
  273. real Absorption[16];
  274. real PreviewColor[3][4];
  275. };
  276. STRUCTURE(OurBrushData140){
  277. float Reflectance[64];
  278. float Absorption[64];
  279. };
  280. STRUCTURE(OurPigmentData140){
  281. float Reflectance[64];
  282. float Absorption[64];
  283. float PaperReflectance[64];
  284. float PaperAbsorption[64];
  285. };
  286. STRUCTURE(OurPigment){
  287. laListItem Item;
  288. laSafeString* Name;
  289. OurPigmentData Pigment;
  290. };
  291. STRUCTURE(OurLight){
  292. laListItem Item;
  293. laSafeString* Name;
  294. OurPigmentData Emission;
  295. };
  296. STRUCTURE(OurCanvasSurface){
  297. laListItem Item;
  298. laSafeString* Name;
  299. OurPigmentData Reflectance;
  300. };
  301. NEED_STRUCTURE(OurColorPalette);
  302. STRUCTURE(OurColorItem){
  303. laListItem Item;
  304. OurPigmentData Pigment;
  305. int IsPigment;
  306. OurColorPalette* Parent;
  307. };
  308. STRUCTURE(OurColorPalette){
  309. laListItem Item;
  310. laSafeString* Name;
  311. laListHandle Colors;
  312. };
  313. STRUCTURE(OurUndoTile){
  314. laListItem Item;
  315. int col,row;
  316. OUR_PIX_COMPACT* CopyData;
  317. int l,r,u,b;
  318. };
  319. STRUCTURE(OurUndo){
  320. OurLayer* Layer;
  321. laListHandle Tiles;
  322. };
  323. STRUCTURE(OurMoveUndo){
  324. OurLayer* Layer;
  325. int dx,dy;
  326. };
  327. #define OUR_TOOL_PAINT 0
  328. #define OUR_TOOL_CROP 1
  329. #define OUR_TOOL_MOVE 2
  330. #define OUR_PNG_READ_INPUT_FLAT 0
  331. #define OUR_PNG_READ_INPUT_ICC 1
  332. #define OUR_PNG_READ_INPUT_SRGB 2
  333. #define OUR_PNG_READ_INPUT_LINEAR_SRGB 3
  334. #define OUR_PNG_READ_INPUT_CLAY 4
  335. #define OUR_PNG_READ_INPUT_LINEAR_CLAY 5
  336. #define OUR_PNG_READ_INPUT_D65_P3 6
  337. #define OUR_PNG_READ_INPUT_LINEAR_D65_P3 7
  338. #define OUR_PNG_READ_OUTPUT_CANVAS 0
  339. #define OUR_PNG_READ_OUTPUT_LINEAR_SRGB OUR_PNG_READ_INPUT_LINEAR_SRGB
  340. #define OUR_PNG_READ_OUTPUT_LINEAR_CLAY OUR_PNG_READ_INPUT_LINEAR_CLAY
  341. #define OUR_PNG_READ_OUTPUT_LINEAR_D65_P3 OUR_PNG_READ_INPUT_LINEAR_D65_P3
  342. #define OUR_CANVAS_INTERPRETATION_SRGB 0
  343. #define OUR_CANVAS_INTERPRETATION_CLAY 1
  344. #define OUR_CANVAS_INTERPRETATION_D65_P3 2
  345. #define OUR_EXPORT_BIT_DEPTH_8 0
  346. #define OUR_EXPORT_BIT_DEPTH_16 1
  347. #define OUR_EXPORT_COLOR_MODE_SRGB 0
  348. #define OUR_EXPORT_COLOR_MODE_CLAY 1
  349. #define OUR_EXPORT_COLOR_MODE_FLAT 2
  350. #define OUR_EXPORT_COLOR_MODE_D65_P3 3
  351. #define OUR_BRUSH_PAGE_LIST 128
  352. STRUCTURE(OurPNGReadExtra){
  353. int Confirming;
  354. laSafeString* FilePath;
  355. laSafeString* iccName;
  356. int HassRGB;
  357. int HasProfile;
  358. int InputMode;
  359. int OutputMode;
  360. int Offsets[2];
  361. };
  362. STRUCTURE(OurPNGWriteExtra){
  363. int Confirming;
  364. laSafeString* FilePath;
  365. int BitDepth;
  366. int ColorProfile;
  367. int Transparent;
  368. int PigmentConversionMethod;
  369. int CropX,CropY,CropW,CropH;
  370. };
  371. STRUCTURE(OurThreadExportPNGData){
  372. uint32_t* r_sizes;
  373. void** pointers;
  374. int i;
  375. int segy,h;
  376. int fail;
  377. };
  378. typedef void (*our_XYZ2RGBFunc)(tnsVector3d xyz, tnsVector3d rgb);
  379. typedef void (*our_2LogRGBFunc)(tnsVector3d rgb);
  380. STRUCTURE(OurPigmentConversionData){
  381. int RowStart,RowCount;
  382. int cols;
  383. uint16_t *ImageConversionBuffer;
  384. our_XYZ2RGBFunc XYZ2RGB;
  385. };
  386. NEED_STRUCTURE(OurThreadImportPNGDataMain);
  387. STRUCTURE(OurThreadImportPNGData){
  388. OurThreadImportPNGDataMain* main;
  389. void* data;
  390. OurLayer* l;
  391. int starty;
  392. };
  393. STRUCTURE(OurThreadImportPNGDataMain){
  394. OurThreadImportPNGData* data;
  395. int next,max;
  396. SYSLOCK lock;
  397. };
  398. STRUCTURE(OurUsePigment){
  399. laListItem Item;
  400. OurPigment* pigment;
  401. };
  402. STRUCTURE(BrushUniforms){
  403. GLint uCanvasType;
  404. GLint uCanvasRandom;
  405. GLint uCanvasFactor;
  406. GLint uImageOffset;
  407. GLint uBrushCorner;
  408. GLint uBrushCenter;
  409. GLint uBrushSize;
  410. GLint uBrushHardness;
  411. GLint uBrushSmudge;
  412. GLint uBrushRecentness;
  413. GLint uBrushColor;
  414. GLint uBrushSlender;
  415. GLint uBrushAngle;
  416. GLint uBrushDirection;
  417. GLint uBrushForce;
  418. GLint uBrushGunkyness;
  419. GLint uBrushRoutineSelection;
  420. GLint uBrushRoutineSelectionES;
  421. GLint uMixRoutineSelection;
  422. GLint uMixRoutineSelectionES;
  423. GLint uBrushErasing;
  424. GLint uBrushMix;
  425. GLint RoutineDoDabs;
  426. GLint RoutineDoSample;
  427. GLint RoutineDoMixNormal;
  428. GLint RoutineDoMixSpectral;
  429. GLint uBlendMode;
  430. GLint uAlphaTop;
  431. GLint uAlphaBottom;
  432. GLsizei SubroutineUniformLocations;
  433. GLint uMixingTop;
  434. };
  435. STRUCTURE(OurPaint){
  436. real pad;
  437. laListHandle CanvasSaverDummyList;
  438. laProp* CanvasSaverDummyProp;
  439. laListHandle BadEvents;
  440. tnsImage* SplashImage;
  441. tnsImage* SplashImageHigh;
  442. laListHandle Palettes;
  443. OurColorPalette* CurrentPalette;
  444. laListHandle Layers;
  445. OurLayer* CurrentLayer;
  446. laListHandle Brushes;
  447. OurBrush* CurrentBrush;
  448. laListHandle Pigments;
  449. OurPigment* CurrentPigment;
  450. laListHandle Lights;
  451. laListHandle CanvasSurfaces;
  452. real SaveBrushSize,SaveEraserSize;
  453. OurDab* Dabs; int NextDab,MaxDab;
  454. float LastBrushCenter[2];
  455. int CanvasVersion;
  456. laSafeString* Notes;
  457. real Smoothness,Hardness;
  458. real LastX, LastY;
  459. real CurrentScale;
  460. real DefaultScale;
  461. int BrushNumber;
  462. real BrushBaseSize;
  463. real BrushSize;
  464. int BrushPage;
  465. int Tool,ActiveTool,Erasing,EventErasing,BrushMix;
  466. int LockBackground;
  467. int BackgroundType;
  468. int BackgroundRandom;
  469. real BackgroundFactor;
  470. int PenID,EraserID;
  471. int X,Y,W,H; //border
  472. real BorderFadeWidth;
  473. int ColorInterpretation;
  474. int ShowBorder,UseBorder;
  475. int ShowTiles;
  476. int BrushCircleTiltMode;
  477. int AllowNonPressure,PaintProcessedEvents;
  478. int BadEventsLimit,BadEventCount,BadEventsGiveUp;
  479. int EnableBrushCircle,ShowBrushName,ShowBrushNumber;
  480. int EventHasTwist; real EventTwistAngle; real EventTiltOrientation;
  481. int DefaultBitDepth;
  482. int DefaultColorProfile;
  483. int PaintUndoLimit;
  484. int SpectralMode;
  485. int PigmentMode;
  486. int BrushNumbersOnHeader;
  487. int MixModeOnHeader;
  488. int ToolsOnHeader;
  489. int UndoOnHeader;
  490. int LightsOnHeader;
  491. int SketchMode;
  492. int SegmentedWrite;
  493. int PigmentDisplayMethod;
  494. int PaletteInColorsPanel;
  495. int DefaultCanvasType;
  496. tnsTexture* SmudgeTexture;
  497. GLuint CanvasShader; GLuint CanvasProgram;
  498. GLuint CanvasStraightShader; GLuint CanvasStraightProgram;
  499. GLuint CanvasPigmentShader; GLuint CanvasPigmentProgram;
  500. GLuint CompositionShader; GLuint CompositionProgram;
  501. GLuint CompositionStraightShader; GLuint CompositionStraightProgram;
  502. GLuint LayerShader; GLuint LayerProgram;
  503. GLuint DisplayShader; GLuint DisplayProgram;
  504. GLuint PigmentCompositionShader; GLuint PigmentCompositionProgram;
  505. GLuint PigmentLayeringShader; tnsShader* PigmentLayeringProgramT;
  506. GLuint PigmentDisplayShader; tnsShader* PigmentDisplayProgramT;
  507. GLuint uPigmentFragOffset,uPigmentTextureScale,uPigmentDisplayMode;
  508. GLint uboBrushPigment,uboBrushPigmentLocation;
  509. GLint uboCanvasPigment,uboCanvasPigmentLocation;
  510. BrushUniforms *u,uRGBA,uRGBStraightA,uPigment;
  511. int AlphaMode;
  512. int ReorderPigmnets;
  513. OurCanvasSurface *CanvasSurface; // not ptr to list
  514. OurLight *CanvasLight;
  515. OurPigmentData PickedPigment;
  516. OurPigmentData MixedPigment;
  517. laListHandle UsePigments;
  518. OurPigment* UseWhite;
  519. OurPigment* UseBlack;
  520. real CurrentColor[3];
  521. real BackgroundColor[3];
  522. uint16_t BColorU16[4];
  523. uint8_t BColorU8[4];
  524. real BorderAlpha;
  525. int ShowStripes;
  526. int ShowGrid;
  527. int ShowRef;
  528. int RefSize;
  529. int RefCategory;
  530. int RefOrientation;
  531. int RefCutHalf;
  532. real RefMargins[3],RefPaddings[2];
  533. int RefBiases[2];
  534. real RefAlpha;
  535. real xmin,xmax,ymin,ymax; // stroke bbox for undo region
  536. int ResetBrush;
  537. int SaveFailed;
  538. int FileRegistered;
  539. uint16_t *ImageBuffer;
  540. int ImageW,ImageH,ImageX,ImageY,LoadX,LoadY,TempLoadX,TempLoadY;
  541. uint8_t* ThumbnailBuffer;
  542. void* icc_LinearsRGB; int iccsize_LinearsRGB;
  543. void* icc_LinearClay; int iccsize_LinearClay;
  544. void* icc_LinearD65P3; int iccsize_LinearD65P3;
  545. void* icc_sRGB; int iccsize_sRGB;
  546. void* icc_Clay; int iccsize_Clay;
  547. void* icc_D65P3; int iccsize_D65P3;
  548. void* ProofTablesRGB, *ProofTableClay, *ProofTableD65;
  549. };
  550. int ourProcessInitArgs(int argc, char* argv[]);
  551. int ourInit();
  552. void ourFinalize();
  553. void ourRegisterNodes();
  554. int ourRebuildBrushEval();
  555. int ourEvalBrush();
  556. void ourMakeTranslations_zh_hans();
  557. void ourMakeTranslations_es_ES();
  558. void our_EnableSplashPanel();