@@ -1262,8 +1262,60 @@ namespace agg
1262
1262
};
1263
1263
1264
1264
1265
- }
1266
1265
1266
+ // ========================================================================
1267
+ struct span_rgb101010
1268
+ {
1269
+ // --------------------------------------------------------------------
1270
+ static void render (unsigned char * ptr,
1271
+ int x,
1272
+ unsigned count,
1273
+ const unsigned char * covers,
1274
+ const rgba8& c)
1275
+ {
1276
+ unsigned int * p = (unsigned int *)ptr + x;
1277
+ do
1278
+ {
1279
+ int alpha = (*covers++) * c.a ;
1280
+ int r = (*p >> 20 ) & 0x3ff ;
1281
+ int g = (*p >> 10 ) & 0x3ff ;
1282
+ int b = *p & 0x3ff ;
1283
+ int cr = c.r << 2 ;
1284
+ int cg = c.g << 2 ;
1285
+ int cb = c.b << 2 ;
1286
+ int dr = (((cr - r) * alpha) + (r << 16 )) >> 16 ;
1287
+ int dg = (((cg - g) * alpha) + (g << 16 )) >> 16 ;
1288
+ int db = (((cb - b) * alpha) + (b << 16 )) >> 16 ;
1289
+ *p++ = (dr << 20 ) | (dg << 10 ) | db;
1290
+ }
1291
+ while (--count);
1292
+ }
1293
+
1294
+ // --------------------------------------------------------------------
1295
+ static void hline (unsigned char * ptr,
1296
+ int x,
1297
+ unsigned count,
1298
+ const rgba8& c)
1299
+ {
1300
+ unsigned int * p = (unsigned int *)ptr + x;
1301
+ unsigned int c10 = (c.r << 22 ) | (c.g << 12 ) | (c.b << 2 );
1302
+ do { *p++ = c10; } while (--count);
1303
+ }
1304
+
1305
+ // --------------------------------------------------------------------
1306
+ static rgba8 get (unsigned char * ptr, int x)
1307
+ {
1308
+ unsigned int * p = (unsigned int *)ptr + x;
1309
+ rgba8 c;
1310
+ c.r = (*p >> 22 ) & 0xff ;
1311
+ c.g = (*p >> 12 ) & 0xff ;
1312
+ c.b = (*p >> 2 ) & 0xff ;
1313
+ c.a = 255 ;
1314
+ return c;
1315
+ }
1316
+ };
1317
+
1318
+ }
1267
1319
1268
1320
1269
1321
#endif
0 commit comments