Skip to content
This repository has been archived by the owner on Mar 3, 2019. It is now read-only.

This was the first project that I did for Com S 229 at Iowa State University. It uses a simplified BMP image format named SIMP and generates memes based on the configuration files.

Notifications You must be signed in to change notification settings

ajlende/Com-S-229-Meme-Generator

Repository files navigation

===========================================
|                                         |
|      Project 1B                         |
|      SIMP Image Manipulation            |
|                                         |
|      Alex Lende                         |
|      ajlende                            |
|                                         |
===========================================



The SIMP Data Structure
===========================================

The simp data structure consists of a 32-bit int for the width followed by another
32-bit int for the height. Following the width and height is a pixel** to hold all 
of the pixels of the image. Each pixel is stored in a structure with four unsigned 
8-bit chars to represent the values of the red, green, blue, and alpha channels of 
the pixel. The structure type definitions can be found in simp.h.



The FONT Data Structure
===========================================

The font data structure consists of only a name, and an array of characters. The 
array of characters is an array of pointers to simp files containing the data for 
that letter.



The MEME Data Structure
===========================================

The meme data structure consists of a name, the number of MEMEIDs, hereafter called 
attributes, and an array of attributes. Each attribute is stored in an attribute 
structure. the attribute structure consists of the name of the attribute, the message 
that that the attribute says, and the x and y coordinates for the center and bottom of 
the attribute.


Extra Details
===========================================

All simp files inputted into all programs are assumed to follow the SIMP image
format as described in section 6.1 of the Project 1 Specification.

All file names entered as command line arguments for input are expected to exist.
Non-existent output files will be created, and existing ones will be overwritten.

All numerical values entered as command line arguments are expected to be integers.

It is assumed that the .mem, .fsf, and .act files are written according to the 
specification, and there is no extreneous whitespace such as on either side of the 
separating colon.

If any of the above are entered not as expected, then the program will exit.



Files
===========================================

README:
-------
This README.


Makefile:
---------
The Makefile contained in the project contains four sections as described below. 

1. all command     - This is the default make command to compile all of the
                     programs normally. CFLAGS includes -g for debuffing.
					 This may be removed.
2. clean command   - This will clean out any non-source files from the
                     directory.
3. tarball command - This will make a tarball from the source files for
                     submission.

bw.c:
-----
The bw.c file contains the main method for the bw program.

The bw program converts an image to black and white.

Usage: bw pic.simp out.simp

Each pixel is converted to black and white by averaging the Red, Green,
and Blue values and then setting each color channel to that averaged value.


colorshift.c:
-------------
The colorshift.c file contains the main method for the colorshift program.

The colorshift program performs an artistic color shift in the given image.

Usage: colorshift pic.simp out.simp pattern

The pattern should be one of the following strings:
RGB GBR BRG RBG BGR GRB RG GR RB BR GB BG

The pattern RGB says send Red to Green, Green to Blue, and Blue to Red.
The two-letter patterns swap two colors, such as RG to swap Red and Green,
while keeping Blue the same. 


crop.c:
-------
The crop.c file contains the main method for the crop program.

The crop program performs a crop operation on an image, selecting a smaller
portion to create a smaller image.

Usage: crop picture.simp out.simp x y w h

Overlay creates a new image given by drawing the second picture on top of 
the first picture using a translation such that the top-left corner of pic2
is at the position (x, y) inside pic1.


overlay.c:
----------
The overlay.c file contains the main method for the overlay program.

The overlay program takes two images and places one on top of the other.

Usage: overlay pic1.simp pic2.simp out.simp x y

Overlay creates a new image given by drawing the second picture on top of 
the first picture using a translation such that the top-left corner of pic2
is at the position (x, y) inside pic1.


meme.c:
-------
The meme.c file contains the main method for the meme program.

The meme program is used to generate internet memes.

Usage: meme memefile.mem action.act

The meme program should load the MEM file specified by argument 1, and the ACT 
file specified by argument 2. The MEM file contains references to FSF files, so 
these should be loaded as well. The program should then perform the action 
specified by the ACT file, to load the given meme image, the specified font, and 
to overlay the specified text over the meme as specified. The final meme should 
be saved to the SIMP file specified by OUTFILE in the ACT file.


simp.c:
-------
The simp.c file contains all of the function bodies for the function
prototypes in simp.h.


simp.h:
-------
The simp.h header file contains the type definitions for the simp and
pixel data structure as well as the function prototypes that are defined
in simp.c


memelib.c:
----------
The memelib.c file contains the functions associated with the meme data structure.


memelib.h
---------
The memelib.h file contains the type definition of the meme and attribute data 
structures as well as contains the function prototypes for the functions detailed 
in memelib.c.


font.c
------
The font.c file contains the functions associated with the file data structure.


font.h
------
The font.h file contains the type definition of the font data structure as well 
as contains the function prototypes for the functinos detailed in font.c.



About

This was the first project that I did for Com S 229 at Iowa State University. It uses a simplified BMP image format named SIMP and generates memes based on the configuration files.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages