Preparation for the workshop
The instructions below should be followed two weeks before the workshop.Installing gcc and libpng
In case of failure, use Internet searches and/or help from friends before trying to contact me.Ubuntu
- Open a terminal
- Type
sudo apt update gcc
. Sudo will ask you to type your password. - Type
sudo apt install gcc
and accept the installation. - Type
gcc --version
. If the version is at least 4.8.1 then that is fine. Otherwise you have to install a more recent version. For thissudo apt list 'gcc*'
may be useful. - Type
sudo apt install libpng-dev
. The version should be at least 1.6. you can check this by typingsudo apt list 'libpng-dev'
Other linuxes
Similar, but the package manager may be different fromapt
. Use an Internet search to find out.
Windows
- Go to the following web site Cygwin.
- In the menu on the left click "Install Cygwin".
- Follow the instructions to install cygwin (download the setup file and execute it).
- During the installation process, choose "Install from the Internet".
- During the installation process, or later by executing again the setup file, use the cygwin package manager to install "gcc-g++" and "libpng-devel". The gcc version should be at least 4.8.1, the libpng version at least 1.6.
- When you will use gcc and the programs you create, all commands will have to be typed from a Cygwin terminal, otherwise Windows will complain about missing DLLs.
- The default home terminal is in the cygwin folder the setup program created during the installation, in a subfolder called home, in a subfolder having your user name. I recommend that you create yet another subfolder and put your code there.
Mac
- First test if gcc is already installed (unlikely) by opening a terminal and typing
gcc --version
. - If not, you have to install it. I do not own a Mac anymore, but you may find useful instructions by an Internet search.
For instance the second result that Google Search gave me on "install gcc on macos" is https://discussions.apple.com/thread/8336714. There is an alternative to gcc: clang, whose command-line instruction for C++ is
clang++
. I have not tested my code against it. - In any case you must also find how to install libpng for whichever compiler you chose.
What are they
GCC: the Gnu Compiler Collection, contains a compiler for C++libpng: the official C language library for saving/loading PNG image files to/from arrays of pixels. It is C++ compatible.
My code
Download
Go to the following Github page where I have put some code I wrote, download the source code and unzip it:Install
There is no installing required.Testing
As opposed to the first section, in case of problems, you are encouraged to contact me quickly.PNGImg
In a terminal go to the folder wherePNGImg.cc
sits with its test file save-test.cpp
and type
g++ -std=c++11 -Wall --pedantic-errors save-test.cpp -lpng -o save-test.exe
It should create a program file called save-test.exe
. Execute it by typing
./save-test.exe
It should create (overwrite if it already exists) an image file called test.png
in the folder where you called the program.
If it does not work contact me.
Basic knowledge
Math
You should know complex numbers and have notions about polynomials of a complex variable, and the two equivalent definition of holomorphic functions of a complex variable : as a function that is complex-differentiable everywhere and as a function that is power series expandable everywhere.Programming
Familiarity with C++ is not required but I will assume that the participant has basic knowledge of programming: for loops, if then else, functions (aka methods, procedures, subroutines). Since C++ is a typed language, the participant should get familiar with that aspect (no need to learn pointers, though). We will barely use the advanced features of C++, so no need to learn them in advance.If you have never done it: type (do not copy-paste: type every character!) and compile a basic "Hello world!" minimal C++ program.
The first three chapters of https://www.programiz.com/cpp-programming/ are oversimplified, yet cover a bit more than what you need to know.