gnash-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Gnash-dev] Whitespace fixes in libbase/GnashImageJpeg.h (patch)


From: dolphinling
Subject: [Gnash-dev] Whitespace fixes in libbase/GnashImageJpeg.h (patch)
Date: Wed, 26 Nov 2008 18:28:40 -0500
User-agent: Thunderbird 2.0.0.18 (X11/20081105)

I was looking at libbase/GnashImageJpeg.h and it was hard to read because of inconsistent whitespace. Here's a patch.

--
dolphinling
<http://dolphinling.net/>
=== modified file 'libbase/GnashImageJpeg.h'
--- libbase/GnashImageJpeg.h    2008-10-27 16:05:13 +0000
+++ libbase/GnashImageJpeg.h    2008-11-26 23:17:23 +0000
@@ -56,7 +56,7 @@
 
 private:
 
-    const char* _errorOccurred;
+       const char* _errorOccurred;
 
        jmp_buf _jmpBuf;
 
@@ -71,98 +71,98 @@
        /// Construct a JpegImageInput object to read from an IOChannel.
        //
        /// @param in   The stream to read JPEG data from. Ownership is shared
-    ///             between caller and JpegImageInput, so it is freed
-    ///             automatically when the last owner is destroyed.
+       ///             between caller and JpegImageInput, so it is freed
+       ///             automatically when the last owner is destroyed.
        DSOEXPORT JpegImageInput(boost::shared_ptr<IOChannel> in);
 
-    /// Read the JPEG header information only.
-    //
-    /// @param maxHeaderBytes   The maximum number of bytes to read before
-    ///                         Stopping. If the header is shorter, we stop
-    ///                         early.
+       /// Read the JPEG header information only.
+       //
+       /// @param maxHeaderBytes   The maximum number of bytes to read before
+       ///                         Stopping. If the header is shorter, we stop
+       ///                         early.
        void DSOEXPORT readHeader(unsigned int maxHeaderBytes);
 
        ~JpegImageInput();
 
-    /// Begin processing the image data.
-    void read();
+       /// Begin processing the image data.
+       void read();
 
        /// Discard any data sitting in our input buffer.
-    //
-    /// Use this before/after reading headers or partial image
+       //
+       /// Use this before/after reading headers or partial image
        /// data, to avoid screwing up future reads.
        DSOEXPORT void discardPartialBuffer();
 
-    /// Complete processing the image and clean up.
-    //
-    /// This should close / free all resources from libjpeg.
+       /// Complete processing the image and clean up.
+       //
+       /// This should close / free all resources from libjpeg.
        void finishImage();
 
        /// Get the image's height in pixels.
-    //
-    /// @return     The height of the image in pixels.
+       //
+       /// @return     The height of the image in pixels.
        size_t getHeight() const;
 
        /// Get the image's width in pixels.
-    //
-    /// @return     The width of the image in pixels.
+       //
+       /// @return     The width of the image in pixels.
        size_t getWidth() const;
 
        /// Get number of components (channels)
-    //
+       //
        /// @return     The number of components, e.g. 3 for RGB
        size_t getComponents() const;
 
        /// Read a scanline's worth of image data into the given buffer.
-    //
-    /// The amount of data read is getWidth() * getComponents().
+       //
+       /// The amount of data read is getWidth() * getComponents().
        ///
-    /// @param rgbData  The buffer for writing raw RGB data to.
+       /// @param rgbData  The buffer for writing raw RGB data to.
        void readScanline(unsigned char* rgbData);
 
-    /// Create a JpegImageInput and transfer ownership to the caller.
-    //
-    /// @param in   The IOChannel to read JPEG data from.
-    static std::auto_ptr<ImageInput> create(boost::shared_ptr<IOChannel> in)
-    {
-        std::auto_ptr<ImageInput> ret ( new JpegImageInput(in) );
-        // might throw an exception (I guess)
-        if ( ret.get() ) ret->read();
-        return ret;
-    }
-
-    /// \brief
-    /// For reading SWF JPEG2-style image data, using pre-loaded
-    /// headers stored in the given jpeg::input object.
-    //
-    /// @param loader   The JpegImageInput object to use for reading the
-    ///                 data. This should have been constructed with
-    ///                 createSWFJpeg2HeaderOnly().
-    DSOEXPORT static std::auto_ptr<GnashImage> readSWFJpeg2WithTables(
-            JpegImageInput& loader);
-
-    /// Create a JPEG 'loader' object by reading a JPEG header.
-    //
-    /// This is for reusing the header information for different JPEGs images.
-    //
-    /// @param in               The channel to read JPEG header data from.
-    /// @param maxHeaderBytes   The maximum number of bytes to read.
-    static std::auto_ptr<JpegImageInput> createSWFJpeg2HeaderOnly(
-            boost::shared_ptr<IOChannel> in, unsigned int maxHeaderBytes)
-    {
-        std::auto_ptr<JpegImageInput> ret ( new JpegImageInput(in) );
-        // might throw an exception
-        if ( ret.get() ) ret->readHeader(maxHeaderBytes);
-        return ret;
-    }
-
-    /// This function is called when libjpeg encounters an error.
-    //
-    /// It is needed to avoid memory corruption during stack unwinding by
-    /// freeing libjpeg resources correctly before throwing an exception.
-    ///
-    /// @param msg  An error message for logging.
-    void errorOccurred(const char* msg);
+       /// Create a JpegImageInput and transfer ownership to the caller.
+       //
+       /// @param in   The IOChannel to read JPEG data from.
+       static std::auto_ptr<ImageInput> create(boost::shared_ptr<IOChannel> in)
+       {
+               std::auto_ptr<ImageInput> ret ( new JpegImageInput(in) );
+               // might throw an exception (I guess)
+               if ( ret.get() ) ret->read();
+               return ret;
+       }
+
+       /// \brief
+       /// For reading SWF JPEG2-style image data, using pre-loaded
+       /// headers stored in the given jpeg::input object.
+       //
+       /// @param loader   The JpegImageInput object to use for reading the
+       ///                 data. This should have been constructed with
+       ///                 createSWFJpeg2HeaderOnly().
+       DSOEXPORT static std::auto_ptr<GnashImage> readSWFJpeg2WithTables(
+                         JpegImageInput& loader);
+
+       /// Create a JPEG 'loader' object by reading a JPEG header.
+       //
+       /// This is for reusing the header information for different JPEGs 
images.
+       //
+       /// @param in               The channel to read JPEG header data from.
+       /// @param maxHeaderBytes   The maximum number of bytes to read.
+       static std::auto_ptr<JpegImageInput> createSWFJpeg2HeaderOnly(
+               boost::shared_ptr<IOChannel> in, unsigned int maxHeaderBytes)
+       {
+               std::auto_ptr<JpegImageInput> ret ( new JpegImageInput(in) );
+               // might throw an exception
+               if ( ret.get() ) ret->readHeader(maxHeaderBytes);
+               return ret;
+       }
+
+       /// This function is called when libjpeg encounters an error.
+       //
+       /// It is needed to avoid memory corruption during stack unwinding by
+       /// freeing libjpeg resources correctly before throwing an exception.
+       ///
+       /// @param msg  An error message for logging.
+       void errorOccurred(const char* msg);
 
 
 };
@@ -173,30 +173,30 @@
 
 public:
 
-    /// Constract a JpegImageOutput for writing to an IOChannel
-    //
-    /// @param out      The gnash::IOChannel to write the image to
-    /// @param width    The width of the resulting image
-    /// @param height   The height of the resulting image.
-    /// @param quality  The quality of the created image, from 1-100.
-    JpegImageOutput(boost::shared_ptr<IOChannel> out, size_t width,
-            size_t height, int quality);
+       /// Constract a JpegImageOutput for writing to an IOChannel
+       //
+       /// @param out      The gnash::IOChannel to write the image to
+       /// @param width    The width of the resulting image
+       /// @param height   The height of the resulting image.
+       /// @param quality  The quality of the created image, from 1-100.
+       JpegImageOutput(boost::shared_ptr<IOChannel> out, size_t width,
+               size_t height, int quality);
        
-    ~JpegImageOutput();
-
-    /// Write RGB image data using the parameters supplied at construction.
-    //
-    /// @param rgbData  The raw RGB image data to write as a JPEG.
-    void writeImageRGB(const unsigned char* rgbData);
-
-    /// Create a JpegImageOutput, transferring ownership to the caller.
-    //
-    /// @param out      The gnash::IOChannel to write the image to
-    /// @param width    The width of the resulting image
-    /// @param height   The height of the resulting image.
-    /// @param quality  The quality of the created image, from 1-100.
-    static std::auto_ptr<ImageOutput> create(boost::shared_ptr<IOChannel> out,
-            size_t width, size_t height, int quality);
+       ~JpegImageOutput();
+
+       /// Write RGB image data using the parameters supplied at construction.
+       //
+       /// @param rgbData  The raw RGB image data to write as a JPEG.
+       void writeImageRGB(const unsigned char* rgbData);
+
+       /// Create a JpegImageOutput, transferring ownership to the caller.
+       //
+       /// @param out      The gnash::IOChannel to write the image to
+       /// @param width    The width of the resulting image
+       /// @param height   The height of the resulting image.
+       /// @param quality  The quality of the created image, from 1-100.
+       static std::auto_ptr<ImageOutput> create(boost::shared_ptr<IOChannel> 
out,
+               size_t width, size_t height, int quality);
        
 private:
 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]