//*********************************************************************** // convolve.h // authors: Matthew Judd and John Karpovich // mrj2p@virginia.edu and jfk3w@virginia.edu // University of Virginia // December 7, 1992 // // // compilation: // make -f serial - serial version // make all - parallel MENTAT version // // description: // Implements virtual class definitions for convolving example of the // Stenciler base class. // // user responsibility: // Write getMatrixPiece() code - this code uses pre-defined Stenciler // variables to find each particular convolve object's piece of the // image matrix, and reads it in from the source file. This code is // specific on the file format, and must be written by the user. // // Write putMatrixPiece() code - this code uses pre-defined Stenciler // variables to put each particular convolve object's piece of the // image matrix into its proper location in the output file. This code // is specific on the file format, and must be written by the user. // // Write doMatrixPiece() code - this code applies each stencil to each // piece of the Matrix. This code is specific to the operation desired // by the user, and must be written by the user. // // Write setRowsAndCols() code - this code initializes the number of rows // and columns in the image. It also initializes the window variables to // include the whole image. This information is obtained from the source // file, and therefore is specific to the file format used. // // Write getNextStencil() code - this function both returns the next stencil // to apply to the matrix, and decides whether or not to stop applying // filters. The test for whether or not to stop applying filters is // specific to the operation desired by the user. // // Write prepareDest() code - this function prepares the destination file // to receive the final image from the stencil_workers. Any information // the destination file needs other than that image must be written here. // This inormation is specific on the file format. //*********************************************************************** // **************************************************************************** // // Copyright (c) 1992 // University of Virginia // All Rights Reserved // // This software is the property of the University of Virginia. // This software is provided `as is' and without any express or // implied warrenties. // // Send problems & suggestions to: // Andrew Grimshaw (grimshaw@cs.virginia.edu) // // ************************************************************************** #include #include "./Stenciler.h" #ifndef SERIAL sequential mentat class convolve : public Stenciler { #else class convolve : public Stenciler { #endif public: void workers_alloc(int pieces); void destroy_workers(int pieces); void getMatrixPiece(); void putMatrixPiece(); void doStencilPiece(stencil *st); void prepareDest(); stencil* getNextStencil(); int setRowsCols(); };