@@ -39,7 +39,8 @@ RendererAgg::RendererAgg(unsigned int width, unsigned int height, double dpi)
39
39
rendererBase.clear (_fill_color);
40
40
rendererAA.attach (rendererBase);
41
41
rendererBin.attach (rendererBase);
42
- hatchRenderingBuffer.attach (hatchBuffer, HATCH_SIZE, HATCH_SIZE, HATCH_SIZE * 4 );
42
+ hatchRenderingBuffer.attach (
43
+ hatchBuffer, HATCH_SIZE, HATCH_SIZE, HATCH_SIZE * sizeof (color_type));
43
44
}
44
45
45
46
RendererAgg::~RendererAgg ()
@@ -95,34 +96,37 @@ void RendererAgg::tostring_rgb(uint8_t *buf)
95
96
agg::rendering_buffer renderingBufferTmp;
96
97
renderingBufferTmp.attach (buf, width, height, row_len);
97
98
98
- agg::color_conv (&renderingBufferTmp, &renderingBuffer , agg::color_conv_rgba32_to_rgb24 () );
99
+ agg::convert<agg::pixfmt_rgb24, pixfmt , agg::rendering_buffer>(&renderingBufferTmp, &renderingBuffer );
99
100
}
100
101
101
102
void RendererAgg::tostring_argb (uint8_t *buf)
102
103
{
103
104
// "Return the rendered buffer as an RGB string";
104
105
105
- int row_len = width * 4 ;
106
+ int row_len = width * sizeof (agg::rgba8) ;
106
107
107
108
agg::rendering_buffer renderingBufferTmp;
108
109
renderingBufferTmp.attach (buf, width, height, row_len);
109
- agg::color_conv (&renderingBufferTmp, &renderingBuffer, agg::color_conv_rgba32_to_argb32 ());
110
+
111
+ agg::convert<agg::pixfmt_argb32, pixfmt, agg::rendering_buffer>(&renderingBufferTmp, &renderingBuffer);
110
112
}
111
113
112
114
void RendererAgg::tostring_bgra (uint8_t *buf)
113
115
{
114
116
// "Return the rendered buffer as an RGB string";
115
117
116
- int row_len = width * 4 ;
118
+ int row_len = width * sizeof (agg::rgba8) ;
117
119
118
120
agg::rendering_buffer renderingBufferTmp;
119
121
renderingBufferTmp.attach (buf, width, height, row_len);
120
122
121
- agg::color_conv (&renderingBufferTmp, &renderingBuffer , agg::color_conv_rgba32_to_bgra32 () );
123
+ agg::convert<agg::pixfmt_bgra32, pixfmt , agg::rendering_buffer>(&renderingBufferTmp, &renderingBuffer );
122
124
}
123
125
124
126
agg::rect_i RendererAgg::get_content_extents ()
125
127
{
128
+ // TODO: This is most definitely broken
129
+
126
130
agg::rect_i r (width, height, 0 , 0 );
127
131
128
132
// Looks at the alpha channel to find the minimum extents of the image
0 commit comments