Actually merge everything from trunk, not only the source folder.

git-svn-id: svn://pulkomandy.tk/GrafX2/branches/cpcmode5@1720 416bcca6-2ee7-4201-b75f-2eb2f807beb1
This commit is contained in:
Adrien Destugues 2011-02-14 12:23:49 +00:00
commit bdf8b6d694
60 changed files with 2156 additions and 1793 deletions

Binary file not shown.

Binary file not shown.

BIN
bin/libpng14-14.dll Normal file

Binary file not shown.

View File

@ -125,7 +125,7 @@ Zlib:
Libpng Libpng
Requires: Zlib Requires: Zlib
http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libpng/ http://www.mirrorservice.org/sites/download.sourceforge.net/pub/sourceforge/l/li/libpng/
libpng-1.0.23.tar.gz libpng-1.4.2.tar.gz (Before June 2010, we were using libpng-1.0.23.tar.gz)
Uncompress in temporary directory Uncompress in temporary directory
./configure ./configure
make make

21
doc/PF_fonts.txt Normal file
View File

@ -0,0 +1,21 @@
Fonts by Yusuke Kamiyamane
http://p.yusukekamiyamane.com/fonts/
License: "The fonts can be used free for any personal or commercial projects."
- Arma Five
- Ronda Seven
- Easta Seven
- Westa Seven
- Tempesta Seven
- Tempesta Five
Converted to Sfont format by yrizoud
Changed filenames for better sorting:
for Compressed
_ for Condensed
__ for Normal
___ for Extended

View File

@ -2,7 +2,7 @@ The following file
SDL_image.dll SDL_image.dll
is the runtime environment for the library SDL_image 1.2.8 by Sam Lantiga and Mattias Engdegård. is the runtime environment for the library SDL_image 1.2.10 by Sam Lantiga and Mattias Engdegård.
This library is distributed under the terms of the GNU LGPL license: This library is distributed under the terms of the GNU LGPL license:
http://www.gnu.org/copyleft/lesser.html http://www.gnu.org/copyleft/lesser.html
@ -12,8 +12,8 @@ http://www.libsdl.org/
========================= =========================
Compiled by yrizoud on 21/10/2009 with static builds of : Compiled by yrizoud on 16/06/2010 with static builds of :
libjpeg (JPEG library http://www.ijg.org/ release 6b of 27-Mar-1998 : jpegsr6.zip) libjpeg (JPEG library http://www.ijg.org/ release 6b of 27-Mar-1998 : jpegsr6.zip)
libtiff (TIFF library ftp://ftp.sgi.com/graphics/tiff/ : tiff-v3.4-tar.gz) libtiff (TIFF library ftp://ftp.sgi.com/graphics/tiff/ : tiff-v3.4-tar.gz)
And dynamic version of : And dynamic version of :
libpng (http://www.libpng.org/pub/png/libpng.html) --> libpng13.dll requirement libpng (http://www.libpng.org/pub/png/libpng.html) v1.4.2 --> libpng14-14.dll requirement

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.3 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.4 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.5 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.6 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.7 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 1.8 KiB

View File

@ -356,4 +356,22 @@
; ;
Menubars_visible = 255; (Default 255) Menubars_visible = 255; (Default 255)
; This enables a mode where right mouse buttons acts as
; a color picker, with most tools.
;
Right_click_colorpick = NO; (Default NO)
; When this mode is active, scrolling the view (and the magnifier view)
; affects both the main image and the spare page - as long as they have
; the same dimensions.
Sync_views = YES; (Default YES)
; This setting determines which key inverts the mouse buttons
; when it's held : A left click is then interpreted as a right-click.
; It's especially useful for one-button controllers,
; such as touchscreens and tablets.
; Possible values are 0 (none), 1 (control), 2 (alt)
Swap_buttons = 1; (Default 1)
; end of configuration ; end of configuration

View File

@ -0,0 +1,79 @@
--PICTURE scene: Ellipse update-demo (anim)
--Demonstrates 'interactive' features.
--by Richard Fhager
-- Copyright 2011 Richard Fhager
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
--
-- rot: Rotation in degrees
-- stp: Step is # of line segments (more is "better")
-- a & b are axis-radius
function ellipse2(x,y,a,b,stp,rot,col)
local n,m=math,rad,al,sa,ca,sb,cb,ox,oy,x1,y1,ast
m = math; rad = m.pi/180; ast = rad * 360/stp;
sb = m.sin(-rot * rad); cb = m.cos(-rot * rad)
for n = 0, stp, 1 do
ox = x1; oy = y1;
sa = m.sin(ast*n) * b; ca = m.cos(ast*n) * a
x1 = x + ca * cb - sa * sb
y1 = y + ca * sb + sa * cb
if (n > 0) then line(ox,oy,x1,y1,col); end
end
end
--
--
function line(x1,y1,x2,y2,c)
local n,st,m; m = math
st = m.max(1,m.abs(x2-x1),m.abs(y2-y1));
for n = 0, st, 1 do
putpicturepixel(m.floor(x1+n*(x2-x1)/st), m.floor(y1+n*(y2-y1)/st),
c );
end
end
--
setpicturesize(300,300)
setcolor(0,96,96,96)
setcolor(1,255,255,128)
r1 = 100
r2 = 50
rt = 0
frames = 100
while (1 < 2) do
r1t = 10 + math.random() * 140
r2t = 10 + math.random() * 140
rtt = math.random() * 360
for n = 0, frames-1, 1 do
clearpicture(0)
f2 = n / frames
f1 = 1 - f2
r1a = r1*f1 + r1t*f2
r2a = r2*f1 + r2t*f2
rta = rt*f1 + rtt*f2
-- x, y, r1, r2, stp, rot, col
ellipse2(150, 150, r1a, r2a, 50, rta, 1)
statusmessage('press ESC to stop')
updatescreen();if (waitbreak(0)==1) then return end
end
r1,r2,rt = r1a,r2a,rta
end

View File

@ -0,0 +1,47 @@
--ANIM: Sprite Animator v0.1
--Spare page holds data - Plays on current
--by Richard Fhager
require("memory")
arg=memory.load({XS=16,YS=16,SPACE=1,FRAMES=8,XOFF=0,YOFF=0,FPS=10})
OK, XS, YS, SPACE, FRAMES, XOFF, YOFF, FPS = inputbox("Sprite-Sheet
Animator",
"Sprite X-size", arg.XS, 1, 256,0,
"Sprite Y-size", arg.YS, 1, 256,0,
"Spacing", arg.SPACE, 0, 32,0,
"# of Frames", arg.FRAMES,2, 100,0,
"X-offset", arg.XOFF, 0, 256,0,
"Y-offset", arg.YOFF, 0, 256,0,
"Play Speed (FPS)",arg.FPS, 1, 60,0
);
if OK == true then
memory.save({XS=XS,YS=YS,SPACE=SPACE,FRAMES=FRAMES,XOFF=XOFF,YOFF=YOFF,FPS=FPS})
MAXPLAYS = 25
w,h = getpicturesize()
OX = w / 2 - XS/2
OY = h / 2 - YS/2
for play = 1, MAXPLAYS, 1 do
for f = 0, FRAMES-1, 1 do
for y = 0, YS-1, 1 do
for x = 0, XS-1, 1 do
sx = x + XOFF + f * (XS + SPACE)
sy = y + YOFF
putpicturepixel(OX+x, OY+y, getsparepicturepixel(sx, sy))
end
end
updatescreen(); if (waitbreak(1/FPS)==1) then return; end
end
end -- plays
end --OK

View File

@ -0,0 +1,132 @@
-- Persistence library:
-- Memorize data for current function
-- memory.save(tab) and tab=memory.load()
--
-- The data will be stored in file called
-- ZZZ<calling_function_name>.dat
-- in the lua directory
--
-- Example 1:
--
-- -- Load initial values or set defaults
-- arg = memory.load({picX=320,picY=200,scale=0})
-- -- Run an inputbox
-- OK,arg.picX,arg.picY,arg.scale = inputbox("Image Size")",
-- "Width", arg.picX, 1,2048,0,
-- "Height", arg.picY, 1,2048,0,
-- "Scale", arg.scale, 0,1,0);
-- if OK == true then
-- -- Save the selected values
-- memory.save(arg)
-- end
-- Example 2:
--
-- -- Load initial values or set defaults
-- arg = memory.load({x=320,y=200,scale=0})
-- picX=arg.x
-- picY=arg.y
-- scale=arg.scale
-- -- Run an inputbox
-- OK,picX,picY,scale = inputbox("Image Size")",
-- "Width", picX, 1,2048,0,
-- "Height", picY, 1,2048,0,
-- "Scale", scale, 0,1,0);
-- if OK == true then
-- -- Save the selected values
-- memory.save({x=picX,y=picY,scale=scale})
-- end
memory =
{
serialize = function(o)
if type(o) == "number" then
return tostring(o)
elseif type(o) == "string" then
return string.format("%q", o)
--elseif type(o) == "table" then
-- io.write("{\n")
-- for k,v in pairs(o) do
-- io.write(" ", k, " = ")
-- memory.serialize(v)
-- io.write(",\n")
-- end
-- io.write("}\n")
else
error("cannot serialize a " .. type(o))
end
end;
-- Return a string identifying the calling function.
-- Pass 1 for parent, 2 for grandparent etc.
callername = function(level)
local w
local last_slash
local info = debug.getinfo(level+1,"Sn")
local caller=tostring(info.name)
-- Function name if possible
if (caller~="nil") then
return caller
end
-- Otherwise, get file name, without extension
-- Get part after directory name
last_slash=0
while true do
local pos = string.find(info.short_src, "/", last_slash+1)
if (pos==nil) then break end
last_slash=pos
end
caller=string.sub(info.short_src, last_slash+1)
-- Remove file extension
if (string.sub(caller,-4, -1)==".lua") then
caller=string.sub(caller, 1, -5)
end
return caller
end;
-- Memorize some parameters.
save = function(o)
local caller=memory.callername(2)
--for k, v in pairs(o) do
-- messagebox(tostring(k))
-- messagebox(tostring(v))
--end
local f, e = io.open("ZZZ"..caller..".dat", "w");
if (f ~= nil) then
f:write("Entry {\n")
for k, v in pairs(o) do
if (type(v)=="number") then
f:write(" "..k.."="..memory["serialize"](v)..",\n")
end
end
f:write("}\n")
f:close()
end
end;
-- Recover some saved parameters.
load = function(o)
local caller=memory.callername(2)
local i
function Entry (b)
-- Adds (or replaces) values in arg with those from b
for k, v in pairs(b) do
o[k]=v
end
end
local f = (loadfile("ZZZ"..caller..".dat"))
if (f ~= nil) then
f()
end
return o
end;
}
return memory

View File

@ -49,7 +49,11 @@ for y = 0, h - 1, 1 do
c = matchcolor(rp*f,gp*f,bp*f) c = matchcolor(rp*f,gp*f,bp*f)
putpicturepixel(x, y, c); putpicturepixel(x, y, c);
end end
updatescreen()
if (waitbreak(0)==1) then
return
end
end end

View File

@ -49,5 +49,9 @@ for y = 0, h - 1, 1 do
putpicturepixel(x, y, c); putpicturepixel(x, y, c);
end end
updatescreen()
if (waitbreak(0)==1) then
return
end
end end

View File

@ -1,18 +0,0 @@
-- 12bit colour space from palette
--
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y1=0,3,1 do
for x1=0,3,1 do
for y2=0,15,1 do
for x2=0,15,1 do
putpicturepixel(x1*16+x2,y1*16+y2,matchcolor((y2*255)/15,
((y1*4+x1)*255)/15,(x2*255)/15))
end;end;end;end

View File

@ -1,18 +0,0 @@
-- 15bit colour space from palette
--
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y1=0,3,1 do
for x1=0,7,1 do
for y2=0,31,1 do
for x2=0,31,1 do
putpicturepixel(x1*32+x2,y1*32+y2,matchcolor((y2*255)/31,
((y1*8+x1)*255)/31,(x2*255)/31))
end;end;end;end

View File

@ -1,18 +0,0 @@
-- 18bit colour space from palette
--
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y1=0,7,1 do
for x1=0,7,1 do
for y2=0,63,1 do
for x2=0,63,1 do
putpicturepixel(x1*64+x2,y1*64+y2,matchcolor((y2*255)/64,
((y1*8+x1)*255)/64,(x2*255)/64))
end;end;end;end

View File

@ -1,19 +1,12 @@
-- Glass grid filter -- Glass grid filter - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize(); w,h=getpicturesize();
for y1=0,h-1,8 do ok,xsiz,ysiz=inputbox("message","xsize",8,0,64,5,"ysize",8,0,64,6);
for x1=0,w-1,8 do if ok==true then
for y2=0,3,1 do for y1=0,h-1,xsiz do
for x2=0,7,1 do for x1=0,w-1,ysiz do
c1=getpicturepixel(x1+x2,y1+y2) for y2=0,(ysiz/2)-1,1 do
c2=getpicturepixel(x1+7-x2,y1+7-y2) for x2=0,xsiz-1,1 do
putpicturepixel(x1+x2,y1+y2,c2) c1=getpicturepixel(x1+x2,y1+y2);c2=getpicturepixel(x1+(xsiz-1)-x2,y1+(ysiz-1)-y2)
putpicturepixel(x1+7-x2,y1+7-y2,c1) putpicturepixel(x1+x2,y1+y2,c2);putpicturepixel(x1+(xsiz-1)-x2,y1+(ysiz-1)-y2,c1)
end;end;end;end end;end;end;end;end

View File

@ -1,18 +0,0 @@
-- Draw 8x8 grid
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y=0,h-1,1 do
for x=0,w-1,8 do
putpicturepixel(x,y,1);
end;end
for y=0,h-1,8 do
for x=0,w-1,1 do
putpicturepixel(x,y,1);
end;end

View File

@ -1,19 +0,0 @@
-- Draw red 8x8 grid
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
c=matchcolor(0xFF,0x00,0x00)
for y=0,h-1,1 do
for x=0,w-1,8 do
putpicturepixel(x,y,c);
end;end
for y=0,h-1,8 do
for x=0,w-1,1 do
putpicturepixel(x,y,c);
end;end

View File

@ -1,18 +0,0 @@
-- Draw isometric grid
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y=0,h-1,8 do
for x=0,w-1,1 do
putpicturepixel(x,y+(x/2)%8,1);
end;end
for y=0,h-1,8 do
for x=0,w-1,1 do
putpicturepixel(x+3,y+7-((x/2)%8),1);
end;end

View File

@ -1,14 +0,0 @@
-- x1 palette to picture
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
for y1=0,7,1 do
for x1=0,31,1 do
putpicturepixel(x1,y1,y1+x1*8)
end;end

View File

@ -1,16 +0,0 @@
-- x8 palette to picture
-- Copyright 2010 Paulo Silva
--
-- This program is free software; you can redistribute it and/or
-- modify it under the terms of the GNU General Public License
-- as published by the Free Software Foundation; version 2
-- of the License. See <http://www.gnu.org/licenses/>
setpicturesize(256,64);
for y1=0,7,1 do
for x1=0,31,1 do
for y2=0,7,1 do
for x2=0,7,1 do
putpicturepixel(x1*8+x2,y1*8+y2,y1+x1*8)
end;end;end;end

View File

@ -0,0 +1,37 @@
-- cell colour reducer - jan'11, from Paulo Silva, with help from people from GrafX2 google group (DawnBringer, Adrien Destugues (PulkoMandy), and Yves Rizoud)
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize()
ok,xcell,ycell=inputbox("Modify cell pixel size","xcell",8,1,16,4,"ycell",8,1,16,4);
if ok==true then
function grayscaleindexed(c)
r,g,b=getcolor(c);return math.floor((b*11+r*30+g*59)/100);end
celcnt={};for n=0,255,1 do celcnt[n+1]=0;end -- Arraycounter must have initial value
for y1=0,h-1,ycell do
for x1=0,w-1,xcell do
for i=0,255,1 do
celcnt[i+1]=0;end
for y2=0,ycell-1,1 do
for x2=0,xcell-1,1 do
x=x1+x2;y=y1+y2;u=getpicturepixel(x,y)
celcnt[u+1]=celcnt[u+1]+(1000*xcell*ycell)+math.random(0,950);end;end
ikattr=0;paattr=0;ikcnt=0;pacnt=0
for i=0,255,1 do
if ikcnt<celcnt[i+1] then ikcnt=celcnt[i+1];ikattr=i;end;end
celcnt[ikattr+1]=0
for i=0,255,1 do
if pacnt<celcnt[i+1] then pacnt=celcnt[i+1];paattr=i;end;end
if grayscaleindexed(ikattr)>grayscaleindexed(paattr) then tmpr=ikattr;ikattr=paattr;paattr=tmpr;end
wmid=math.floor((grayscaleindexed(paattr)+grayscaleindexed(ikattr))/2)
for y2=0,ycell-1,1 do
for x2=0,xcell-1,1 do
x=x1+x2;y=y1+y2;u=getpicturepixel(x,y)
if u==ikattr then
idou=ikattr
elseif u==paattr then
idou=paattr
else
idou=ikattr
if grayscaleindexed(u)>wmid then idou=paattr;end
end
putpicturepixel(x,y,idou)
end;end;end;end;end

View File

@ -0,0 +1,13 @@
-- Draw isometric grid - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
ok,gsiz,ik=inputbox("draw isometric grid","size",16,0,128,5,"colour",1,0,255,6);
if ok==true then
for y=0,h-1,gsiz do
for x=0,w-1,1 do
putpicturepixel(x,y+(x/2)%gsiz,ik);
end;end
for y=0,h-1,gsiz do
for x=0,w-1,1 do
putpicturepixel(x+((gsiz/2)-1),y+(gsiz-1)-((x/2)%gsiz),ik);
end;end;end

View File

@ -0,0 +1,11 @@
-- draw grid - indexed colour - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
ok,xsiz,ysiz,c=inputbox("draw grid - indexed colour)","x size",8,1,64,5,"y size",8,1,64,6,"colour id",0,0,255,6);
if ok==true then
for y=0,h-1,1 do
for x=0,w-1,xsiz do
putpicturepixel(x,y,c);end;end
for y=0,h-1,ysiz do
for x=0,w-1,1 do
putpicturepixel(x,y,c);end;end;end

View File

@ -0,0 +1,14 @@
-- draw grid - rgb (matchcolor) - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize()
ok,xsiz,ysiz,r,g,b=inputbox("draw grid - rgb (matchcolor)","x size",8,1,64,5,"y size",8,1,64,6,"r",128,0,255,6,"g",128,0,255,6,"b",128,0,255,6);
if ok==true then
c=matchcolor(r,g,b)
for y=0,h-1,1 do
for x=0,w-1,xsiz do
putpicturepixel(x,y,c);
end;end
for y=0,h-1,ysiz do
for x=0,w-1,1 do
putpicturepixel(x,y,c);
end;end;end

View File

@ -0,0 +1,17 @@
-- flip picture - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
ok,flipx,flipy=inputbox("flip picture","flip x",1,0,1,-1,"flip y",0,0,1,-1);
if ok==true then
if flipx==1 then
for y=0,h-1,1 do
for x=0,w/2,1 do
c1=getpicturepixel(x,y);c2=getpicturepixel(w-x-1,y)
putpicturepixel(x,y,c2);putpicturepixel(w-x-1,y,c1)
end;end
else
for y=0,h/2,1 do
for x=0,w-1,1 do
c1=getpicturepixel(x,y);c2=getpicturepixel(x,h-y-1)
putpicturepixel(x,y,c2);putpicturepixel(x,h-y-1,c1)
end;end;end;end

View File

@ -0,0 +1,11 @@
-- palette to picture - Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
ok,xsiz,ysiz=inputbox("palette to picture","x size",8,1,16,5,"y size",8,1,16,6);
if ok==true then
for y1=0,7,1 do
for x1=0,31,1 do
for y2=0,ysiz-1,1 do
for x2=0,xsiz-1,1 do
putpicturepixel(x1*xsiz+x2,y1*ysiz+y2,y1+x1*8)
end;end;end;end;end

View File

@ -0,0 +1,12 @@
-- Copyright 2010 Paulo Silva
-- This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; version 2 of the License. See <http://www.gnu.org/licenses/>
w,h=getpicturesize();
ok,bitd=inputbox("colourspace from palette","bitdepth:",4,1,8,5);
if ok==true then
bitd3=(2^bitd);bitd8=(2^(math.floor(bitd/2)));bitd9=(2^((math.floor((bitd-1)/2))+1))
for y1=0,(bitd8-1),1 do
for x1=0,(bitd9-1),1 do
for y2=0,(bitd3-1),1 do
for x2=0,(bitd3-1),1 do
putpicturepixel(x1*bitd3+x2,y1*bitd3+y2,matchcolor((y2*255)/(bitd3-1),((y1*8+x1)*255)/(bitd3-1),(x2*255)/(bitd3-1)))
end;end;end;end;end

Binary file not shown.

After

Width:  |  Height:  |  Size: 26 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 19 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

After

Width:  |  Height:  |  Size: 15 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 16 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 18 KiB

After

Width:  |  Height:  |  Size: 20 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 14 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 17 KiB

After

Width:  |  Height:  |  Size: 19 KiB

View File

@ -778,11 +778,7 @@ HTML_FILE_EXTENSION = .html
HTML_HEADER = HTML_HEADER =
# The HTML_FOOTER tag can be used to specify a personal HTML footer for HTML_TIMESTAMP = NO
# each generated HTML page. If it is left blank doxygen will generate a
# standard footer.
HTML_FOOTER = ../tools/footer.html
# The HTML_STYLESHEET tag can be used to specify a user-defined cascading # The HTML_STYLESHEET tag can be used to specify a user-defined cascading
# style sheet that is used by each HTML page. It can be used to # style sheet that is used by each HTML page. It can be used to

View File

@ -1,4 +0,0 @@
<hr size="1"/><address style="text-align: right;"><small>
Generated for $projectname by&nbsp;<a href="http://www.doxygen.org/index.html"><img class="footer" src="doxygen.png" alt="doxygen"/></a></small></address>
</body>
</html>

View File

@ -0,0 +1,97 @@
/* vim:expandtab:ts=2 sw=2:
*/
/* Grafx2 - The Ultimate 256-color bitmap paint program
* Gif Analyzer tool
Copyright 2010 Adrien Destugues
Grafx2 is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation; version 2
of the License.
Grafx2 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with Grafx2; if not, see <http://www.gnu.org/licenses/>
*/
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <math.h>
int main(int argc, char* argv[])
{
FILE* theFile;
if(argc != 2)
{
printf("%s file.gif\n",argv[0]);
exit(-1);
}
theFile = fopen(argv[1], "r");
uint8_t buffer[256];
fread(buffer, 1, 6, theFile);
buffer[6] = 0;
printf("Signature: %6s\n", buffer);
uint16_t w,h;
fread(&w,2,1,theFile);
fread(&h,2,1,theFile);
printf("Resolution: %dx%d\n",w,h);
fread(buffer,1,3,theFile);
int colors = ((buffer[0]&0b01110000)>>4)+1;
colors = pow(2,colors);
int bpp = (buffer[0]&0xF) +1;
printf("Color palette: %#02.2x\n",buffer[0]&0xFF);
if (buffer[0] & 0b10000000)
printf("\tGlobal palette\n");
printf("\tColor count: %d\n", colors);
printf("\tBits per pixel: %d\n",bpp);
printf("Index of background color: %d\n",buffer[1]);
printf("(reserved byte: %d)\n",buffer[2]);
printf("Color palette:\n");
for (int i = 0; i < pow(2,bpp); i++)
{
fread(buffer,1,3,theFile);
printf("\t%d: %u %u %u\t",i,buffer[0], buffer[1], buffer[2]);
if ((i+1)%4 ==0)puts("");
}
int i = 0;
do {
fread(buffer,1,1,theFile);
i++;
} while (i != ',');
if (i > 1);
printf("Skipped %d meaningless bytes before image descriptor\n",i);
uint16_t x,y;
fread(&x,2,1,theFile);
fread(&y,2,1,theFile);
fread(&w,2,1,theFile);
fread(&h,2,1,theFile);
printf("Image descriptor\n");
printf("\tx=%d y=%d w=%d h=%d\n",x,y,w,h);
fclose(theFile);
}