*/}}

ourpaint.h 17 KB

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