add support for png image file format

This commit is contained in:
David Rose 2004-03-17 01:06:49 +00:00
parent 1099342df8
commit 83a138529d
22 changed files with 599 additions and 636 deletions

View File

@ -215,11 +215,11 @@
#define JPEG_LIBS jpeg
#defer HAVE_JPEG $[libtest $[JPEG_LPATH],$[JPEG_LIBS]]
// Is libjasper installed, and where?
#define JPEG2000_IPATH
#define JPEG2000_LPATH
#define JPEG2000_LIBS jasper
#defer HAVE_JPEG2000 $[libtest $[JPEG2000_LPATH],$[JPEG2000_LIBS]]
// Is libpng installed, and where?
#define PNG_IPATH
#define PNG_LPATH
#define PNG_LIBS png
#defer HAVE_PNG $[libtest $[PNG_LPATH],$[PNG_LIBS]]
// Is libtiff installed, and where?
#define TIFF_IPATH

View File

@ -46,8 +46,8 @@ $[cdefine REPORT_OPENSSL_ERRORS]
/* Define if we have libjpeg installed. */
$[cdefine HAVE_JPEG]
/* Define if we have libjasper installed. */
$[cdefine HAVE_JPEG2000]
/* Define if we have libpng installed. */
$[cdefine HAVE_PNG]
/* Define if we have libtiff installed. */
$[cdefine HAVE_TIFF]

View File

@ -105,10 +105,10 @@
#set JPEG_LIBS $[JPEG_LIBS]
#set HAVE_JPEG $[HAVE_JPEG]
#set JPEG2000_IPATH $[unixfilename $[JPEG2000_IPATH]]
#set JPEG2000_LPATH $[unixfilename $[JPEG2000_LPATH]]
#set JPEG2000_LIBS $[JPEG2000_LIBS]
#set HAVE_JPEG2000 $[HAVE_JPEG2000]
#set PNG_IPATH $[unixfilename $[PNG_IPATH]]
#set PNG_LPATH $[unixfilename $[PNG_LPATH]]
#set PNG_LIBS $[PNG_LIBS]
#set HAVE_PNG $[HAVE_PNG]
#set TIFF_IPATH $[unixfilename $[TIFF_IPATH]]
#set TIFF_LPATH $[unixfilename $[TIFF_LPATH]]
@ -135,6 +135,12 @@
#set GL_LIBS $[GL_LIBS]
#set HAVE_GL $[HAVE_GL]
#set MESA_IPATH $[unixfilename $[MESA_IPATH]]
#set MESA_LPATH $[unixfilename $[MESA_LPATH]]
#set MESA_LIBS $[MESA_LIBS]
#set MESA_MGL $[MESA_MGL]
#set HAVE_MESA $[HAVE_MESA]
#set CHROMIUM_IPATH $[unixfilename $[CHROMIUM_IPATH]]
#set CHROMIUM_LPATH $[unixfilename $[CHROMIUM_LPATH]]
#set CHROMIUM_LIBS $[CHROMIUM_LIBS]

View File

@ -160,11 +160,11 @@
#define jpeg_libs $[JPEG_LIBS]
#endif
#if $[HAVE_JPEG2000]
#define jpeg2000_ipath $[wildcard $[JPEG2000_IPATH]]
#define jpeg2000_lpath $[wildcard $[JPEG2000_LPATH]]
#define jpeg2000_cflags $[JPEG2000_CFLAGS]
#define jpeg2000_libs $[JPEG2000_LIBS]
#if $[HAVE_PNG]
#define png_ipath $[wildcard $[PNG_IPATH]]
#define png_lpath $[wildcard $[PNG_LPATH]]
#define png_cflags $[PNG_CFLAGS]
#define png_libs $[PNG_LIBS]
#endif
#if $[HAVE_TIFF]

View File

@ -1,6 +1,6 @@
#define OTHER_LIBS interrogatedb:c dconfig:c dtoolconfig:m \
dtoolutil:c dtoolbase:c dtool:m
#define USE_PACKAGES tiff jpeg jpeg2000
#define USE_PACKAGES jpeg png zlib tiff
#begin lib_target
#define TARGET pnmimagetypes
@ -8,29 +8,27 @@
pnmimage
#define COMBINED_SOURCES \
$[TARGET]_composite1.cxx $[TARGET]_composite2.cxx \
$[if $[HAVE_JPEG], $[TARGET]_composite3.cxx] \
$[if $[HAVE_JPEG2000], $[TARGET]_composite4.cxx]
$[TARGET]_composite1.cxx $[TARGET]_composite2.cxx
#define SOURCES \
config_pnmimagetypes.h pnmFileTypeAlias.h pnmFileTypeBMP.h \
pnmFileTypeIMG.h \
pnmFileTypePNG.cxx pnmFileTypePNG.h \
pnmFileTypeSGI.h pnmFileTypeSoftImage.h \
pnmFileTypeTGA.h \
$[if $[HAVE_TIFF], pnmFileTypeTIFF.cxx pnmFileTypeTIFF.h] \
$[if $[HAVE_JPEG], pnmFileTypeJPG.h] \
$[if $[HAVE_JPEG2000], pnmFileTypeJPG2000.h]
pnmFileTypeTIFF.cxx pnmFileTypeTIFF.h \
pnmFileTypeJPG.h
#define INCLUDED_SOURCES \
config_pnmimagetypes.cxx pnmFileTypeAlias.cxx \
pnmFileTypeBMPReader.cxx pnmFileTypeBMPWriter.cxx \
pnmFileTypeIMG.cxx pnmFileTypeBMP.cxx \
pnmFileTypeSGI.cxx \
pnmFileTypeBMP.cxx \
pnmFileTypeIMG.cxx \
pnmFileTypeJPG.cxx pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx \
pnmFileTypeSGI.cxx \
pnmFileTypeSGIReader.cxx pnmFileTypeSGIWriter.cxx \
pnmFileTypeSoftImage.cxx \
pnmFileTypeTGA.cxx \
$[if $[HAVE_JPEG], pnmFileTypeJPG.cxx pnmFileTypeJPGReader.cxx pnmFileTypeJPGWriter.cxx] \
$[if $[HAVE_JPEG2000], pnmFileTypeJPG2000.cxx pnmFileTypeJPG2000Reader.cxx pnmFileTypeJPG2000Writer.cxx]
#define INSTALL_HEADERS \
config_pnmimagetypes.h

View File

@ -23,15 +23,9 @@
#include "pnmFileTypeIMG.h"
#include "pnmFileTypeSoftImage.h"
#include "pnmFileTypeBMP.h"
#ifdef HAVE_TIFF
#include "pnmFileTypeTIFF.h"
#endif
#ifdef HAVE_JPEG
#include "pnmFileTypeJPG.h"
#endif
#ifdef HAVE_JPEG2000
#include "pnmFileTypeJPG2000.h"
#endif
#include "pnmFileTypeJPG.h"
#include "pnmFileTypePNG.h"
#include "pnmFileTypeTIFF.h"
#include "sgi.h"
#include "config_pnmimage.h"
@ -42,13 +36,13 @@
Configure(config_pnmimagetypes);
NotifyCategoryDefName(pnmimage_sgi, "sgi", pnmimage_cat);
NotifyCategoryDefName(pnmimage_alias, "alias", pnmimage_cat);
NotifyCategoryDefName(pnmimage_tiff, "tiff", pnmimage_cat);
NotifyCategoryDefName(pnmimage_tga, "tga", pnmimage_cat);
NotifyCategoryDefName(pnmimage_img, "img", pnmimage_cat);
NotifyCategoryDefName(pnmimage_soft, "soft", pnmimage_cat);
NotifyCategoryDefName(pnmimage_bmp, "bmp", pnmimage_cat);
NotifyCategoryDefName(pnmimage_jpg, "jpg", pnmimage_cat);
NotifyCategoryDefName(pnmimage_jpg2000, "jpg2000", pnmimage_cat);
NotifyCategoryDefName(pnmimage_png, "png", pnmimage_cat);
NotifyCategoryDefName(pnmimage_tiff, "tiff", pnmimage_cat);
int sgi_storage_type = STORAGE_RLE;
const string sgi_imagename = config_pnmimagetypes.GetString("sgi-imagename", "");
@ -117,14 +111,14 @@ init_libpnmimagetypes() {
PNMFileTypeIMG::init_type();
PNMFileTypeSoftImage::init_type();
PNMFileTypeBMP::init_type();
#ifdef HAVE_TIFF
PNMFileTypeTIFF::init_type();
#endif
#ifdef HAVE_JPEG
PNMFileTypeJPG::init_type();
#endif
#ifdef HAVE_JPEG2000
PNMFileTypeJPG2000::init_type();
#ifdef HAVE_PNG
PNMFileTypePNG::init_type();
#endif
#ifdef HAVE_TIFF
PNMFileTypeTIFF::init_type();
#endif
string sgi_storage_type_str =
@ -160,14 +154,14 @@ init_libpnmimagetypes() {
tr->register_type(new PNMFileTypeIMG);
tr->register_type(new PNMFileTypeSoftImage);
tr->register_type(new PNMFileTypeBMP);
#ifdef HAVE_TIFF
tr->register_type(new PNMFileTypeTIFF);
#endif
#ifdef HAVE_JPEG
tr->register_type(new PNMFileTypeJPG);
#endif
#ifdef HAVE_JPEG2000
tr->register_type(new PNMFileTypeJPG2000);
#ifdef HAVE_PNG
tr->register_type(new PNMFileTypePNG);
#endif
#ifdef HAVE_TIFF
tr->register_type(new PNMFileTypeTIFF);
#endif
// Also register with the Bam reader.
@ -177,13 +171,13 @@ init_libpnmimagetypes() {
PNMFileTypeIMG::register_with_read_factory();
PNMFileTypeSoftImage::register_with_read_factory();
PNMFileTypeBMP::register_with_read_factory();
#ifdef HAVE_TIFF
PNMFileTypeTIFF::register_with_read_factory();
#endif
#ifdef HAVE_JPEG
PNMFileTypeJPG::register_with_read_factory();
#endif
#ifdef HAVE_JPEG2000
PNMFileTypeJPG2000::register_with_read_factory();
#ifdef HAVE_PNG
PNMFileTypePNG::register_with_read_factory();
#endif
#ifdef HAVE_TIFF
PNMFileTypeTIFF::register_with_read_factory();
#endif
}

View File

@ -30,7 +30,8 @@ NotifyCategoryDecl(pnmimage_img, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pnmimage_soft, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pnmimage_bmp, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pnmimage_jpg, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pnmimage_jpg2000, EXPCL_PANDA, EXPTP_PANDA);
NotifyCategoryDecl(pnmimage_png, EXPCL_PANDA, EXPTP_PANDA);
extern int sgi_storage_type;
extern const string sgi_imagename;

View File

@ -17,6 +17,9 @@
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG.h"
#ifdef HAVE_JPEG
#include "config_pnmimagetypes.h"
#include "pnmFileTypeRegistry.h"
@ -164,3 +167,5 @@ TypedWritable *PNMFileTypeJPG::
make_PNMFileTypeJPG(const FactoryParams &params) {
return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
}
#endif // HAVE_JPEG

View File

@ -21,6 +21,8 @@
#include "pandabase.h"
#ifdef HAVE_JPEG
#include "pnmFileType.h"
#include "pnmReader.h"
#include "pnmWriter.h"
@ -120,6 +122,7 @@ private:
static TypeHandle _type_handle;
};
#endif // HAVE_JPEG
#endif

View File

@ -1,166 +0,0 @@
// Filename: pnmFileTypeJPG2000.cxx
// Created by: mike (19Jun00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG2000.h"
#include "config_pnmimagetypes.h"
#include "pnmFileTypeRegistry.h"
#include "bamReader.h"
static const char * const extensions_jpg2000[] = {
"JP2","JPC"
};
static const int num_extensions_jpg2000 = sizeof(extensions_jpg2000) / sizeof(const char *);
TypeHandle PNMFileTypeJPG2000::_type_handle;
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypeJPG2000::
PNMFileTypeJPG2000() {
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::get_name
// Access: Public, Virtual
// Description: Returns a few words describing the file type.
////////////////////////////////////////////////////////////////////
string PNMFileTypeJPG2000::
get_name() const {
return "JPEG 2000";
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::get_num_extensions
// Access: Public, Virtual
// Description: Returns the number of different possible filename
// extensions_jpg2000 associated with this particular file type.
////////////////////////////////////////////////////////////////////
int PNMFileTypeJPG2000::
get_num_extensions() const {
return num_extensions_jpg2000;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::get_extension
// Access: Public, Virtual
// Description: Returns the nth possible filename extension
// associated with this particular file type, without a
// leading dot.
////////////////////////////////////////////////////////////////////
string PNMFileTypeJPG2000::
get_extension(int n) const {
nassertr(n >= 0 && n < num_extensions_jpg2000, string());
return extensions_jpg2000[n];
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::get_suggested_extension
// Access: Public, Virtual
// Description: Returns a suitable filename extension (without a
// leading dot) to suggest for files of this type, or
// empty string if no suggestions are available.
////////////////////////////////////////////////////////////////////
string PNMFileTypeJPG2000::
get_suggested_extension() const {
return "JP2";
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::has_magic_number
// Access: Public, Virtual
// Description: Returns true if this particular file type uses a
// magic number to identify it, false otherwise.
////////////////////////////////////////////////////////////////////
bool PNMFileTypeJPG2000::
has_magic_number() const {
return true;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::matches_magic_number
// Access: Public, Virtual
// Description: Returns true if the indicated "magic number" byte
// stream (the initial few bytes read from the file)
// matches this particular file type, false otherwise.
////////////////////////////////////////////////////////////////////
bool PNMFileTypeJPG2000::
matches_magic_number(const string &magic_number) const {
nassertr(magic_number.size() >= 2, false);
return ((char)magic_number[0] == (char)0xff &&
(char)magic_number[1] == (char)0xd8);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::make_reader
// Access: Public, Virtual
// Description: Allocates and returns a new PNMReader suitable for
// reading from this file type, if possible. If reading
// from this file type is not supported, returns NULL.
////////////////////////////////////////////////////////////////////
PNMReader *PNMFileTypeJPG2000::
make_reader(istream *file, bool owns_file, const string &magic_number) {
init_pnm();
return new Reader(this, file, owns_file, magic_number);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::make_writer
// Access: Public, Virtual
// Description: Allocates and returns a new PNMWriter suitable for
// reading from this file type, if possible. If writing
// files of this type is not supported, returns NULL.
////////////////////////////////////////////////////////////////////
PNMWriter *PNMFileTypeJPG2000::
make_writer(ostream *file, bool owns_file) {
init_pnm();
return new Writer(this, file, owns_file);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::register_with_read_factory
// Access: Public, Static
// Description: Registers the current object as something that can be
// read from a Bam file.
////////////////////////////////////////////////////////////////////
void PNMFileTypeJPG2000::
register_with_read_factory() {
BamReader::get_factory()->
register_factory(get_class_type(), make_PNMFileTypeJPG2000);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::make_PNMFileTypeJPG2000
// Access: Protected, Static
// Description: This method is called by the BamReader when an object
// of this type is encountered in a Bam file; it should
// allocate and return a new object with all the data
// read.
//
// In the case of the PNMFileType objects, since these
// objects are all shared, we just pull the object from
// the registry.
////////////////////////////////////////////////////////////////////
TypedWritable *PNMFileTypeJPG2000::
make_PNMFileTypeJPG2000(const FactoryParams &params) {
return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
}

View File

@ -1,166 +0,0 @@
// Filename: pnmFileTypeJPGReader.cxx
// Created by: mike (19Jun00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG2000.h"
#include "config_pnmimagetypes.h"
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Reader::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypeJPG2000::Reader::
Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number) :
PNMReader(type, file, owns_file)
{
// Put the magic number bytes back into the file
file->seekg(0);
/* Step 1: allocate and initialize JPEG decompression object */
/* We set up the normal JPEG error routines, then override error_exit. */
_cinfo.err = jpeg_std_error(&_jerr.pub);
/* Now we can initialize the JPEG decompression object. */
jpeg_create_decompress(&_cinfo);
/* Step 2: specify data source (eg, a file) */
// This is broken, and won't compile. We need to drop in an
// iostream replacement, like we did for JPG.
jpeg_stdio_src(&_cinfo, file);
/* Step 3: read file parameters with jpeg_read_header() */
jpeg_read_header(&_cinfo, TRUE);
/* We can ignore the return value from jpeg_read_header since
* (a) suspension is not possible with the stdio data source, and
* (b) we passed TRUE to reject a tables-only JPEG file as an error.
* See libjpeg.doc for more info.
*/
/* Step 4: set parameters for decompression */
_cinfo.scale_num = jpeg_scale_num;
_cinfo.scale_denom = jpeg_scale_denom;
/* Step 5: Start decompressor */
jpeg_start_decompress(&_cinfo);
/* We can ignore the return value since suspension is not possible
* with the stdio data source.
*/
_num_channels = _cinfo.output_components;
_x_size = (int)_cinfo.output_width;
_y_size = (int)_cinfo.output_height;
_maxval = MAXJSAMPLE;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Reader::Destructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypeJPG2000::Reader::
~Reader(void) {
jpeg_destroy_decompress(&_cinfo);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Reader::read_data
// Access: Public, Virtual
// Description: Reads in an entire image all at once, storing it in
// the pre-allocated _x_size * _y_size array and alpha
// pointers. (If the image type has no alpha channel,
// alpha is ignored.) Returns the number of rows
// correctly read.
//
// Derived classes need not override this if they
// instead provide supports_read_row() and read_row(),
// below.
////////////////////////////////////////////////////////////////////
int PNMFileTypeJPG2000::Reader::
read_data(xel *array, xelval *) {
JSAMPARRAY buffer; /* Output row buffer */
int row_stride; /* physical row width in output buffer */
nassertr(_cinfo.output_components == 1 || _cinfo.output_components == 3, 0);
/* We may need to do some setup of our own at this point before reading
* the data. After jpeg_start_decompress() we have the correct scaled
* output image dimensions available, as well as the output colormap
* if we asked for color quantization.
* In this example, we need to make an output work buffer of the right size.
*/
/* JSAMPLEs per row in output buffer */
row_stride = _cinfo.output_width * _cinfo.output_components;
/* Make a one-row-high sample array that will go away when done with image */
buffer = (*_cinfo.mem->alloc_sarray)
((j_common_ptr) &_cinfo, JPOOL_IMAGE, row_stride, 1);
/* Step 6: while (scan lines remain to be read) */
/* jpeg_read_scanlines(...); */
/* Here we use the library's state variable cinfo.output_scanline as the
* loop counter, so that we don't have to keep track ourselves.
*/
int x = 0;
while (_cinfo.output_scanline < _cinfo.output_height) {
/* jpeg_read_scanlines expects an array of pointers to scanlines.
* Here the array is only one element long, but you could ask for
* more than one scanline at a time if that's more convenient.
*/
jpeg_read_scanlines(&_cinfo, buffer, 1);
/* Assume put_scanline_someplace wants a pointer and sample count. */
//put_scanline_someplace(buffer[0], row_stride);
JSAMPROW bufptr = buffer[0];
for (int i = 0; i < row_stride; i += _cinfo.output_components) {
if (_cinfo.output_components == 1) {
xelval val = (xelval)bufptr[i];
nassertr(x < _x_size * _y_size, 0);
PNM_ASSIGN1(array[x], val);
} else {
xelval red, grn, blu;
red = (xelval)bufptr[i];
grn = (xelval)bufptr[i+1];
blu = (xelval)bufptr[i+2];
nassertr(x < _x_size * _y_size, 0);
PPM_ASSIGN(array[x], red, grn, blu);
}
x++;
}
}
/* Step 7: Finish decompression */
jpeg_finish_decompress(&_cinfo);
/* We can ignore the return value since suspension is not possible
* with the stdio data source.
*/
/* At this point you may want to check to see whether any corrupt-data
* warnings occurred (test whether jerr.pub.num_warnings is nonzero).
*/
if (_jerr.pub.num_warnings) {
pnmimage_jpg_cat.warning()
<< "Jpeg data may be corrupt" << endl;
}
return _y_size;
}

View File

@ -1,188 +0,0 @@
// Filename: pnmFileTypeJPGWriter.cxx
// Created by: mike (19Jun00)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG2000.h"
#include "config_pnmimagetypes.h"
#include "pnmImage.h"
#include "pnmWriter.h"
extern "C" {
#include <jpeglib.h>
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Writer::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypeJPG2000::Writer::
Writer(PNMFileType *type, ostream *file, bool owns_file) :
PNMWriter(type, file, owns_file)
{
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypeJPG2000::Writer::write_data
// Access: Public, Virtual
// Description: Writes out an entire image all at once, including the
// header, based on the image data stored in the given
// _x_size * _y_size array and alpha pointers. (If the
// image type has no alpha channel, alpha is ignored.)
// Returns the number of rows correctly written.
//
// It is the user's responsibility to fill in the header
// data via calls to set_x_size(), set_num_channels(),
// etc., or copy_header_from(), before calling
// write_data().
//
// It is important to delete the PNMWriter class after
// successfully writing the data. Failing to do this
// may result in some data not getting flushed!
//
// Derived classes need not override this if they
// instead provide supports_streaming() and write_row(),
// below.
////////////////////////////////////////////////////////////////////
int PNMFileTypeJPG2000::Writer::
write_data(xel *array, xelval *) {
if (_y_size<=0 || _x_size<=0) {
return 0;
}
/* This struct contains the JPEG compression parameters and pointers to
* working space (which is allocated as needed by the JPEG library).
* It is possible to have several such structures, representing multiple
* compression/decompression processes, in existence at once. We refer
* to any one struct (and its associated working data) as a "JPEG object".
*/
struct jpeg_compress_struct cinfo;
/* This struct represents a JPEG error handler. It is declared separately
* because applications often want to supply a specialized error handler
* (see the second half of this file for an example). But here we just
* take the easy way out and use the standard error handler, which will
* print a message on stderr and call exit() if compression fails.
* Note that this struct must live as long as the main JPEG parameter
* struct, to avoid dangling-pointer problems.
*/
struct jpeg_error_mgr jerr;
/* More stuff */
JSAMPROW row_pointer[1]; /* pointer to JSAMPLE row[s] */
int row_stride; /* physical row width in image buffer */
/* Step 1: allocate and initialize JPEG compression object */
/* We have to set up the error handler first, in case the initialization
* step fails. (Unlikely, but it could happen if you are out of memory.)
* This routine fills in the contents of struct jerr, and returns jerr's
* address which we place into the link field in cinfo.
*/
cinfo.err = jpeg_std_error(&jerr);
/* Now we can initialize the JPEG compression object. */
jpeg_create_compress(&cinfo);
/* Step 2: specify data destination (eg, a file) */
/* Note: steps 2 and 3 can be done in either order. */
/* Here we use the library-supplied code to send compressed data to a
* stdio stream. You can also write your own code to do something else.
* VERY IMPORTANT: use "b" option to fopen() if you are on a machine that
* requires it in order to write binary files.
*/
// This is broken, and won't compile. We need to drop in an
// iostream replacement, like we did for JPG.
jpeg_stdio_dest(&cinfo, _file);
/* Step 3: set parameters for compression */
/* First we supply a description of the input image.
* Four fields of the cinfo struct must be filled in:
*/
cinfo.image_width = _x_size; /* image width and height, in pixels */
cinfo.image_height = _y_size;
if (is_grayscale()) {
cinfo.input_components = 1;
cinfo.in_color_space = JCS_GRAYSCALE;
} else {
cinfo.input_components = 3;
cinfo.in_color_space = JCS_RGB;
}
/* Now use the library's routine to set default compression parameters.
* (You must set at least cinfo.in_color_space before calling this,
* since the defaults depend on the source color space.)
*/
jpeg_set_defaults(&cinfo);
/* Now you can set any non-default parameters you wish to.
* Here we just illustrate the use of quality (quantization table) scaling:
*/
jpeg_set_quality(&cinfo, jpeg_quality, TRUE /* limit to baseline-JPEG values */);
/* Step 4: Start compressor */
/* TRUE ensures that we will write a complete interchange-JPEG file.
* Pass TRUE unless you are very sure of what you're doing.
*/
jpeg_start_compress(&cinfo, TRUE);
/* Step 5: while (scan lines remain to be written) */
/* jpeg_write_scanlines(...); */
/* Here we use the library's state variable cinfo.next_scanline as the
* loop counter, so that we don't have to keep track ourselves.
* To keep things simple, we pass one scanline per call; you can pass
* more if you wish, though.
*/
row_stride = _x_size * cinfo.input_components; /* JSAMPLEs per row in image_buffer */
int x = 0;
JSAMPROW row = new JSAMPLE[row_stride];
while (cinfo.next_scanline < cinfo.image_height) {
/* jpeg_write_scanlines expects an array of pointers to scanlines.
* Here the array is only one element long, but you could pass
* more than one scanline at a time if that's more convenient.
*/
for (int i = 0; i < row_stride; i += cinfo.input_components) {
if (cinfo.input_components == 1) {
row[i] = (JSAMPLE)(MAXJSAMPLE * PPM_GETB(array[x])/_maxval);
} else {
row[i] = (JSAMPLE)(MAXJSAMPLE * PPM_GETR(array[x])/_maxval);
row[i+1] = (JSAMPLE)(MAXJSAMPLE * PPM_GETG(array[x])/_maxval);
row[i+2] = (JSAMPLE)(MAXJSAMPLE * PPM_GETB(array[x])/_maxval);
}
x++;
}
//row_pointer[0] = & image_buffer[cinfo.next_scanline * row_stride];
//(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
row_pointer[0] = row;
(void) jpeg_write_scanlines(&cinfo, row_pointer, 1);
}
delete row;
/* Step 6: Finish compression */
jpeg_finish_compress(&cinfo);
/* Step 7: release JPEG compression object */
/* This is an important step since it will release a good deal of memory. */
jpeg_destroy_compress(&cinfo);
return _y_size;
}

View File

@ -17,6 +17,9 @@
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG.h"
#ifdef HAVE_JPEG
#include "config_pnmimagetypes.h"
@ -407,3 +410,5 @@ read_data(xel *array, xelval *) {
return _y_size;
}
#endif // HAVE_JPEG

View File

@ -17,6 +17,9 @@
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeJPG.h"
#ifdef HAVE_JPEG
#include "config_pnmimagetypes.h"
#include "pnmImage.h"
@ -339,3 +342,5 @@ write_data(xel *array, xelval *) {
return _y_size;
}
#endif // HAVE_JPEG

View File

@ -0,0 +1,478 @@
// Filename: pnmFileTypePNG.cxx
// Created by: drose (16Mar04)
//
////////////////////////////////////////////////////////////////////
//
// PANDA 3D SOFTWARE
// Copyright (c) 2001 - 2004, Disney Enterprises, Inc. All rights reserved
//
// All use of this software is subject to the terms of the Panda 3d
// Software license. You should have received a copy of this license
// along with this source code; you will also find a current copy of
// the license at http://etc.cmu.edu/panda3d/docs/license/ .
//
// To contact the maintainers of this program write to
// panda3d-general@lists.sourceforge.net .
//
////////////////////////////////////////////////////////////////////
#include "pnmFileTypePNG.h"
#ifdef HAVE_PNG
#include "config_pnmimagetypes.h"
#include "pnmFileTypeRegistry.h"
#include "bamReader.h"
#include "ppmcmap.h"
static const char * const extensions_png[] = {
"png"
};
static const int num_extensions_png = sizeof(extensions_png) / sizeof(const char *);
TypeHandle PNMFileTypePNG::_type_handle;
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypePNG::
PNMFileTypePNG() {
// This constructor may run at static init time, so we use the ->
// dereferencing convention on the notify category.
if (pnmimage_png_cat->is_debug()) {
pnmimage_png_cat->debug()
<< "PNG version " << png_libpng_ver << "\n";
}
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::get_name
// Access: Public, Virtual
// Description: Returns a few words describing the file type.
////////////////////////////////////////////////////////////////////
string PNMFileTypePNG::
get_name() const {
return "PNG";
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::get_num_extensions
// Access: Public, Virtual
// Description: Returns the number of different possible filename
// extensions associated with this particular file type.
////////////////////////////////////////////////////////////////////
int PNMFileTypePNG::
get_num_extensions() const {
return num_extensions_png;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::get_extension
// Access: Public, Virtual
// Description: Returns the nth possible filename extension
// associated with this particular file type, without a
// leading dot.
////////////////////////////////////////////////////////////////////
string PNMFileTypePNG::
get_extension(int n) const {
nassertr(n >= 0 && n < num_extensions_png, string());
return extensions_png[n];
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::get_suggested_extension
// Access: Public, Virtual
// Description: Returns a suitable filename extension (without a
// leading dot) to suggest for files of this type, or
// empty string if no suggestions are available.
////////////////////////////////////////////////////////////////////
string PNMFileTypePNG::
get_suggested_extension() const {
return "png";
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::has_magic_number
// Access: Public, Virtual
// Description: Returns true if this particular file type uses a
// magic number to identify it, false otherwise.
////////////////////////////////////////////////////////////////////
bool PNMFileTypePNG::
has_magic_number() const {
return true;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::matches_magic_number
// Access: Public, Virtual
// Description: Returns true if the indicated "magic number" byte
// stream (the initial few bytes read from the file)
// matches this particular file type, false otherwise.
////////////////////////////////////////////////////////////////////
bool PNMFileTypePNG::
matches_magic_number(const string &magic_number) const {
return png_sig_cmp((png_bytep)magic_number.data(), 0, magic_number.length()) == 0;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::make_reader
// Access: Public, Virtual
// Description: Allocates and returns a new PNMReader suitable for
// reading from this file type, if possible. If reading
// from this file type is not supported, returns NULL.
////////////////////////////////////////////////////////////////////
PNMReader *PNMFileTypePNG::
make_reader(istream *file, bool owns_file, const string &magic_number) {
return new Reader(this, file, owns_file, magic_number);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::make_writer
// Access: Public, Virtual
// Description: Allocates and returns a new PNMWriter suitable for
// reading from this file type, if possible. If writing
// files of this type is not supported, returns NULL.
////////////////////////////////////////////////////////////////////
PNMWriter *PNMFileTypePNG::
make_writer(ostream *file, bool owns_file) {
// return new Writer(this, file, owns_file);
return NULL;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::register_with_read_factory
// Access: Public, Static
// Description: Registers the current object as something that can be
// read from a Bam file.
////////////////////////////////////////////////////////////////////
void PNMFileTypePNG::
register_with_read_factory() {
BamReader::get_factory()->
register_factory(get_class_type(), make_PNMFileTypePNG);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::make_PNMFileTypePNG
// Access: Protected, Static
// Description: This method is called by the BamReader when an object
// of this type is encountered in a Bam file; it should
// allocate and return a new object with all the data
// read.
//
// In the case of the PNMFileType objects, since these
// objects are all shared, we just pull the object from
// the registry.
////////////////////////////////////////////////////////////////////
TypedWritable *PNMFileTypePNG::
make_PNMFileTypePNG(const FactoryParams &params) {
return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::Constructor
// Access: Public
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypePNG::Reader::
Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number) :
PNMReader(type, file, owns_file)
{
_png = NULL;
_info = NULL;
_is_valid = false;
_png = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
png_error, png_warning);
if (_png == NULL) {
return;
}
_info = png_create_info_struct(_png);
if (_info == NULL) {
png_destroy_read_struct(&_png, NULL, NULL);
return;
}
_is_valid = true;
if (setjmp(_jmpbuf)) {
// This is the ANSI C way to handle exceptions. If setjmp(),
// above, returns true, it means that libpng detected an exception
// while executing the code that reads the header info, below.
free_png();
return;
}
png_set_read_fn(_png, (void *)this, png_read_data);
png_set_sig_bytes(_png, magic_number.length());
png_read_info(_png, _info);
png_uint_32 width;
png_uint_32 height;
int bit_depth;
int color_type;
png_get_IHDR(_png, _info, &width, &height,
&bit_depth, &color_type, NULL, NULL, NULL);
pnmimage_png_cat.debug()
<< "width = " << width << " height = " << height << " bit_depth = "
<< bit_depth << " color_type = " << color_type << "\n";
_x_size = width;
_y_size = height;
_maxval = ( 1 << bit_depth ) - 1;
if (bit_depth < 8) {
png_set_packing(_png);
}
switch (color_type) {
case PNG_COLOR_TYPE_GRAY:
pnmimage_png_cat.debug()
<< "PNG_COLOR_TYPE_GRAY\n";
_num_channels = 1;
break;
case PNG_COLOR_TYPE_GRAY_ALPHA:
pnmimage_png_cat.debug()
<< "PNG_COLOR_TYPE_GRAY_ALPHA\n";
_num_channels = 2;
break;
case PNG_COLOR_TYPE_RGB:
pnmimage_png_cat.debug()
<< "PNG_COLOR_TYPE_RGB\n";
_num_channels = 3;
break;
case PNG_COLOR_TYPE_RGB_ALPHA:
pnmimage_png_cat.debug()
<< "PNG_COLOR_TYPE_RGB_ALPHA\n";
_num_channels = 4;
break;
case PNG_COLOR_TYPE_PALETTE:
pnmimage_png_cat.debug()
<< "PNG_COLOR_TYPE_PALETTE\n";
png_set_palette_to_rgb(_png);
_maxval = 255;
_num_channels = 3;
return;
default:
pnmimage_png_cat.error()
<< "Unsupported color type: " << color_type << "\n";
free_png();
return;
}
if (png_get_valid(_png, _info, PNG_INFO_tRNS)) {
png_set_tRNS_to_alpha(_png);
if (!has_alpha()) {
_num_channels++;
}
}
png_read_update_info(_png, _info);
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::Destructor
// Access: Public, Virtual
// Description:
////////////////////////////////////////////////////////////////////
PNMFileTypePNG::Reader::
~Reader() {
free_png();
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::read_data
// Access: Public, Virtual
// Description: Reads in an entire image all at once, storing it in
// the pre-allocated _x_size * _y_size array and alpha
// pointers. (If the image type has no alpha channel,
// alpha is ignored.) Returns the number of rows
// correctly read.
//
// Derived classes need not override this if they
// instead provide supports_read_row() and read_row(),
// below.
////////////////////////////////////////////////////////////////////
int PNMFileTypePNG::Reader::
read_data(xel *array, xelval *alpha_data) {
if (!is_valid()) {
return 0;
}
if (setjmp(_jmpbuf)) {
// This is the ANSI C way to handle exceptions. If setjmp(),
// above, returns true, it means that libpng detected an exception
// while executing the code that reads the image, below.
free_png();
return 0;
}
int row_byte_length = _x_size * _num_channels;
if (_maxval > 255) {
row_byte_length *= 2;
}
int num_rows = _y_size;
if (pnmimage_png_cat.is_debug()) {
pnmimage_png_cat.debug()
<< "Allocating " << num_rows << " rows of " << row_byte_length
<< " bytes each.\n";
}
// We need to read a full copy of the image in first, in libpng's
// 2-d array format, mainly because we keep array and alpha data
// separately, and there doesn't appear to be good support to get
// this stuff out row-at-a-time for interlaced files.
png_bytep *rows = new png_bytep[num_rows];
int yi;
for (yi = 0; yi < num_rows; yi++) {
rows[yi] = new png_byte[row_byte_length];
}
png_read_image(_png, rows);
bool get_color = !is_grayscale();
bool get_alpha = has_alpha();
int pi = 0;
for (yi = 0; yi < num_rows; yi++) {
png_bytep source = rows[yi];
for (int xi = 0; xi < _x_size; xi++) {
int red, green, blue, alpha;
if (_maxval > 255) {
if (get_color) {
red = (source[0] << 16) | source[1];
source += 2;
green = (source[0] << 16) | source[1];
source += 2;
}
blue = (source[0] << 16) | source[1];
source += 2;
if (get_alpha) {
alpha = (source[0] << 16) | source[1];
source += 2;
}
} else {
if (get_color) {
red = *source;
source++;
green = *source;
source++;
}
blue = *source;
source++;
if (get_alpha) {
alpha = *source;
source++;
}
}
PPM_ASSIGN(array[pi], red, green, blue);
if (get_alpha) {
alpha_data[pi] = alpha;
}
pi++;
}
nassertr(source <= rows[yi] + row_byte_length, yi);
delete[] rows[yi];
}
delete[] rows;
png_read_end(_png, NULL);
return _y_size;
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::free_png
// Access: Private
// Description: Releases the internal PNG structures and marks the
// reader invalid.
////////////////////////////////////////////////////////////////////
void PNMFileTypePNG::Reader::
free_png() {
if (_is_valid) {
png_destroy_read_struct(&_png, &_info, NULL);
_is_valid = false;
}
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::png_read_data
// Access: Private, Static
// Description: A callback handler that PNG uses to read data from
// the iostream.
////////////////////////////////////////////////////////////////////
void PNMFileTypePNG::Reader::
png_read_data(png_structp png_ptr, png_bytep data, png_size_t length) {
Reader *self = (Reader *)png_get_io_ptr(png_ptr);
self->_file->read((char *)data, length);
if (self->_file->gcount() != length) {
pnmimage_png_cat.error()
<< "Didn't read enough bytes.\n";
// Is there no way to indicate a read failure to libpng?
}
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::png_warning
// Access: Private, Static
// Description: This is our own warning handler. It is called by the
// png library to issue a warning message.
////////////////////////////////////////////////////////////////////
void PNMFileTypePNG::Reader::
png_warning(png_structp, png_const_charp warning_msg) {
pnmimage_png_cat.warning()
<< warning_msg << "\n";
}
////////////////////////////////////////////////////////////////////
// Function: PNMFileTypePNG::Reader::png_error
// Access: Private, Static
// Description: This is our own error handler. It is called by the
// png library to issue a fatal error message.
////////////////////////////////////////////////////////////////////
void PNMFileTypePNG::Reader::
png_error(png_structp png_ptr, png_const_charp error_msg) {
pnmimage_png_cat.error()
<< error_msg << "\n";
// The PNG library insists we should not return, so instead of
// returning, we will do a longjmp out of the png code.
Reader *self = (Reader *)png_get_io_ptr(png_ptr);
if (self == (Reader *)NULL) {
// Oops, we haven't got a self pointer yet. Return anyway and
// hope we'll be ok.
pnmimage_png_cat.error()
<< "Returning before opening file.\n";
return;
}
longjmp(self->_jmpbuf, true);
}
#endif // HAVE_PNG

View File

@ -1,5 +1,5 @@
// Filename: pnmFileTypeJPG2000.h
// Created by: mike (17Jun00)
// Filename: pnmFileTypePNG.h
// Created by: drose (16Mar04)
//
////////////////////////////////////////////////////////////////////
//
@ -16,32 +16,26 @@
//
////////////////////////////////////////////////////////////////////
#ifndef PNMFILETYPEJPG2000_H
#define PNMFILETYPEJPG2000_H
#ifndef PNMFILETYPEPNG_H
#define PNMFILETYPEPNG_H
#include "pandabase.h"
#ifdef HAVE_PNG
#include "pnmFileType.h"
#include "pnmReader.h"
#include "pnmWriter.h"
#if defined(_WIN32)
#include <windows.h> // we need to include this before jpeglib.
#endif
#include "typedef.h" // jasper requires this first.
#include <jasper/jasper.h>
// Undo jasper-inflicted damage.
#undef bool
#include <png.h>
////////////////////////////////////////////////////////////////////
// Class : PNMFileTypeJPG2000
// Description : For reading and writing Jpeg2000 files.
// Class : PNMFileTypePNG
// Description : For reading and writing PNG files.
////////////////////////////////////////////////////////////////////
class EXPCL_PANDA PNMFileTypeJPG2000 : public PNMFileType {
class EXPCL_PANDA PNMFileTypePNG : public PNMFileType {
public:
PNMFileTypeJPG2000();
PNMFileTypePNG();
virtual string get_name() const;
@ -60,52 +54,47 @@ public:
class Reader : public PNMReader {
public:
Reader(PNMFileType *type, istream *file, bool owns_file, string magic_number);
~Reader(void);
virtual ~Reader();
virtual int read_data(xel *array, xelval *alpha);
virtual int read_data(xel *array, xelval *alpha_data);
private:
/*
// struct jpeg_decompress_struct _cinfo;
jas_image_t *image;
jas_stream_t *in;
jas_stream_t *out;
*/
void free_png();
static void png_read_data(png_structp png_ptr, png_bytep data,
png_size_t length);
static void png_error(png_structp png_ptr, png_const_charp error_msg);
static void png_warning(png_structp png_ptr, png_const_charp warning_msg);
struct my_error_mgr {
struct jpeg_error_mgr pub;
jmp_buf setjmp_buffer;
};
typedef struct my_error_mgr *_my_error_ptr;
struct my_error_mgr _jerr;
unsigned long pos;
png_structp _png;
png_infop _info;
unsigned long offBits;
unsigned short cBitCount;
int indexed;
int classv;
pixval R[256]; /* reds */
pixval G[256]; /* greens */
pixval B[256]; /* blues */
// We need a jmp_buf to support libpng's fatal error handling, in
// which the error handler must not immediately leave libpng code,
// but must return to the caller in Panda.
jmp_buf _jmpbuf;
};
/*
class Writer : public PNMWriter {
public:
Writer(PNMFileType *type, ostream *file, bool owns_file);
virtual int write_data(xel *array, xelval *alpha);
};
private:
static void png_write_data(png_structp png_ptr, png_bytep data,
png_size_t length);
static void png_flush_data(png_structp png_ptr);
};
*/
// The TypedWritable interface follows.
public:
static void register_with_read_factory();
protected:
static TypedWritable *make_PNMFileTypeJPG2000(const FactoryParams &params);
static TypedWritable *make_PNMFileTypePNG(const FactoryParams &params);
public:
static TypeHandle get_class_type() {
@ -113,7 +102,7 @@ public:
}
static void init_type() {
PNMFileType::init_type();
register_type(_type_handle, "PNMFileTypeJPG2000",
register_type(_type_handle, "PNMFileTypePNG",
PNMFileType::get_class_type());
}
virtual TypeHandle get_type() const {
@ -125,6 +114,6 @@ private:
static TypeHandle _type_handle;
};
#endif // HAVE_PNG
#endif

View File

@ -17,6 +17,9 @@
////////////////////////////////////////////////////////////////////
#include "pnmFileTypeTIFF.h"
#ifdef HAVE_TIFF
#include "config_pnmimagetypes.h"
#include "pnmFileTypeRegistry.h"
@ -217,7 +220,7 @@ TypeHandle PNMFileTypeTIFF::_type_handle;
////////////////////////////////////////////////////////////////////
PNMFileTypeTIFF::
PNMFileTypeTIFF() {
// This constructor may run at static init type, so we use the ->
// This constructor may run at static init time, so we use the ->
// dereferencing convention on the notify category.
if (pnmimage_tiff_cat->is_debug()) {
pnmimage_tiff_cat->debug()
@ -987,3 +990,5 @@ TypedWritable *PNMFileTypeTIFF::
make_PNMFileTypeTIFF(const FactoryParams &params) {
return PNMFileTypeRegistry::get_ptr()->get_type_by_handle(get_class_type());
}
#endif // HAVE_TIFF

View File

@ -21,6 +21,8 @@
#include "pandabase.h"
#ifdef HAVE_TIFF
#include "pnmFileType.h"
#include "pnmReader.h"
#include "pnmWriter.h"
@ -108,6 +110,6 @@ private:
static TypeHandle _type_handle;
};
#endif // HAVE_TIFF
#endif

View File

@ -5,5 +5,6 @@
#include "pnmFileTypeBMPWriter.cxx"
#include "pnmFileTypeIMG.cxx"
#include "pnmFileTypeBMP.cxx"
#include "pnmFileTypeJPG.cxx"
#include "pnmFileTypeJPGReader.cxx"
#include "pnmFileTypeJPGWriter.cxx"

View File

@ -4,3 +4,4 @@
#include "pnmFileTypeSGIWriter.cxx"
#include "pnmFileTypeSoftImage.cxx"
#include "pnmFileTypeTGA.cxx"

View File

@ -1,5 +0,0 @@
#include "pnmFileTypeJPG.cxx"
#include "pnmFileTypeJPGReader.cxx"
#include "pnmFileTypeJPGWriter.cxx"

View File

@ -1,5 +0,0 @@
#include "pnmFileTypeJPG2000.cxx"
#include "pnmFileTypeJPG2000Reader.cxx"
#include "pnmFileTypeJPG2000Writer.cxx"