scale images

Discuss using and improving Lua and the Lua Player specific to the PSP.

Moderators: Shine, Insert_witty_name

Post Reply
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

scale images

Post by LuMo »

anyone got an idea about scaling an image over time?
(i do not mean x2,x3,x4... the pixels.)
more like photoshop.
thanks a lot
lumo
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

We have a function for OpenGL. It is called glScale(size). It works in both 2D and 3D scenes. Size can be any number like 1.23 or 0.73.

If we have implementation for Lua Player, it would be gl.Scale(size). Too bad, we don't have the implementation yet.

Anyone dare to implement?

PS: I am switching old GLUT with a newer version called GLFW for my implementation in Windows environment.

PSS: I had compared FPS rates between codes in C/C++ and Lua. They are about the same!! Thanks to the power of GPU. Hence, Lua is no problem for being so slow.
Geo Massar
Retired Engineer
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

yeah could create a plane in GU apply texture and scale it...
thought there could be an easier way ;)

greets
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
matriculated
Posts: 31
Joined: Sat Mar 04, 2006 1:35 am

Post by matriculated »

LuMo wrote: thought there could be an easier way ;)
greets
I hope that's a sign of things to come!
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

matriculated wrote:
LuMo wrote: thought there could be an easier way ;)
greets
I hope that's a sign of things to come!
what do you expect?
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
my psprecious
Posts: 24
Joined: Fri Feb 17, 2006 5:08 am

Post by my psprecious »

Hey LuMo

you think something can be done with this

function Image:magnify(mag)
mag = mag or 2 -- 2 times in size by default
local w = self:width()
local h = self:height()
local result = Image.createEmpty(mag*w, mag*h)
for x = 0, w-1 do
for y = 0, h-1 do
result:fillRect(mag*x, mag*y, mag,mag, self:pixel(x,y))
end
end
return result
end

My be a start for what I want, if only I understood exactly what it do, man my maths are far.....
romero126
Posts: 200
Joined: Sat Dec 24, 2005 2:42 pm

Post by romero126 »

nope cant be done with that :-)
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

scaling&rotate is not trivial :o(
[except 90/180/etc rotation and x2,x3,etc scaling.]
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
KawaGeo
Posts: 191
Joined: Sat Aug 27, 2005 6:52 am
Location: Calif Mountains

Post by KawaGeo »

Yeah, but PSPgl or PSPgu is much faster, even with fractional arguments.
Geo Massar
Retired Engineer
LuMo
Posts: 410
Joined: Sun Aug 21, 2005 2:45 am
Location: Austria
Contact:

Post by LuMo »

i know :D as its using the hardware
"Good artists copy, great artists steal."
Pablo Picasso
go2lumo.com
Post Reply