forums.ps2dev.org Forum Index forums.ps2dev.org
Homebrew PS2, PSP & PS3 Development Discussions
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Gray Scales

 
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development
View previous topic :: View next topic  
Author Message
KawaGeo



Joined: 27 Aug 2005
Posts: 191
Location: Calif Mountains

PostPosted: Tue Sep 06, 2005 3:46 am    Post subject: Gray Scales Reply with quote

Here is a code to display gray scales for reference.

Code:
-- grayscales.lua by Geo Massar, 2005

dofile "LPut01.lua"

green = Color.new(0, 255, 0)

bg = Image.createEmpty(480,272)    -- background
bg:caption(152,28, "Gray Scales", green, 2)
bg:print(2,262, "by Geo Massar, 2005 (aka KawaGeo)", green)

bg:fillRect(111,71, 258,130, green)
for i = 0, 3 do
  mark = 111 + 64*i
  bg:drawLine(mark,200, mark,207, green)
end
bg:drawLine(368,200, 368,207, green) -- last mark
bg:print(109,210, "0",   green)
bg:print(169,210, "64",  green)
bg:print(229,210, "128", green)
bg:print(293,210, "192", green)
bg:print(358,210, "255", green)

for x = 0, 255 do
  gray = Color.new(x,x,x)
  bg:drawLine(112+x,72, 112+x,199, gray)
end
bg:save "grayscales.tga"

screen:blit(0,0, bg)
screen.flip()

while true do
  screen.waitVblankStart()
end

You can get the library file, LPut01.lua, at my webpage.

Screenshot:


NOTE: With the current version of LP, the display shows only 32 scales. There will be full 256 scales in the future version. Right, Shine?
_________________
Geo Massar
Retired Engineer
Back to top
View user's profile Send private message Send e-mail
Jim



Joined: 02 Jul 2005
Posts: 487
Location: Sydney

PostPosted: Tue Sep 06, 2005 5:51 pm    Post subject: Reply with quote

Quote:
NOTE: With the current version of LP, the display shows only 32 scales. There will be full 256 scales in the future version. Right, Shine?

The PSP can only show 32 grey levels in 16bit colour mode. Is LUA 16 or 32bit?

Jim
_________________
http://www.dbfinteractive.com
Back to top
View user's profile Send private message Visit poster's website
Shine



Joined: 03 Dec 2004
Posts: 728
Location: Germany

PostPosted: Tue Sep 06, 2005 11:42 pm    Post subject: Reply with quote

Jim wrote:
Is LUA 16 or 32bit?


16 bit: http://forums.ps2dev.org/viewtopic.php?t=3157
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    forums.ps2dev.org Forum Index -> PSP Lua Player Development All times are GMT + 10 Hours
Page 1 of 1

 
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