1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115
|
/************************************************************************/
/* */
/* Draw an RGB cube to allow the user to select colors. */
/* */
/************************************************************************/
# ifndef APP_RGB_CUBE_H
# define APP_RGB_CUBE_H
# include <bmcolor.h>
# include <appDraw.h>
# include <utilAffineTransform.h>
typedef struct RgbColorBlock
{
RGB8Color rcbRgbColor;
APP_COLOR_RGB rcbAllocatorColor;
int rcbColorAllocated;
double rcbX0;
double rcbY0;
double rcbZ0;
double rcbX1;
double rcbY1;
double rcbZ1;
double rcbZ;
} RgbColorBlock;
typedef struct RgbCube
{
int rcRedSteps;
int rcGreenSteps;
int rcBlueSteps;
int rcRedStep;
int rcGreenStep;
int rcBlueStep;
RGB8Color rcSplitValues;
RGB8Color rcBSplitValues;
int rcSplitColor; /* enum */
AffineTransform3D rcAt;
int rcColorBlockCount;
RgbColorBlock * rcColorBlocks;
AppColors rcColors;
APP_COLOR_RGB rcBackColor;
RGB8Color rcSelectedColor;
int rcColorSelected;
APP_COLOR_RGB rcAllocatedColor;
int rcColorAllocated;
} RgbCube;
typedef enum RgbCubeSplitColor
{
RCsplitNONE= 0,
RCsplitRED,
RCsplitGREEN,
RCsplitBLUE,
RCsplit_COUNT
} RgbCubeSplitColor;
/************************************************************************/
/* */
/* Routine declarations. */
/* */
/************************************************************************/
extern void appInitRgbCube( RgbCube * rc );
extern void appCleanRgbCube( RgbCube * rc );
extern void appRedrawRgbCube( RgbCube * rc,
int wide,
int high,
const DocumentRectangle * drClip,
AppDrawingData * add );
extern int appPrepareRgbCube( RgbCube * rc,
AppDrawingData * add,
int redSteps,
int greenSteps,
int blueSteps );
extern void appRotateRgbCube( RgbCube * rc,
int mouseX,
int mouseY,
int wide,
int high );
extern int appRgbCubeFindColor(RGB8Color * rgb8,
int * pOnOutside,
RgbCube * rc,
int mouseX,
int mouseY,
int wide,
int high );
extern void appRgbCubeSetSplit( RgbCube * rc,
int splitColor,
const RGB8Color * splitValues );
extern void appRgbCubeSelectColor( RgbCube * rc,
const RGB8Color * rgb8 );
extern void appRgbCubeRefreshSplit( RgbCube * rc,
const RGB8Color * rgb8 );
# endif
|