27 August 2014, 14:53 | #61 | |
Registered User
Join Date: Aug 2012
Location: Australia
Posts: 651
|
Quote:
|
|
27 August 2014, 14:56 | #62 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
I am sorry but my Browser does not show the chars of your reply correctly. The only thing I see are two Placeholders for unicode-characters, one reading "01f 44f" and the other "01f 44d".
|
27 August 2014, 19:12 | #63 |
AMOS Extensions Developer
Join Date: Jun 2007
Location: near Cambridge, UK
Age: 44
Posts: 1,924
|
|
27 August 2014, 19:16 | #64 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
My OS is Ubuntu Linux and my Firefox is versioned 29.0.
|
27 August 2014, 20:06 | #65 |
Registered User
Join Date: Feb 2013
Location: Argentina
Posts: 281
|
Work fine here. Windows 8 - Firefox 28.0
http://www.subeimagenes.com/img/sin-titulo-1071976.jpg |
27 August 2014, 20:12 | #66 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Probably that are rather new special chars only available in Windows. Thanks for the Translation.
|
27 August 2014, 20:55 | #67 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
it doesn't matter, we're not using it anymore
well as i say the maximum possible difference is only 1, you would need a very good monitor to see the difference. |
27 August 2014, 21:15 | #68 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
PeterK figured out that the spl and following lsr #8 eliminate each other. spl sets the low byte to either 0 or $ff and the lsr vanishes these 8 bits. So it really makes no difference.
|
27 August 2014, 21:30 | #69 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
Almost With integer arithmetic you always round towards 0, so you would have to add 255, and only when you have a negative operand, but it can be done branch-less with a couple of shifts and an add.
|
27 August 2014, 21:38 | #70 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
If you always want to round down, no adding is necessary, the problem there is it is not symmetric around zero, you might prefer to round negative numbers up instead. |
|
27 August 2014, 21:43 | #71 |
Join Date: Jul 2008
Location: Sweden
Posts: 2,269
|
With two's complement integer arithmetic we always want to round towards 0, so we only add 255 if we have a negative operand, and both -1/256 and 1/256 will become 0.
|
27 August 2014, 23:11 | #72 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
well you might always want to round towards 0, personally i find rounding to the nearest int quite pleasing
|
28 August 2014, 00:31 | #73 |
Registered User
Join Date: Aug 2012
Location: Australia
Posts: 651
|
|
29 August 2014, 20:13 | #74 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Ok, here is the pngflux.library to load and draw PNG images w/ alphachannel support:
http://eab.abime.net/showthread.php?t=74927 |
02 September 2014, 10:33 | #75 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
@Mrs Beanbag
Is this good? We multiply alpha with 257 and then divide by 65536 in a swap. Code:
calc_pixels ; apply ARGB data onto RGB data moveq #0,d0 ; image moveq #0,d1 ; screen moveq #0,d2 ; alpha move.w #255,d3 .loop move.b (a0)+,d2 ; get alpha value beq .skip ; full transparency? cmp.b d3,d2 ; full opaqueness? beq .copy move.b d2,d0 lsl.w #8,d2 add.b d0,d2 moveq #0,d0 move.b (a0)+,d0 move.b (a1),d1 sub.l d1,d0 muls.l d2,d0 swap d0 add.w d1,d0 move.b d0,(a1)+ moveq #0,d0 move.b (a0)+,d0 move.b (a1),d1 sub.l d1,d0 muls.l d2,d0 swap d0 add.w d1,d0 move.b d0,(a1)+ moveq #0,d0 move.b (a0)+,d0 move.b (a1),d1 sub.l d1,d0 muls.l d2,d0 swap d0 add.w d1,d0 move.b d0,(a1)+ dbf d7,.loop rts .skip addq.l #3,a0 addq.l #3,a1 dbf d7,.loop rts .copy move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ move.b (a0)+,(a1)+ dbf d7,.loop rts |
02 September 2014, 11:16 | #76 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
actually it is better to multiply by 258 since both the multiplicands range from 0 to 255, and 256*65535/(255*255) ~= 258. This is like multiplying both numbers by 257. (257*257)/256 ~= 258.
|
02 September 2014, 11:24 | #77 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
The alpha value does not range from 0 to 255. 255 is handled separately as "copy". Thus it ranges up tp 254. I don't know, if this makes a difference?
Last edited by AGS; 02 September 2014 at 11:39. |
02 September 2014, 13:05 | #78 | |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
Quote:
Also of course alpha=0 is a special case as well. |
|
02 September 2014, 13:37 | #79 |
XoXo/Tasko Developer
Join Date: Dec 2013
Location: Munich
Age: 49
Posts: 450
|
Why can't I again see a difference between multiplying with 257 and 258?
|
02 September 2014, 14:04 | #80 |
Glastonbridge Software
Join Date: Jan 2012
Location: Edinburgh/Scotland
Posts: 2,243
|
because the difference is very small! when the maximum difference is 1 part in 255 you would need to look very carefully on a really good monitor, and most of the pixels are probably exactly the same between versions.
|
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests) | |
Thread Tools | |
Similar Threads | ||||
Thread | Thread Starter | Forum | Replies | Last Post |
Tool to convert asm to gnu asm (gas) | Asman | Coders. Asm / Hardware | 13 | 30 December 2020 11:57 |
TCP/IP stack: Most optimized//small? | Amiga1992 | support.Apps | 17 | 14 June 2008 00:42 |
Optimized Protracker playroutine? | Photon | Coders. General | 10 | 11 June 2005 00:54 |
|
|