@@ -202,22 +202,6 @@ main(
202
202
203
203
bcm_host_init ();
204
204
205
- //-------------------------------------------------------------------
206
- //
207
- // When the display is rotate (either 90 or 270 degrees) we need to
208
- // swap the width and height of the snapshot
209
- //
210
-
211
- char response [1024 ];
212
- int displayRotated = 0 ;
213
-
214
- if (vc_gencmd (response , sizeof (response ), "get_config int" ) == 0 )
215
- {
216
- vc_gencmd_number_property (response ,
217
- "display_rotate" ,
218
- & displayRotated );
219
- }
220
-
221
205
//-------------------------------------------------------------------
222
206
223
207
if (delay )
@@ -279,14 +263,14 @@ main(
279
263
}
280
264
281
265
//-------------------------------------------------------------------
282
- // only need to check low bit of displayRotated (value of 1 or 3).
266
+ // only need to check low bit of modeInfo.transform (value of 1 or 3).
283
267
// If the display is rotated either 90 or 270 degrees (value 1 or 3)
284
268
// the width and height need to be transposed.
285
269
286
270
int32_t dmxWidth = pngWidth ;
287
271
int32_t dmxHeight = pngHeight ;
288
272
289
- if (displayRotated & 1 )
273
+ if (modeInfo . transform & 1 )
290
274
{
291
275
dmxWidth = pngHeight ;
292
276
dmxHeight = pngWidth ;
@@ -370,11 +354,11 @@ main(
370
354
int32_t dmxXoffset = 0 ;
371
355
int32_t dmxYoffset = 0 ;
372
356
373
- switch (displayRotated & 3 )
357
+ switch (modeInfo . transform & 3 )
374
358
{
375
359
case 0 : // 0 degrees
376
360
377
- if (displayRotated & 0x20000 ) // flip vertical
361
+ if (modeInfo . transform & 0x20000 ) // flip vertical
378
362
{
379
363
dmxYoffset = (dmxHeight - j - 1 ) * dmxPitch ;
380
364
}
@@ -388,7 +372,7 @@ main(
388
372
case 1 : // 90 degrees
389
373
390
374
391
- if (displayRotated & 0x20000 ) // flip vertical
375
+ if (modeInfo . transform & 0x20000 ) // flip vertical
392
376
{
393
377
dmxXoffset = j * dmxBytesPerPixel ;
394
378
}
@@ -401,7 +385,7 @@ main(
401
385
402
386
case 2 : // 180 degrees
403
387
404
- if (displayRotated & 0x20000 ) // flip vertical
388
+ if (modeInfo . transform & 0x20000 ) // flip vertical
405
389
{
406
390
dmxYoffset = j * dmxPitch ;
407
391
}
@@ -414,7 +398,7 @@ main(
414
398
415
399
case 3 : // 270 degrees
416
400
417
- if (displayRotated & 0x20000 ) // flip vertical
401
+ if (modeInfo . transform & 0x20000 ) // flip vertical
418
402
{
419
403
dmxXoffset = (dmxWidth - j - 1 ) * dmxBytesPerPixel ;
420
404
}
@@ -433,11 +417,11 @@ main(
433
417
+ (i * pngBytesPerPixel )
434
418
+ (j * pngPitch );
435
419
436
- switch (displayRotated & 3 )
420
+ switch (modeInfo . transform & 3 )
437
421
{
438
422
case 0 : // 0 degrees
439
423
440
- if (displayRotated & 0x10000 ) // flip horizontal
424
+ if (modeInfo . transform & 0x10000 ) // flip horizontal
441
425
{
442
426
dmxXoffset = (dmxWidth - i - 1 ) * dmxBytesPerPixel ;
443
427
}
@@ -450,7 +434,7 @@ main(
450
434
451
435
case 1 : // 90 degrees
452
436
453
- if (displayRotated & 0x10000 ) // flip horizontal
437
+ if (modeInfo . transform & 0x10000 ) // flip horizontal
454
438
{
455
439
dmxYoffset = (dmxHeight - i - 1 ) * dmxPitch ;
456
440
}
@@ -463,7 +447,7 @@ main(
463
447
464
448
case 2 : // 180 degrees
465
449
466
- if (displayRotated & 0x10000 ) // flip horizontal
450
+ if (modeInfo . transform & 0x10000 ) // flip horizontal
467
451
{
468
452
dmxXoffset = i * dmxBytesPerPixel ;
469
453
}
@@ -476,7 +460,7 @@ main(
476
460
477
461
case 3 : // 270 degrees
478
462
479
- if (displayRotated & 0x10000 ) // flip horizontal
463
+ if (modeInfo . transform & 0x10000 ) // flip horizontal
480
464
{
481
465
dmxYoffset = i * dmxPitch ;
482
466
}
0 commit comments