forums.silverfrost.com Forum Index forums.silverfrost.com
Welcome to the Silverfrost forums
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

RGB@
Goto page 1, 2  Next
 
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit
View previous topic :: View next topic  
Author Message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Tue Dec 15, 2020 11:13 pm    Post subject: RGB@ Reply with quote

I'm having problems with the colours generated by RGB@ using x64.

My lines that were red under win32 are now blue, and v/v, and my cyan background grid under win32 is now yellow.

What do I need to change to get the old win32 colours back under x64?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Wed Dec 16, 2020 8:35 am    Post subject: Reply with quote

Can you provide a short sample program and give the FTN95 version number.
Back to top
View user's profile Send private message AIM Address
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Wed Dec 16, 2020 3:55 pm    Post subject: Reply with quote

Are your R, G and B values REAL*4 or REAL*8 ?
Back to top
View user's profile Send private message
wahorger



Joined: 13 Oct 2014
Posts: 1214
Location: Morrison, CO, USA

PostPosted: Wed Dec 16, 2020 8:38 pm    Post subject: Reply with quote

Hopefully, integer arguments.....
Back to top
View user's profile Send private message Visit poster's website
LitusSaxonicum



Joined: 23 Aug 2005
Posts: 2388
Location: Yateley, Hants, UK

PostPosted: Thu Dec 17, 2020 10:08 pm    Post subject: Reply with quote

Blimey, Bill, I always put this sort of mistake down to autocorrect, but this one can only be geriatric brain fade!

INTEGER*4 or INTEGER*8, of course.

I put it down to my mind being elsewhere, Chapter 41 of my latest book, to be precise.

Eddie
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2551
Location: Sydney

PostPosted: Fri Dec 18, 2020 1:05 am    Post subject: Reply with quote

"INTEGER*4 or INTEGER*8, of course."

Would it have any effect, as only the first byte of R, G and B values are used.

Or am I having a geriatric brain fade also ?

I've always wanted @RGB to be a special geriatric intrinsic that provides an INTEGER*4 result.
Back to top
View user's profile Send private message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Fri Dec 18, 2020 9:09 am    Post subject: RGB@ Reply with quote

Hi Paul

I've cut my code down to make it as simple as I can.

It's a while since I used the forums -- I've forgotten how to send attachments.

The version is:

[FTN95/x64 Ver. 8.30.0 Copyright (c) Silverfrost Ltd 1993-2018]

Norm

PS Interestingly, using something like


nclr = 10

nSymblColor = RGB@ ( nclr, nclr, nclr )


gives a black line for both v32 and x64, whereas

nGridColor = RGB@ (0,255,255)

gives a cyan grid under v32 and yellow under x64.

I'm using Draw_Line@ in both versions, with

include < dbos.ins >

included in the x64 code.

Do I need to replace the "255" by "n255", where n255 = 255?




[/code]
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Fri Dec 18, 2020 12:13 pm    Post subject: Reply with quote

The program

Code:
nclr = 10
nSymblColor = RGB@ ( nclr, nclr, nclr )
print*, nSymblColor
end


prints 657930 which is A0A0A in hex.

You don't need DBOS.INS.

I am using FTN95 v8.70 but it shouldn't make any difference.
Back to top
View user's profile Send private message AIM Address
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Fri Dec 18, 2020 12:45 pm    Post subject: Reply with quote

My apologies, Paul, my email was not clear.

The code

nclr = 10

nSymblColor = RGB@ ( nclr, nclr, nclr )

gives a black axis under both v32 and x64, which is what it should do.

A bit later on, I use

nGridColor = RGB@ (0,255,255)

to draw lines for a background grid. This gives a cyan grid for the plot under v32 and yellow under x64.

What is the best way to send you the code and data file?
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Fri Dec 18, 2020 1:07 pm    Post subject: Reply with quote

You can put

nGridColor = RGB@ (0,255,255)

into my code above to see what you get for 32 bits and 64 bits.

If you need to send code then you could use DropBox (say) and post a link.

Did you say which version of FTN95 you are using?
Back to top
View user's profile Send private message AIM Address
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Fri Dec 18, 2020 1:17 pm    Post subject: Reply with quote

Yes, I did.

FTN95/x64 Ver. 8.30.0 Copyright (c) Silverfrost Ltd 1993-2018
Back to top
View user's profile Send private message
Norm.Campbell



Joined: 31 Aug 2007
Posts: 66

PostPosted: Fri Dec 18, 2020 1:22 pm    Post subject: Reply with quote

Hightail wants an email address to send you a notification.
Back to top
View user's profile Send private message
JohnCampbell



Joined: 16 Feb 2006
Posts: 2551
Location: Sydney

PostPosted: Fri Dec 18, 2020 1:43 pm    Post subject: Reply with quote

I found an old program from the forum, and tested red and blue in PLATO for 32-bit and 64-bit with no problem of rgb order.
This works for Ver 8.30 and Ver 8.64, without any swapping of reg/blue.
Norm, test if you have a problem with this code.
Code:
 PROGRAM main

 use clrwin

   integer, external  :: winio@  !, rgb@  ! defined in clrwin or FTN95 ??
!
   integer, parameter :: width = 800, height = 350, gutter = 20
   integer :: black = 0, red, cyan, blue, col
   integer*8 :: mag = 255                        ! test of 8 byte integer as argument to rgb@
   integer :: iw, i, k
   integer :: last_x, last_y, mid_y, len_x, new_x, new_y
   real    :: x,y
!   integer(7) :: ctrl                     ! fails for /64
   integer*4 :: ctrl
!
   blue   = RGB@(0,0,mag)
   red    = RGB@(mag,0,0)
   cyan   = RGB@(0,mag,mag)

   iw = winio@ ('%ca[sin(x)exp(-x/10)]&')
! set up the surface to draw onto. Remove [smooth4] to see what anti-aliasing has given you
!z   iw = winio@ ('%gr&', width, height)
   iw = winio@ ('%gr[smooth4]&', width, height)
   iw = winio@ ('%lw', ctrl)

 ! draw axes
   mid_y = height / 2
   len_x = width-(2*gutter)
   call draw_line_between@ (gutter, gutter, gutter, width-gutter, black )
   call draw_line_between@ (gutter, mid_y, width-gutter, mid_y, black )
!
   do k = 1,2
    do i = 0,len_x
     ! make the width of the x-axis span 0..8pi. REAL(len_x) is the width of that axis
     x = (i/REAL(len_x))*8*3.1415926d0
     if ( k==1) then
       col = red
       y = sin(x)*exp(-x / 10)
     else
       col = cyan ! blue
       y = cos(x)*exp(-x / 10)
     end if

     new_x = gutter+i
     new_y = mid_y + y*(mid_y-gutter)
     if (i > 0) then
       call draw_line_between@ (last_x, last_y, new_x, new_y, col )
     end if
     last_x = new_x
     last_y = new_y
    end do
   end do

END PROGRAM main
Back to top
View user's profile Send private message
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Fri Dec 18, 2020 2:57 pm    Post subject: Reply with quote

Norm.Campbell

I have sent you a Forum message containing a temporary email address.
Back to top
View user's profile Send private message AIM Address
PaulLaidler
Site Admin


Joined: 21 Feb 2005
Posts: 7912
Location: Salford, UK

PostPosted: Fri Dec 18, 2020 6:02 pm    Post subject: Reply with quote

Norm.Campbell

I have looked at your code. The result of RGB@(0,255,255) is correct and the same for 32 and 64 bits.

Also, for me, the resulting images are the same with a cyan coloured grid.

Are you using the same machine for the two tests (32 bits and 64 bits)?

I am using v8.70 but this should not make any difference.
Back to top
View user's profile Send private message AIM Address
Display posts from previous:   
Post new topic   Reply to topic    forums.silverfrost.com Forum Index -> 64-bit All times are GMT + 1 Hour
Goto page 1, 2  Next
Page 1 of 2

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group