98 |
|
|
99 |
loadBuiltInPix(); |
loadBuiltInPix(); |
100 |
|
|
101 |
// create gray blue hatched pattern |
// create blue hatched pattern |
102 |
{ |
{ |
103 |
const int width = grayBlueHatchedPattern->get_width(); |
const int width = blueHatchedPattern->get_width(); |
104 |
const int height = grayBlueHatchedPattern->get_height(); |
const int height = blueHatchedPattern->get_height(); |
105 |
const int stride = grayBlueHatchedPattern->get_rowstride(); |
const int stride = blueHatchedPattern->get_rowstride(); |
106 |
|
|
107 |
// manually convert from RGBA to ARGB |
// manually convert from RGBA to ARGB |
108 |
this->grayBlueHatchedPatternARGB = grayBlueHatchedPattern->copy(); |
this->blueHatchedPatternARGB = blueHatchedPattern->copy(); |
109 |
const int pixelSize = stride / width; |
const int pixelSize = stride / width; |
110 |
const int totalPixels = width * height; |
const int totalPixels = width * height; |
111 |
assert(pixelSize == 4); |
assert(pixelSize == 4); |
112 |
unsigned char* ptr = this->grayBlueHatchedPatternARGB->get_pixels(); |
unsigned char* ptr = this->blueHatchedPatternARGB->get_pixels(); |
113 |
for (int iPixel = 0; iPixel < totalPixels; ++iPixel, ptr += pixelSize) { |
for (int iPixel = 0; iPixel < totalPixels; ++iPixel, ptr += pixelSize) { |
114 |
const unsigned char r = ptr[0]; |
const unsigned char r = ptr[0]; |
115 |
const unsigned char g = ptr[1]; |
const unsigned char g = ptr[1]; |
122 |
} |
} |
123 |
|
|
124 |
Cairo::RefPtr<Cairo::ImageSurface> imageSurface = Cairo::ImageSurface::create( |
Cairo::RefPtr<Cairo::ImageSurface> imageSurface = Cairo::ImageSurface::create( |
125 |
this->grayBlueHatchedPatternARGB->get_pixels(), Cairo::FORMAT_ARGB32, width, height, stride |
this->blueHatchedPatternARGB->get_pixels(), Cairo::FORMAT_ARGB32, width, height, stride |
126 |
); |
); |
127 |
this->grayBlueHatchedSurfacePattern = Cairo::SurfacePattern::create(imageSurface); |
this->blueHatchedSurfacePattern = Cairo::SurfacePattern::create(imageSurface); |
128 |
this->grayBlueHatchedSurfacePattern->set_extend(Cairo::EXTEND_REPEAT); |
this->blueHatchedSurfacePattern->set_extend(Cairo::EXTEND_REPEAT); |
129 |
} |
} |
130 |
|
|
131 |
instrument = 0; |
instrument = 0; |
377 |
if (region == r) |
if (region == r) |
378 |
Gdk::Cairo::set_source_rgba(cr, blue); |
Gdk::Cairo::set_source_rgba(cr, blue); |
379 |
else if (modifyallregions) |
else if (modifyallregions) |
380 |
cr->set_source(grayBlueHatchedSurfacePattern); |
cr->set_source(blueHatchedSurfacePattern); |
381 |
else |
else |
382 |
Gdk::Cairo::set_source_rgba(cr, white); |
Gdk::Cairo::set_source_rgba(cr, white); |
383 |
|
|