scale images
Moderators: Shine, Insert_witty_name
scale images
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
(i do not mean x2,x3,x4... the pixels.)
more like photoshop.
thanks a lot
lumo
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.
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
Retired Engineer
-
- Posts: 31
- Joined: Sat Mar 04, 2006 1:35 am
-
- Posts: 24
- Joined: Fri Feb 17, 2006 5:08 am
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.....
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.....