\documentclass[12pt, titlepage]{article}

%\usepackage{fullpage}
\usepackage[round]{natbib}
\usepackage{multirow}
\usepackage{booktabs}
\usepackage{tabularx}
\usepackage{graphicx}
\usepackage{float}
\usepackage{hyperref}
\hypersetup{
    colorlinks,
    citecolor=black,
    filecolor=black,
    linkcolor=red,
    urlcolor=blue
}
\usepackage[round]{natbib}

\newcounter{acnum}
\newcommand{\actheacnum}{AC\theacnum}
\newcommand{\acref}[1]{AC\ref{#1}}

\newcounter{ucnum}
\newcommand{\uctheucnum}{UC\theucnum}
\newcommand{\uref}[1]{UC\ref{#1}}

\newcounter{mnum}
\newcommand{\mthemnum}{M\themnum}
\newcommand{\mref}[1]{M\ref{#1}}

\title{SE 3XA3: MIS\\Gifitti}

\author{Team \#2, Gifitti
		\\ Pavle Arezina, arezinp
		\\ Nicolai Kozel, kozeln
		\\  Riley McGee, mcgeer
}

\date{\today}

\input{../../Comments}

\begin{document}

\maketitle

\pagenumbering{roman}
\tableofcontents
\listoftables
\listoffigures
\newpage
\begin{table}[bp]
\caption{\bf Revision History}
\begin{tabularx}{\textwidth}{p{3cm}p{2cm}X}
\toprule {\bf Date} & {\bf Version} & {\bf Notes}\\
\midrule
November 12th 2016 & 1.0 & Initial creation of document				\\
November 13th 2016 & 1.1 & Spellcheck and formatting				\\
November 30th 2016 & 2.0 & Updated to reflect the release of Gifitti. 	\\
\bottomrule
\end{tabularx}
\end{table}

\clearpage

\pagenumbering{arabic}

\section{Introduction}
Gifitti is a software solution for allowing users with a varying knowledge base on image manipulation, as well as  technical experience with computers to be able to load, decompose, and modify GIF images. \\
This document describes the internal workings of each module implemented as a part of Gifitti. Described are the methods, input/output, as well as any environment and state variables that the module uses. The MIS will continue to be updated as more methods and features are added to each module. 

\section{Module Declarations}
This section simply lists the modules used by Gifitti. More details on these modules (and how they interact) can be found in the MG document.
\begin{description}

\item [\refstepcounter{mnum} \mthemnum \label{mHH}:] Hardware-Hiding Module
\item [\refstepcounter{mnum} \mthemnum \label{mBH}:] Behaviour-Hiding Module
\item [\refstepcounter{mnum} \mthemnum \label{mSD}:] Software Decision Module
\item [\refstepcounter{mnum} \mthemnum \label{mIP}:] Image Processing Module
\item [\refstepcounter{mnum} \mthemnum \label{mIL}:] Image Loading Module
\item [\refstepcounter{mnum} \mthemnum \label{mIC}:] Image Conversion Module
\item [\refstepcounter{mnum} \mthemnum \label{mGT}:] GIF Transformation Module
\item [\refstepcounter{mnum} \mthemnum \label{mGM}:] GIF Model Module
\item [\refstepcounter{mnum} \mthemnum \label{mVM}:] View-Model Module
\end{description}

\section{Module Specifications}
\subsection{Hardware-Hiding Module}
Since the hardware hiding module is implemented through the OS and is not actually coded as part of Gifitti, there is nothing to add to the MIS.
\subsection{Behavior-Hiding Module} 
This module serves as a communication layer between the hardware-hiding module and the software decision module. This module covers M4.M5, and M8. Again, this module is not actually coded so there is nothing to add to the MIS.
\subsection{Software Decision Module}
This module includes any data structures and algorithms used in the system that do not provide direct interaction with the user. This module covers M7, and M6. Again, ths module is not actually coded so there is nothing to add to the MIS. 

\subsection{Image Loading Module}
This module allows for the conversion of system paths to images in a usable form within the software. 
\subsubsection{Variables}
\begin{enumerate}
	\item Filepath (Input)
	\item originalImage (Output)
	\item gifImage (Output)
	\item numberOfFrames (Output)
	\item frames[] (Output)
\end{enumerate}
\subsubsection{Methods}
\begin{enumerate}
	\item LoadImage(string FilePath) \\This method takes as input the file path and converts 
		it to an image file type using M4. This image is saved in the Image variable. 
	\item frameConstruction(Image img) \\Decomposes GIF into its frames.
\end{enumerate}

\subsection{Image Processing Module}
This module converts the input images into a system usable form. 
Implementation is handled by the ImageMagick.NET API.

\subsection{Image Conversion Module}
This module converts the GIF from a GIF Model (M8) to an image exportable by the system (GIF, TIFF, JPEG, PNG, BMP). 
\subsubsection{Variables}
\begin{enumerate}
	\item allowedFileTypes[] (Static)
	\item exportFileType (Input)
	\item curLoadedGIF  (Input)
	\item startFrame (Input)
	\item endFrame (Input)
	\item delay (Input)
	\item filePath (Input)
	\item outputImage (Output)
\end{enumerate}
\subsubsection{Methods}
\begin{enumerate}
	\item exportGIF(string filePath)\\
		This handles exporting the currently represented GIF.
	\item ConvertTo(string filePath, FileType ft)\\
		Export of all GIF frames as type ft to path filePath.
\end{enumerate}

\subsection{GIF Transformation Module}
This module handles frame by frame manipulation of the GIF Models (M8) in order to complete operations such as resizing and modifying the speed, etc. All
the methods and variables of this module are listed below. 
\subsubsection{Variables}
\begin{enumerate}
	\item curLoadedGIF (Input)
	\item modifiedGIF (Output)
\end{enumerate}
\subsubsection{Methods}
\begin{enumerate}
	\item Resize(int x, int y)\\
		This method will resize the GIF to the size passed as parameters. 
	\item ChangeSpeed(int newDelay)\\
		This method will alter the speed of the GIF by the value passed as a parameter. 
		This is information hidden, it is meant to extend more for future releases.
\end{enumerate}

\subsection{GIF Model Module}
This module represents a GIF object within the system. It contains methods and properties that allow the system to properly manipulate the GIF. 
\subsubsection{Variables}
\begin{enumerate}
	\item Frames[]
	\item delay
	\item startFrame
	\item endFrame
\end{enumerate}
\subsubsection{Methods}
\begin{enumerate}
	\item GetNextFrame()\\
		Returns the next frame to be handled by the controller based on Model state.
	\item GetFrame(int index, [bool isResize]) \\
		Fetches frame number index (index is an element of [0, numberOfFrames - 1]), 
		if isResize return a clone, else return a reference to the image.
	\item Dispose()\\
		Memory management and system cleaning.
\end{enumerate}

\subsection{View-Model Module}
The View-Model Module handles all View elements created by C\# WinForms, as well as their static link to the model representation of a view. These links are referred to as View-Models. View-Models and Views are not abstracted into separate modules due to how the implementation occurs in the C\# coding paradigm. Views (called Forms), are linked to their View-Model via partial classes, this keeps coupling high between the View-Models and Views, but low coupling to the Model.
\subsubsection{Variables}
\begin{enumerate}
	\item MainForm
	\item HelpContextForm
	\item SaveAsXbyYForm
	\item GifModel (input)
\end{enumerate}
\subsubsection{Methods}
\begin{enumerate}
	\item MenuOpenHelp()\\
		Show the HelpContextForm.
	\item MenuItemResize()\\
		Show the SaveAsXbyYForm.
	\item StartStopClickEvent() \\
		Toggles between play and stop for GIFs.
	\item MenuOpenFile()\\
		Launches a OpenFileDialog prompting the user to open a GIF, the opened GIF is then loaded as a GifModel.
	\item MenuItemFileSaveAs()\\
		Launches a SaveFileDialog prompting the user for a path to save the loaded GIF to a location.
	\item StopFrameTextChanged()\\
		Validation and Verification of the text box representing endFrame.
	\item StartFrameTextChanged()\\
		Validation and Verification of the text box representing startFrame.
	\item GifFPSSliderUpdate()\\
		Updates delay of the GIF via slider position.
	\item AdvanceFrameTimer()\\
		System interupt to draw the next frame, modeling the GIF.
	\item exportFrames(ImageFormat format)\\
		Exports the GIF as a bundle of Images representing each frame from startFrame to endFrame, exported image will be of type Format.
	\item MenuItemExportTIFF()\\
		Exports the GIF frames as TIFF file type
	\item MenuItemExportPNG()\\
		Exports the GIF frames as PNG file type
	\item MenuItemExportJPEG()\\
		Exports the GIF frames as JPEG file type
	\item MenuItemExportBMP()\\
		Exports the GIF frames as BMP file type
	\item chkImage()\\
		Validates the Image loaded is legal.
	\item openingGIFLinkClicked()\\
		Displays information about opening GIFs in the help context.
	\item savingGIFLinkClicked()\\
		Displays information about saving GIFs in the help context.
	\item savingImageLinkClicked()\\
		Displays information about saving GIFs as other image types in the help context.
	\item pickFramesLinkClicked()\\
		Displays information about selecting sub GIFs the help context.
	\item playbackSpeedLinkClicked()\\
		Displays information about modifying GIF playback speed in the help context.
	\item resizeLinkClicked()\\
		Displays information about resizing GIFs in the help context.
	\item SaveAsButtonClick()\\
		Utilized in the SaveAsXbyYForm, Prompts the user for a file path for a resized GIF.
	\item widthChanged()\\
		Validation and Verification on the width text box in the SaveAsXbtYForm
	\item heightChanged()\\
		Validation and Verification on the height text box in the SaveAsXbtYForm	
\end{enumerate}

\end{document}