VideoTools
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Macros Pages
grjpeg_none.cpp
Go to the documentation of this file.
1 //
2 // Copyright (C) 2017 Graeme Walker
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU General Public License as published by
6 // the Free Software Foundation, either version 3 of the License, or
7 // (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU General Public License for more details.
13 //
14 // You should have received a copy of the GNU General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
16 // ===
17 //
18 // grjpeg_none.cpp
19 //
20 
21 #include "gdef.h"
22 #include "grjpeg.h"
23 #include <stdexcept>
24 
25 static const char * help = ": install libjpeg and re-run configure" ;
26 bool Gr::Jpeg::available() { return false ; }
27 class Gr::JpegReaderImp {} ;
28 Gr::JpegReader::JpegReader( int , bool ) {}
30 void Gr::JpegReader::setup( int , bool ) { throw Jpeg::Error( "jpegreader not implemented" + std::string(help) ) ; }
31 void Gr::JpegReader::decode( ImageData & , const G::Path & ) { throw Jpeg::Error( "jpegreader not implemented" + std::string(help) ) ; }
32 void Gr::JpegReader::decode( ImageData & , const unsigned char * , size_t ) { throw Jpeg::Error( "jpegreader not implemented" + std::string(help) ) ; }
33 void Gr::JpegReader::decode( ImageData & , const char * , size_t ) { throw Jpeg::Error( "jpegreader not implemented" + std::string(help) ) ; }
34 void Gr::JpegReader::decode( ImageData & out , const ImageBuffer & ) { throw Jpeg::Error( "jpegreader not implemented" + std::string(help) ) ; }
35 ;
36 //
37 class Gr::JpegWriterImp {} ;
38 Gr::JpegWriter::JpegWriter( int , bool ) {}
40 void Gr::JpegWriter::setup( int , bool ) { throw Jpeg::Error( "jpegwriter not implemented" ) ; }
41 void Gr::JpegWriter::encode( const ImageData & , const G::Path & ) {}
42 void Gr::JpegWriter::encode( const ImageData & , std::vector<char> & ) {}
43 void Gr::JpegWriter::encode( const ImageData & , ImageBuffer & ) {}
44 /// \file grjpeg_none.cpp
void encode(const ImageData &in, const G::Path &path_out)
Encodes to a file.
A private pimple class for Gr::JpegWriter.
Vectors ImageBuffer
An ImageBuffer is used to hold raw image data, typically in more than one chunk.
Definition: grimagebuffer.h:47
void setup(int scale, bool monochrome_out=false)
Sets the decoding scale factor.
~JpegReader()
Destructor.
static bool available()
Returns true if a jpeg library is available.
A private implementation class for Gr::JpegReader.
~JpegWriter()
Destructor.
void decode(ImageData &out, const G::Path &in)
Decodes a jpeg file into an image. Throws on error.
JpegReader(int scale=1, bool monochrome_out=false)
Constructor.
void setup(int scale, bool monochrome_out=false)
Sets the encoding scale factor.
JpegWriter(int scale=1, bool monochrome_out=false)
Constructor.
A Path object represents a file system path.
Definition: gpath.h:72