Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Switch to GitLab Next
Sign in / Register
Toggle navigation
C
com.informatimago
Project overview
Project overview
Details
Activity
Releases
Cycle Analytics
Insights
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Locked Files
Issues
4
Issues
4
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
Security & Compliance
Security & Compliance
Dependency List
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
com-informatimago
com.informatimago
Commits
68d5dac3
Commit
68d5dac3
authored
Feb 26, 2017
by
Pascal J. Bourguignon
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Added pgl/README; detect and signal inexistant file on image.create.
parent
595b1dd2
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
65 additions
and
0 deletions
+65
-0
pgl/README
pgl/README
+63
-0
pgl/examples/tierra-desde-luna.jpg
pgl/examples/tierra-desde-luna.jpg
+0
-0
pgl/pgl.lisp
pgl/pgl.lisp
+2
-0
No files found.
pgl/README
0 → 100644
View file @
68d5dac3
Portable Graphics Library
========================================
This package implements a Portable Graphics Library using the
JavaBackEnd from the Stanford Portable Library.
References
----------------------------------------
http://cs.stanford.edu/~eroberts/papers/ITiCSE-2013/PortableGraphicsLibrary.pdf
https://github.com/cs50/spl
https://cs.stanford.edu/people/eroberts/jtf/tutorial/UsingTheGraphicsPackage.html
Installation
----------------------------------------
The spl must be installed:
# Required system packages:
# bash binutils coreutils findutils gcc java-1.?.0-openjdk-devel
cd /usr/local/src
git clone git@github.com:cs50/spl.git
cd spl
make
make install
This installs:
/usr/local/include/spl/*.h
/usr/local/lib/libcs.a
/usr/local/lib/spl.jar
You may install spl.jar somewhere else, by binding its pathname to the variable PGL:*SPL-PATH*.
Running Examples
----------------------------------------
(load #P"examples/yarn-pattern.lisp")
(com.informatimago.portable-graphics-library.example.yarn-pattern:run)
(load #P"examples/yin-yang.lisp")
(com.informatimago.portable-graphics-library.example.yin-yang:run)
(load #P"examples/ball.lisp")
(bt:make-thread (lambda () (com.informatimago.portable-graphics-library.example.ball:run)))
;; to let it run in a background thread while we go on.
(load #P"examples/checkerboard.lisp")
(com.informatimago.portable-graphics-library.example.checkerboard:run)
(load #P"examples/felt-board.lisp")
(com.informatimago.portable-graphics-library.example.felt-board:run)
(load #P"examples/image.lisp")
(com.informatimago.portable-graphics-library.example.image:run #P"examples/tierra-desde-luna.jpg")
pgl/examples/tierra-desde-luna.jpg
0 → 100644
View file @
68d5dac3
21.9 KB
pgl/pgl.lisp
View file @
68d5dac3
...
...
@@ -1710,6 +1710,8 @@ from OBJECT and COMPOUND-MIXIN.
(
extract-slots
'
(
filename
)))
(
defmethod
initialize-instance
:after
((
self
image
)
&key
&allow-other-keys
)
(
unless
(
probe-file
(
filename
self
))
(
error
'file-error
:pathname
(
filename
self
)))
(
let
((
size
(
image.create
self
(
filename
self
))))
(
setf
(
slot-value
self
'width
)
(
dimension-width
size
)
(
slot-value
self
'height
)
(
dimension-height
size
))
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment