171 if (cx >= 0 && cx < fCols && cy >= 0 && cy <
fRows) {
198 if (cx >= 0 && cx < fCols && cy >= 0 && cy <
fRows) {
224 gVirtualX->LookupString(event, input,
sizeof(input), keysym);
235 if (cx <
fCols - 1) ++cx;
243 if (cy <
fRows - 1) ++cy;
259 if (cx !=
fCx || cy !=
fCy) {
333 for (i = 0; i <
fRows; ++i) {
335 for (j = 0; j <
fCols; ++j) {
369 if (
fCx >= 0 &&
fCy >= 0) {
531 for (i = 0; i < 64; ++i) {
532 Int_t cc[4] = { 0, 21845, 43691, 65535 };
534 color.
fRed = cc[i & 0x3];
535 color.
fGreen = cc[(i >> 2) & 0x3];
536 color.
fBlue = cc[(i >> 4) & 0x3];
552 for (i = 0; i < 27; ++i) {
553 Int_t cc[3] = { 0, 32768, 65535 };
555 color.
fRed = cc[i % 3];
556 color.
fGreen = cc[(i / 3) % 3];
557 color.
fBlue = cc[(i / 9) % 3];
573 for (i = 0; i < 8; ++i) {
575 color.
fRed = (i & 1) * 65535;
576 color.
fGreen = ((i >> 1) & 1) * 65535;
577 color.
fBlue = ((i >> 2) & 1) * 65535;
595 for (i = 0; i < 8; ++i) {
597 color.
fRed = (i & 1) * 65535;
598 color.
fGreen = ((i >> 1) & 1) * 65535;
599 color.
fBlue = ((i >> 2) & 1) * 65535;
629 const Int_t kWidth = 20;
632 struct {
Int_t r,
g,
b; } ed[kWidth], ef;
641 for (
x = 0;
x < iw; ++
x) {
642 ed[
x].r = ed[
x].g = ed[
x].b = 0;
647 for (
y = 0;
y < ih; ++
y) {
651 for (
x = 0;
x < iw; ++
x) {
655 s = (ih -
y) * 255 / ih;
664 }
else if (which ==
kIMG_L) {
669 Int_t ll = (ih -
y) * 255 / ih;
673 for (
x = 0;
x < iw; ++
x) {
685 ef.r = ef.g = ef.b = 0;
687 for (
x = 0;
x < iw; ++
x) {
692 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
696 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
700 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
705 for (
x = 0;
x < iw; ++
x) {
710 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
713 v =
line[
x].fGreen + ef.g;
714 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
718 if (
v < 0)
v = 0;
else if (
v > 255)
v = 255;
723 sdist = 255L * 255L * 255L;
730 dist = dr * dr + dg * dg + db * db;
740 e[0] = (7 * v) >> 4; \
742 e[2] = (5 * v) >> 4; \
749 if (
x < iw-1) ed[
x+1].r =
e[1];
750 if (
x == 0) ed[
x].r =
e[2];
else ed[
x].r +=
e[2];
751 if (
x > 0) ed[
x-1].r +=
e[3];
757 if (
x < iw-1) ed[
x+1].g =
e[1];
758 if (
x == 0) ed[
x].g =
e[2];
else ed[
x].g +=
e[2];
759 if (
x > 0) ed[
x-1].g +=
e[3];
765 if (
x < iw-1) ed[
x+1].b =
e[1];
766 if (
x == 0) ed[
x].b =
e[2];
else ed[
x].b +=
e[2];
767 if (
x > 0) ed[
x-1].b +=
e[3];
789 for (
Int_t y = 0;
y < height; ++
y) {
795 s = (height -
y) * 255 / height;
827 for (
Int_t y = 0;
y < height; ++
y) {
832 l = (height -
y) * 255 / height;
888 l =
Int_t((lheight -
fCz) * 255 / lheight);
889 s =
Int_t((sheight -
fCy) * 255 / sheight);
1001 x =
fCx - 9; w = 19;
1002 y =
fCy - 9;
h = 19;
1004 if (
x < 0) { w +=
x;
x = 0; }
1005 if (
y < 0) {
h +=
y;
y = 0; }
1008 if (
y +
h > height)
h = height -
y;
1051 const Int_t kC_X = 175;
1052 const Int_t kC_Y = 180;
1157 wcan->
Connect(
"ProcessedEvent(Int_t,Int_t,Int_t,TObject*)",
"TGColorDialog",
this,
1158 "SetColorInfo(Int_t,Int_t,Int_t,TObject*)");
1180 for (i = 0; i < 48; ++i)
1231 if (
gUcolor[0] == 0xff000000) {
1232 for (i = 0; i < 24; i++)
1344 Emit(
"ColorSelected(Pixel_t)", color);
1352 Emit(
"AlphaColorSelected(ULong_t)", color);
1361 for (
Int_t i = 0; i < 24; ++i)
1392 alpha = color->GetAlpha();
const Mask_t kFocusChangeMask
const Mask_t kButtonPressMask
const Mask_t kKeyReleaseMask
const Mask_t kAnyModifier
const Mask_t kKeyPressMask
const Mask_t kPointerMotionMask
const Mask_t kLeaveWindowMask
const Mask_t kStructureNotifyMask
const Mask_t kButtonReleaseMask
const Mask_t kEnterWindowMask
include TDocParser_001 C image html pict1_TDocParser_001 png width
static ULong_t gUcolor[24]
char * Form(const char *fmt,...)
void DeleteCanvasPainter()
assert on IsBatch() == false?
static Bool_t SupportAlpha()
Static function returning "true" if transparency is supported.
virtual void Update()
Update canvas pad buffers.
Draw the ROOT Color Wheel.
virtual void Draw(Option_t *option="")
Paint the color wheel.
virtual void SetCanvas(TCanvas *can)
virtual Int_t GetColor(Int_t px, Int_t py) const
Return the color number pointed by the mouse.
The color creation and management class.
static void HLS2RGB(Float_t h, Float_t l, Float_t s, Float_t &r, Float_t &g, Float_t &b)
Static method to compute RGB from HLS.
static ULong_t RGB2Pixel(Int_t r, Int_t g, Int_t b)
Convert r,g,b to graphics system dependent pixel value.
static ULong_t Number2Pixel(Int_t ci)
Static method that given a color index number, returns the corresponding pixel value.
static Int_t GetColor(const char *hexcolor)
Static method returning color number for color specified by hex color string of form: "#rrggbb",...
static void Pixel2RGB(ULong_t pixel, Int_t &r, Int_t &g, Int_t &b)
Convert machine dependent pixel value (obtained via RGB2Pixel or via Number2Pixel() or via TColor::Ge...
ULong_t GetPixel() const
Return pixel value corresponding to this color.
virtual void SetAlpha(Float_t a)
static void RGB2HLS(Float_t r, Float_t g, Float_t b, Float_t &h, Float_t &l, Float_t &s)
Static method to compute HLS from RGB.
Bool_t IsEditable() const
const TGWindow * GetRoot() const
Returns current root (i.e.
void WaitForUnmap(TGWindow *w)
Wait for window to be unmapped.
const TGResourcePool * GetResourcePool() const
TGColorPalette * fPalette
virtual void SetCurrentColor(Pixel_t col)
Change current color.
void DoPreview()
Slot method called when Preview button is clicked.
virtual void CloseWindow()
Called when window is closed via window manager.
TColorWheel * fColorWheel
TGColorDialog(const TGColorDialog &)
void SetColorInfo(Int_t event, Int_t px, Int_t py, TObject *selected)
Set the color info in RGB and HLS parts.
TRootEmbeddedCanvas * fEcanvas
TGColorPalette * fCpalette
virtual void ColorSelected(Pixel_t)
Emit signal about selected color.
virtual Bool_t ProcessMessage(Long_t msg, Long_t parm1, Long_t parm2)
Process messages for the color selection dialog.
void UpdateRGBentries(Pixel_t *c)
Update RGB text entries with RGB values of color c.
void UpdateHLSentries(Pixel_t *c)
Update HLS text entries with HLS values of color c.
virtual ~TGColorDialog()
TGColorDialog destructor.
void UpdateAlpha(Pixel_t *c)
Upadate Opacity text entry with alpha value of color c.
virtual void AlphaColorSelected(ULong_t)
Emit signal about selected alpha and color.
virtual Bool_t HandleKey(Event_t *event)
Handle keyboard events in color palette.
void SetCellSize(Int_t w=20, Int_t h=17)
Set color cell size.
TGColorPalette(const TGColorPalette &)
virtual ~TGColorPalette()
Destructor.
virtual Bool_t HandleButton(Event_t *event)
Handle button events in color palette.
void SetColors(Pixel_t colors[])
Set color entries in color samples.
virtual void DoRedraw()
Redraw color palette.
Pixel_t GetColorByIndex(Int_t ix) const
virtual void LostFocus()
Remove keyboard input.
Pixel_t GetCurrentColor() const
Return currently selected color value.
void SetCurrentCellColor(Pixel_t color)
Set current cell color.
void DrawFocusHilite(Int_t onoff)
Draw a highlight rectangle around cell obtaining focus.
virtual void GotFocus()
Add keyboard input.
void SetColor(Int_t ix, Pixel_t color)
Set color at index ix of color entries.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events in color palette.
virtual void ColorSelected(Pixel_t col=0)
void SetLcursor(Int_t z)
Set lightness slider cursor position.
void UpdateCurrentColor()
Assign the current cursor position as currently selected color.
virtual Bool_t HandleMotion(Event_t *event)
Handle mouse motion events in color pick widget.
virtual ~TGColorPick()
TGColorPick destructor.
void CreateImages()
Create colormap and color slider images.
void SetColor(Pixel_t color)
Position the slider cursor on right color position.
virtual void ColorSelected(Pixel_t col=0)
void SetSliderColor()
Set slider colors.
void AllocColors()
Try to allocate first a palette of 64 colors.
Rectangle_t fColormapRect
TGColorPick(const TGWindow *p=0, Int_t w=1, Int_t h=1, Int_t id=-1)
TGColorPick constructor.
void FreeColors()
Free allocated colors.
Pixel_t GetCurrentColor() const
void DrawHScursor(Int_t onoff)
Draw hue / saturation cursor.
virtual Bool_t HandleButton(Event_t *event)
Handle mouse button events in color pick widget.
void CreateDitheredImage(Pixmap_t image, Int_t which)
Create a dithered version of the color map and lightness images for display modes with reduced number...
void DrawLcursor(Int_t onoff)
Draw lightness slider cursor.
virtual void DoRedraw()
Redraw the color pick widget.
void InitImages()
Initialize color palette and slider images.
void SetHScursor(Int_t x, Int_t y)
Set hue / saturation cursor position.
virtual void SetLayoutManager(TGLayoutManager *l)
Set the layout manager for the composite frame.
TGCompositeFrame(const TGCompositeFrame &)
virtual void AddFrame(TGFrame *f, TGLayoutHints *l=0)
Add frame to the composite frame using the specified layout hints.
virtual void Cleanup()
Cleanup and delete all objects contained in this composite frame.
virtual void SetCleanup(Int_t mode=kLocalCleanup)
Turn on automatic cleanup of child frames in dtor.
virtual TGDimension GetDefaultSize() const
std::cout << fWidth << "x" << fHeight << std::endl;
virtual void MapSubwindows()
Map all sub windows that are part of the composite frame.
virtual UInt_t GetDefaultHeight() const
virtual void SetEditDisabled(UInt_t on=1)
Set edit disable flag for this frame and subframes.
void AddInput(UInt_t emask)
Add events specified in the emask to the events the frame should handle.
void RemoveInput(UInt_t emask)
Remove events specified in emask from the events the frame should handle.
virtual UInt_t GetDefaultWidth() const
virtual UInt_t GetDefaultHeight() const
virtual void DrawBorder()
Draw frame border.
virtual void Draw3dRectangle(UInt_t type, Int_t x, Int_t y, UInt_t w, UInt_t h)
Draw 3D rectangle on the frame border.
virtual void SetBackgroundColor(Pixel_t back)
Set background color (override from TGWindow base class).
virtual void SendMessage(const TGWindow *w, Long_t msg, Long_t parm1, Long_t parm2)
Send message (i.e.
static Pixel_t GetDefaultFrameBackground()
Get default frame background.
virtual void DeleteWindow()
Delete window.
static const TGGC & GetShadowGC()
Get shadow color graphics context.
virtual void Resize(UInt_t w=0, UInt_t h=0)
Resize the frame.
virtual Pixel_t GetBackground() const
static const TGGC & GetBckgndGC()
Get background color graphics context.
virtual void UnmapWindow()
void SetForeground(Pixel_t v)
Set foreground color.
void SetTextJustify(Int_t tmode)
Set text justification.
virtual void SetText(TGString *newText)
Set new text in label.
void SetClassHints(const char *className, const char *resourceName)
Set the windows class and resource name.
void SetIconName(const char *name)
Set window icon name. This is typically done via the window manager.
void SetWMSize(UInt_t w, UInt_t h)
Give the window manager a window size hint.
void SetMWMHints(UInt_t value, UInt_t funcs, UInt_t input)
Set decoration style for MWM-compatible wm (mwm, ncdwm, fvwm?).
void SetWMSizeHints(UInt_t wmin, UInt_t hmin, UInt_t wmax, UInt_t hmax, UInt_t winc, UInt_t hinc)
Give the window manager minimum and maximum size hints.
void SetWindowName(const char *name=0)
Set window name. This is typically done via the window manager.
const TGGC * GetFrameGC() const
virtual TGCompositeFrame * AddTab(TGString *text)
Add a tab to the tab widget.
void AddText(Int_t pos, const char *text)
const char * GetString() const
void SetEnabled(Bool_t flag=kTRUE)
const TGWindow * GetMain() const
virtual void CenterOnParent(Bool_t croot=kTRUE, EPlacement pos=kCenter)
Position transient frame centered relative to the parent frame.
virtual const char * GetName() const
Returns name of object.
Mother of all ROOT objects.
R__ALWAYS_INLINE Bool_t IsZombie() const
void SetBit(UInt_t f, Bool_t set)
Set or unset the user status bits as specified in f.
virtual Bool_t InheritsFrom(const char *classname) const
Returns kTRUE if object inherits from class "classname".
@ kNoContextMenu
if object does not want context menu
void Emit(const char *signal, const T &arg)
Activate signal with single parameter.
Bool_t Connect(const char *signal, const char *receiver_class, void *receiver, const char *slot)
Non-static method is used to connect from the signal of this object to the receiver slot.
Bool_t Disconnect(const char *signal=0, void *receiver=0, const char *slot=0)
Disconnects signal of this object from slot of receiver.
TCanvas * GetCanvas() const
int main(int argc, char **argv)
double dist(Rotation3D const &r1, Rotation3D const &r2)
static constexpr double s
Short_t Max(Short_t a, Short_t b)
Short_t Min(Short_t a, Short_t b)