1 /* 2 * 3 * Copyright (C) 2001-2002, OFFIS 4 * 5 * This software and supporting documentation were developed by 6 * 7 * Kuratorium OFFIS e.V. 8 * Healthcare Information and Communication Systems 9 * Escherweg 2 10 * D-26121 Oldenburg, Germany 11 * 12 * THIS SOFTWARE IS MADE AVAILABLE, AS IS, AND OFFIS MAKES NO WARRANTY 13 * REGARDING THE SOFTWARE, ITS PERFORMANCE, ITS MERCHANTABILITY OR 14 * FITNESS FOR ANY PARTICULAR USE, FREEDOM FROM ANY COMPUTER DISEASES OR 15 * ITS CONFORMITY TO ANY SPECIFICATION. THE ENTIRE RISK AS TO QUALITY AND 16 * PERFORMANCE OF THE SOFTWARE IS WITH THE USER. 17 * 18 * Module: dcmimgle 19 * 20 * Author: Joerg Riesmeier 21 * 22 * Purpose: Provides abstract interface to plugable image output formats 23 * 24 */ 25 26 27 #ifndef __DIPLUGIN_H 28 #define __DIPLUGIN_H 29 30 #include "osconfig.h" 31 32 #define INCLUDE_CSTDIO 33 #include "ofstdinc.h" 34 35 36 /*------------------------* 37 * forward declarations * 38 *------------------------*/ 39 40 class DiImage; 41 42 43 /*---------------------* 44 * class declaration * 45 *---------------------*/ 46 47 /** abstract interface to plugable image output formats. 48 * This is an abstract base class used as an interface to support multiple 49 * plugable image output formats for the dcmimle/dcmimage library. An example 50 * implementation can be found in dcmjpeg/libsrc/dipijpeg.cc (JPEG plugin). 51 */ 52 class DiPluginFormat 53 { 54 public: 55 56 /** destructor (virtual) 57 */ ~DiPluginFormat()58 virtual ~DiPluginFormat() {} 59 60 /** write given image to a file stream (abstract) 61 * 62 ** @param image pointer to DICOM image object to be written 63 * @param stream stream to which the image is written (open in binary mode!) 64 * @param frame index of frame used for output (default: first frame = 0) 65 * 66 ** @return true if successful, false otherwise 67 */ 68 virtual int write(DiImage *image, 69 FILE *stream, 70 const unsigned long frame = 0) const = 0; 71 72 protected: 73 74 /** constructor (protected) 75 */ DiPluginFormat()76 DiPluginFormat() {} 77 }; 78 79 80 #endif 81