*/}}

ourpaint.h 16 KB

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