Krita Source Code Documentation
Loading...
Searching...
No Matches
Acs Namespace Reference

Classes

class  PixelCacheRenderer
 

Enumerations

enum  ColorRole { Foreground , Background }
 

Functions

ColorRole buttonsToRole (Qt::MouseButton button, Qt::MouseButtons buttons)
 
ColorRole buttonToRole (Qt::MouseButton button)
 
template<class ResourceProvider >
KoColor currentColor (ResourceProvider *provider, ColorRole role)
 
template<class PaintDeviceSP >
KoColor sampleColor (PaintDeviceSP device, const QPoint &pt)
 
template<class PaintDeviceSP >
void setColor (PaintDeviceSP device, const QPoint &pt, const KoColor &color)
 
template<class Iterator >
void setColorWithIterator (Iterator &it, const KoColor &color, const int pixelSize)
 
template<class ResourceProvider >
void setCurrentColor (ResourceProvider *provider, ColorRole role, const KoColor &color)
 

Enumeration Type Documentation

◆ ColorRole

Enumerator
Foreground 
Background 

Definition at line 16 of file kis_acs_types.h.

16{Foreground, Background};

Function Documentation

◆ buttonsToRole()

ColorRole Acs::buttonsToRole ( Qt::MouseButton button,
Qt::MouseButtons buttons )
inline

Definition at line 22 of file kis_acs_types.h.

22 {
23 return button == Qt::LeftButton || buttons & Qt::LeftButton ? Acs::Foreground : Acs::Background;
24 }
QString button(const QWheelEvent &ev)
QString buttons(const T &ev)
@ Background
@ Foreground

References Background, button(), buttons(), and Foreground.

◆ buttonToRole()

ColorRole Acs::buttonToRole ( Qt::MouseButton button)
inline

Definition at line 18 of file kis_acs_types.h.

18 {
19 return button == Qt::LeftButton ? Acs::Foreground : Acs::Background;
20 }

References Background, button(), and Foreground.

◆ currentColor()

template<class ResourceProvider >
KoColor Acs::currentColor ( ResourceProvider * provider,
ColorRole role )

Definition at line 36 of file kis_acs_types.h.

36 {
37 return role == Acs::Foreground ? provider->fgColor() : provider->bgColor();
38 }

References Foreground.

◆ sampleColor()

template<class PaintDeviceSP >
KoColor Acs::sampleColor ( PaintDeviceSP device,
const QPoint & pt )

Definition at line 41 of file kis_acs_types.h.

41 {
42 KoColor color;
43 if (device) {
44 (void) device->pixel(pt.x(), pt.y(), &color);
45 }
46 return color;
47 }
typedef void(QOPENGLF_APIENTRYP PFNGLINVALIDATEBUFFERDATAPROC)(GLuint buffer)

References void().

◆ setColor()

template<class PaintDeviceSP >
void Acs::setColor ( PaintDeviceSP device,
const QPoint & pt,
const KoColor & color )

Definition at line 50 of file kis_acs_types.h.

50 {
51 (void) device->setPixel(pt.x(), pt.y(), color);
52 }

References void().

◆ setColorWithIterator()

template<class Iterator >
void Acs::setColorWithIterator ( Iterator & it,
const KoColor & color,
const int pixelSize )

Definition at line 55 of file kis_acs_types.h.

55 {
56 memcpy(it.rawData(), color.data(), pixelSize);
57 }
quint8 * data()
Definition KoColor.h:144

References KoColor::data().

◆ setCurrentColor()

template<class ResourceProvider >
void Acs::setCurrentColor ( ResourceProvider * provider,
ColorRole role,
const KoColor & color )

Definition at line 27 of file kis_acs_types.h.

27 {
28 if (role == Acs::Foreground) {
29 provider->setFGColor(color);
30 } else {
31 provider->setBGColor(color);
32 }
33 }

References Foreground.