comparison src/Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.cc @ 127:acb14b11225f

- Linux build for cairo module
author tomwalters
date Sun, 24 Oct 2010 22:35:49 +0000
parents a9cb396529c2
children 48e5fc566441
comparison
equal deleted inserted replaced
126:a9cb396529c2 127:acb14b11225f
29 #include <sys/types.h> 29 #include <sys/types.h>
30 #include <sys/stat.h> 30 #include <sys/stat.h>
31 #include <string.h> 31 #include <string.h>
32 #include <stdio.h> 32 #include <stdio.h>
33 #include <math.h> 33 #include <math.h>
34 34 #include <limits.h>
35 #include "cairo-quartz.h" 35
36 //#include "cairo-quartz.h"
36 37
37 #include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h" 38 #include "Modules/Output/Graphics/Devices/GraphicsOutputDeviceCairo.h"
38 39
39 namespace aimc { 40 namespace aimc {
40 41
82 m_iHeight = parameters_->DefaultInt("output.img.height", 600); 83 m_iHeight = parameters_->DefaultInt("output.img.height", 600);
83 84
84 // Cairo's RGB24 format has 32-bit pixels with the upper 8 bits unused. 85 // Cairo's RGB24 format has 32-bit pixels with the upper 8 bits unused.
85 // This is not the same as the plotutils PNG format. This information is transferred by the 86 // This is not the same as the plotutils PNG format. This information is transferred by the
86 // function GetPixelFormat. The pixel format is dealt with by the reciever. 87 // function GetPixelFormat. The pixel format is dealt with by the reciever.
87 m_cSurface = cairo_quartz_surface_create(CAIRO_FORMAT_RGB24, 88 m_cSurface = cairo_image_surface_create(CAIRO_FORMAT_RGB24,
88 m_iWidth, 89 m_iWidth,
89 m_iHeight); 90 m_iHeight);
90 m_cCr = cairo_create(m_cSurface); 91 m_cCr = cairo_create(m_cSurface);
91 cairo_scale(m_cCr, (float)m_iWidth, (float)m_iHeight); 92 cairo_scale(m_cCr, (float)m_iWidth, (float)m_iHeight);
92 // Now setup things for this plotter. 93 // Now setup things for this plotter.