Merge from trunk, revisions 3910-3943. Also added the two missing new files from former merges. Seems that a broken and not properly cleaned merge broke the adding. Files were merged correctly, though, into the local directory. Other changes were updates of the support libs and several bug fixes and optimizations.

git-svn-id: svn://svn.code.sf.net/p/irrlicht/code/branches/ogl-es@3944 dfc29bdd-3216-0410-991c-e03cc46cb475
master
hybrid 2011-10-16 10:48:26 +00:00
parent 5caf2b4045
commit 15c3dc795a
199 changed files with 40772 additions and 14916 deletions

View File

@ -349,6 +349,32 @@ void updateToolBox()
}
}
void onKillFocus()
{
// Avoid that the FPS-camera continues moving when the user presses alt-tab while
// moving the camera.
const core::list<scene::ISceneNodeAnimator*>& animators = Camera[1]->getAnimators();
core::list<irr::scene::ISceneNodeAnimator*>::ConstIterator iter = animators.begin();
while ( iter != animators.end() )
{
if ( (*iter)->getType() == scene::ESNAT_CAMERA_FPS )
{
// we send a key-down event for all keys used by this animator
scene::ISceneNodeAnimatorCameraFPS * fpsAnimator = static_cast<scene::ISceneNodeAnimatorCameraFPS*>(*iter);
const core::array<SKeyMap>& keyMap = fpsAnimator->getKeyMap();
for ( irr::u32 i=0; i< keyMap.size(); ++i )
{
irr::SEvent event;
event.EventType = EET_KEY_INPUT_EVENT;
event.KeyInput.Key = keyMap[i].KeyCode;
event.KeyInput.PressedDown = false;
fpsAnimator->OnEvent(event);
}
}
++iter;
}
}
/*
To get all the events sent by the GUI Elements, we need to create an event
receiver. This one is really simple. If an event occurs, it checks the id of
@ -930,10 +956,19 @@ int main(int argc, char* argv[])
img->setAlignment(EGUIA_UPPERLEFT, EGUIA_UPPERLEFT,
EGUIA_LOWERRIGHT, EGUIA_LOWERRIGHT);
// remember state so we notice when the window does lose the focus
bool hasFocus = Device->isWindowFocused();
// draw everything
while(Device->run() && driver)
{
// Catch focus changes (workaround until Irrlicht has events for this)
bool focused = Device->isWindowFocused();
if ( hasFocus && !focused )
onKillFocus();
hasFocus = focused;
if (Device->isWindowActive())
{
driver->beginScene(true, true, video::SColor(150,50,50,50));

View File

@ -0,0 +1,249 @@
// Copyright (C) 2002-2011 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
#define __IRR_I_COLLADA_MESH_WRITER_H_INCLUDED__
#include "IMeshWriter.h"
#include "ISceneNode.h"
#include "IAnimatedMesh.h"
#include "SMaterial.h"
namespace irr
{
namespace io
{
class IWriteFile;
} // end namespace io
namespace scene
{
//! Lighting models - more or less the way Collada categorizes materials
enum E_COLLADA_TECHNIQUE_FX
{
//! Blinn-phong which is default for opengl and dx fixed function pipelines.
//! But several well-known renderers don't support it and prefer phong.
ECTF_BLINN,
//! Phong shading, default in many external renderers.
ECTF_PHONG,
//! diffuse shaded surface that is independent of lighting.
ECTF_LAMBERT,
// constantly shaded surface that is independent of lighting.
ECTF_CONSTANT
};
//! How to interpret the opacity in collada
enum E_COLLADA_TRANSPARENT_FX
{
//! default - only alpha channel of color or texture is used.
ECOF_A_ONE = 0,
//! Alpha values for each RGB channel of color or texture are used.
ECOF_RGB_ZERO = 1
};
//! Color names collada uses in it's color samplers
enum E_COLLADA_COLOR_SAMPLER
{
ECCS_DIFFUSE,
ECCS_AMBIENT,
ECCS_EMISSIVE,
ECCS_SPECULAR,
ECCS_TRANSPARENT,
ECCS_REFLECTIVE
};
//! Irrlicht colors which can be mapped to E_COLLADA_COLOR_SAMPLER values
enum E_COLLADA_IRR_COLOR
{
//! Don't write this element at all
ECIC_NONE,
//! Check IColladaMeshWriterProperties for custom color
ECIC_CUSTOM,
//! Use SMaterial::DiffuseColor
ECIC_DIFFUSE,
//! Use SMaterial::AmbientColor
ECIC_AMBIENT,
//! Use SMaterial::EmissiveColor
ECIC_EMISSIVE,
//! Use SMaterial::SpecularColor
ECIC_SPECULAR
};
//! Callback interface for properties which can be used to influence collada writing
//! NOTE: Interface is still work in process and might change some more before 1.8 release
class IColladaMeshWriterProperties : public virtual IReferenceCounted
{
public:
virtual ~IColladaMeshWriterProperties () {}
//! Which lighting model should be used in the technique (FX) section when exporting effects (materials)
virtual E_COLLADA_TECHNIQUE_FX getTechniqueFx(const video::SMaterial& material) const = 0;
//! Which texture index should be used when writing the texture of the given sampler color.
/** \return the index to the texture-layer or -1 if that texture should never be exported
Note: for ECCS_TRANSPARENT by default the alpha channel is used, if you want to use RGB you have to set
also the ECOF_RGB_ZERO flag in getTransparentFx. */
virtual s32 getTextureIdx(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return which color from Irrlicht should be used for the color requested by collada
/** Note that collada allows exporting either texture or color, not both.
So color mapping is only checked if we have no valid texture already.
By default we try to return best fits when possible. For example ECCS_DIFFUSE is mapped to ECIC_DIFFUSE.
When ECIC_CUSTOM is returned then the result of getCustomColor will be used. */
virtual E_COLLADA_IRR_COLOR getColorMapping(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return custom colors for certain color types requested by collada.
/** Only used when getColorMapping returns ECIC_CUSTOM for the same paramters. */
virtual video::SColor getCustomColor(const video::SMaterial & material, E_COLLADA_COLOR_SAMPLER cs) const = 0;
//! Return the transparence color interpretation.
/** Not this is only about ECCS_TRANSPARENT and does not affect getTransparency. */
virtual E_COLLADA_TRANSPARENT_FX getTransparentFx(const video::SMaterial& material) const = 0;
//! Transparency value for that material.
/** This value is additional to transparent settings, if both are set they will be multiplicated.
\return 1.0 for fully transparent, 0.0 for not transparent and not written at all when < 0.f */
virtual f32 getTransparency(const video::SMaterial& material) const = 0;
//! Reflectivity value for that material
/** The amount of perfect mirror reflection to be added to the reflected light
\return 0.0 - 1.0 for reflectivity and element is not written at all when < 0.f */
virtual f32 getReflectivity(const video::SMaterial& material) const = 0;
//! Return index of refraction for that material
/** By default we don't write that.
\return a value >= 0.f to write <index_of_refraction> when it's < 0 nothing will be written */
virtual f32 getIndexOfRefraction(const video::SMaterial& material) const = 0;
//! Should node be used in scene export? (only needed for scene-writing, ignored in mesh-writing)
//! By default all visible nodes are exported.
virtual bool isExportable(const irr::scene::ISceneNode * node) const = 0;
//! Return the mesh for the given node. If it has no mesh or shouldn't export it's mesh
//! you can return 0 in which case only the transformation matrix of the node will be used.
virtual IMesh* getMesh(irr::scene::ISceneNode * node) = 0;
};
//! Interface for writing meshes
class IColladaMeshWriter : public IMeshWriter
{
public:
IColladaMeshWriter() : Properties(0), DefaultProperties(0), WriteTextures(true), WriteDefaultScene(false), AmbientLight(0.f, 0.f, 0.f, 1.f)
{
}
//! Destructor
virtual ~IColladaMeshWriter()
{
if ( Properties )
Properties->drop();
if ( DefaultProperties )
DefaultProperties->drop();
}
//! writes a scene starting with the given node
virtual bool writeScene(io::IWriteFile* file, scene::ISceneNode* root) = 0;
//! Set if texture information should be written
virtual void setWriteTextures(bool write)
{
WriteTextures = write;
}
//! Get if texture information should be written
virtual bool getWriteTextures() const
{
return WriteTextures;
}
//! Set if a default scene should be written when writing meshes.
/** Many collada readers fail to read a mesh if the collada files doesn't contain a scene as well.
The scene is doing an instantiation of the mesh.
When using writeScene this flag is ignored (as we have scene there already)
*/
virtual void setWriteDefaultScene(bool write)
{
WriteDefaultScene = write;
}
//! Get if a default scene should be written
virtual bool getWriteDefaultScene() const
{
return WriteDefaultScene;
}
//! Sets ambient color of the scene to write
virtual void setAmbientLight(const video::SColorf &ambientColor)
{
AmbientLight = ambientColor;
}
//! Return ambient light of the scene which is written
virtual video::SColorf getAmbientLight() const
{
return AmbientLight;
}
//! Set properties to use by the meshwriter instead of it's default properties.
/** Overloading properties with an own class allows modifying the writing process in certain ways.
By default properties are set to the DefaultProperties. */
virtual void setProperties(IColladaMeshWriterProperties * p)
{
if ( p == Properties )
return;
if ( p )
p->grab();
if ( Properties )
Properties->drop();
Properties = p;
}
//! Get properties which are currently used.
virtual IColladaMeshWriterProperties * getProperties()
{
return Properties;
}
//! Return the original default properties of the writer.
/** You can use this pointer in your own properties to access and return default values. */
IColladaMeshWriterProperties * getDefaultProperties() const
{
return DefaultProperties;
}
protected:
// NOTE: you should also call setProperties
virtual void setDefaultProperties(IColladaMeshWriterProperties * p)
{
if ( p == DefaultProperties )
return;
if ( p )
p->grab();
if ( DefaultProperties )
DefaultProperties->drop();
DefaultProperties = p;
}
private:
IColladaMeshWriterProperties * Properties;
IColladaMeshWriterProperties * DefaultProperties;
bool WriteTextures;
bool WriteDefaultScene;
video::SColorf AmbientLight;
};
} // end namespace
} // end namespace
#endif

View File

@ -127,6 +127,10 @@ public:
IArchiveLoader and passing an instance to addArchiveLoader.
Irrlicht supports AES-encrypted zip files, and the advanced compression
techniques lzma and bzip2.
If you want to add a directory as an archive, prefix its name with a
slash in order to let Irrlicht recognize it as a folder mount (mypath/).
Using this technique one can build up a search order, because archives
are read first, and can be used more easily with relative filenames.
\param file: Archive to add to the file system.
\param ignoreCase: If set to true, files in the archive can be accessed without
writing all letters in the right case.
@ -156,8 +160,14 @@ public:
//! Removes an archive from the file system.
/** This will close the archive and free any file handles, but will not
close resources which have already been loaded and are now cached, for
example textures and meshes.
\param filename The archive of the given name will be removed
example textures and meshes. Note that a relative filename might be
interpreted differently on each call, depending on the current working
directory. In case you want to remove an archive that was added using
a relative path name, you have to change to the same working directory
again. This means, that the filename given on creation is not an identifier
for the archive, but just a usual filename that is used for locating the
archive to work with.
\param filename The archive pointed to by the name will be removed
\return True on success, false on failure */
virtual bool removeFileArchive(const path& filename) =0;

View File

@ -48,7 +48,7 @@ namespace gui
virtual void setOverrideColor(video::SColor color) = 0;
//! Gets the override color
virtual video::SColor const & getOverrideColor() const = 0;
virtual video::SColor getOverrideColor() const = 0;
//! Sets if the text should use the override color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set

View File

@ -89,10 +89,10 @@ namespace gui
virtual bool isAutoScrollEnabled() const = 0;
//! set all item colors at given index to color
virtual void setItemOverrideColor(u32 index, const video::SColor &color) = 0;
virtual void setItemOverrideColor(u32 index, video::SColor color) = 0;
//! set all item colors of specified type at given index to color
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color) = 0;
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color) = 0;
//! clear all item colors at index
virtual void clearItemOverrideColor(u32 index) = 0;

View File

@ -49,7 +49,7 @@ namespace gui
//! Gets the override color
/** \return: The override color */
virtual video::SColor const& getOverrideColor(void) const = 0;
virtual video::SColor getOverrideColor(void) const = 0;
//! Sets if the static text should use the overide color or the color in the gui skin.
/** \param enable: If set to true, the override color, which can be set
@ -67,9 +67,21 @@ namespace gui
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw) = 0;
//! Gets the background color
/** \return: The background color */
virtual video::SColor getBackgroundColor() const = 0;
//! Checks if background drawing is enabled
/** \return true if background drawing is enabled, false otherwise */
virtual bool isDrawBackgroundEnabled() const = 0;
//! Sets whether to draw the border
virtual void setDrawBorder(bool draw) = 0;
//! Checks if border drawing is enabled
/** \return true if border drawing is enabled, false otherwise */
virtual bool isDrawBorderEnabled() const = 0;
//! Sets text justification mode
/** \param horizontal: EGUIA_UPPERLEFT for left justified (default),
EGUIA_LOWEERRIGHT for right justified, or EGUIA_CENTER for centered text.

33
include/IRandomizer.h Normal file
View File

@ -0,0 +1,33 @@
// Copyright (C) 2002-2011 Nikolaus Gebhardt
// This file is part of the "Irrlicht Engine".
// For conditions of distribution and use, see copyright notice in irrlicht.h
#ifndef __I_RANDOMIZER_H_INCLUDED__
#define __I_RANDOMIZER_H_INCLUDED__
#include "IReferenceCounted.h"
namespace irr
{
//! Interface for generating random numbers
class IRandomizer : public virtual IReferenceCounted
{
public:
//! resets the randomizer
/** \param value Initialization value (seed) */
virtual void reset(s32 value=0x0f0f0f0f) =0;
//! generates a pseudo random number in the range 0..randMax()
virtual s32 rand() const =0;
//! generates a pseudo random number in the range 0..1
virtual f32 frand() const =0;
//! get maxmimum number generated by rand()
virtual s32 randMax() const =0;
};
} // end namespace irr
#endif

View File

@ -7,6 +7,7 @@
#include "ISceneNodeAnimator.h"
#include "IEventReceiver.h"
#include "irrArray.h"
namespace irr
{
@ -38,11 +39,18 @@ namespace scene
//! Set the rotation speed in degrees
virtual void setRotateSpeed(f32 rotateSpeed) = 0;
//! Sets the keyboard mapping for this animator
//! Sets the keyboard mapping for this animator (old style)
/** \param map Array of keyboard mappings, see irr::SKeyMap
\param count Size of the keyboard map array. */
virtual void setKeyMap(SKeyMap *map, u32 count) = 0;
//! Sets the keyboard mapping for this animator
//! \param keymap The new keymap array
virtual void setKeyMap(const core::array<SKeyMap>& keymap) = 0;
//! Gets the keyboard mapping for this animator
virtual const core::array<SKeyMap>& getKeyMap() const = 0;
//! Sets whether vertical movement should be allowed.
/** If vertical movement is enabled then the camera may fight with
gravity causing camera shake. Disable this if the camera has

View File

@ -183,18 +183,23 @@ namespace video
case EMF_ZWRITE_ENABLE: material.ZWriteEnable = Material.ZWriteEnable; break;
case EMF_BACK_FACE_CULLING: material.BackfaceCulling = Material.BackfaceCulling; break;
case EMF_FRONT_FACE_CULLING: material.FrontfaceCulling = Material.FrontfaceCulling; break;
case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
case EMF_BILINEAR_FILTER: material.TextureLayer[0].BilinearFilter = Material.TextureLayer[0].BilinearFilter; break;
case EMF_TRILINEAR_FILTER: material.TextureLayer[0].TrilinearFilter = Material.TextureLayer[0].TrilinearFilter; break;
case EMF_ANISOTROPIC_FILTER: material.TextureLayer[0].AnisotropicFilter = Material.TextureLayer[0].AnisotropicFilter; break;
case EMF_FOG_ENABLE: material.FogEnable = Material.FogEnable; break;
case EMF_NORMALIZE_NORMALS: material.NormalizeNormals = Material.NormalizeNormals; break;
case EMF_TEXTURE_WRAP:
material.TextureLayer[0].TextureWrapU = Material.TextureLayer[0].TextureWrapU;
material.TextureLayer[0].TextureWrapV = Material.TextureLayer[0].TextureWrapV;
break;
case EMF_ANTI_ALIASING: material.AntiAliasing = Material.AntiAliasing; break;
case EMF_COLOR_MASK: material.ColorMask = Material.ColorMask; break;
case EMF_COLOR_MATERIAL: material.ColorMaterial = Material.ColorMaterial; break;
case EMF_USE_MIP_MAPS: material.UseMipMaps = Material.UseMipMaps; break;
case EMF_BLEND_OPERATION: material.BlendOperation = Material.BlendOperation; break;
case EMF_POLYGON_OFFSET:
material.PolygonOffsetDirection = Material.PolygonOffsetDirection;
material.PolygonOffsetFactor = Material.PolygonOffsetFactor; break;
}
}
}

View File

@ -28,6 +28,9 @@ namespace irr
//! Struct storing which key belongs to which action.
struct SKeyMap
{
SKeyMap() {}
SKeyMap(EKEY_ACTION action, EKEY_CODE keyCode) : Action(action), KeyCode(keyCode) {}
EKEY_ACTION Action;
EKEY_CODE KeyCode;
};

View File

@ -88,6 +88,12 @@ namespace scene
return Indices.size();
}
//! Get type of index data which is stored in this meshbuffer.
virtual video::E_INDEX_TYPE getIndexType() const
{
return video::EIT_16BIT;
}
//! returns an axis aligned bounding box
virtual const core::aabbox3d<f32>& getBoundingBox() const
{
@ -119,13 +125,54 @@ namespace scene
}
}
//! returns position of vertex i
virtual const core::vector3df& getPosition(u32 i) const
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].Pos;
}
//! returns position of vertex i
virtual core::vector3df& getPosition(u32 i)
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].Pos;
}
//! returns normal of vertex i
virtual const core::vector3df& getNormal(u32 i) const
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].Normal;
}
//! returns normal of vertex i
virtual core::vector3df& getNormal(u32 i)
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].Normal;
}
//! returns texture coord of vertex i
virtual const core::vector2df& getTCoords(u32 i) const
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].TCoords;
}
//! returns texture coord of vertex i
virtual core::vector2df& getTCoords(u32 i)
{
_IRR_DEBUG_BREAK_IF(!Vertices);
return (*Vertices)[Indices[i]].TCoords;
}
//! append the vertices and indices to the current buffer
virtual void append(const void* const vertices, u32 numVertices, const u16* const indices, u32 numIndices) {}
//! append the meshbuffer to the current buffer
virtual void append(const IMeshBuffer* const other) {}
//! get the current hardware mapping hint
virtual E_HARDWARE_MAPPING getHardwareMappingHint_Vertex() const
{
@ -147,7 +194,6 @@ namespace scene
MappingHintIndex=NewMappingHint;
}
//! flags the mesh as changed, reloads hardware buffers
virtual void setDirty(E_BUFFER_TYPE buffer=EBT_VERTEX_AND_INDEX)
{
@ -186,7 +232,6 @@ namespace scene
//! hardware mapping hint
E_HARDWARE_MAPPING MappingHintVertex;
E_HARDWARE_MAPPING MappingHintIndex;
};

View File

@ -99,7 +99,10 @@ struct SSkinMeshBuffer : public IMeshBuffer
//! Get type of index data which is stored in this meshbuffer.
/** \return Index type of this buffer. */
virtual video::E_INDEX_TYPE getIndexType() const { return video::EIT_16BIT; }
virtual video::E_INDEX_TYPE getIndexType() const
{
return video::EIT_16BIT;
}
//! Get pointer to index array
virtual const u16* getIndices() const

View File

@ -19,7 +19,7 @@ namespace scene
//! Defines the view frustum. That's the space visible by the camera.
/** The view frustum is enclosed by 6 planes. These six planes share
four points. A bounding box around these four points is also stored in
eight points. A bounding box around these eight points is also stored in
this structure.
*/
struct SViewFrustum

View File

@ -1619,7 +1619,7 @@ namespace core
M[12] = 0;
M[13] = 0;
M[14] = (T)(zNear/(zNear-zFar));
M[15] = -1;
M[15] = 1;
#if defined ( USE_MATRIX_TEST )
definitelyIdentityMatrix=false;

View File

@ -24,6 +24,11 @@ enum EIntersectionRelation3D
};
//! Template plane class with some intersection testing methods.
/** It has to be ensured, that the normal is always normalized. The constructors
and setters of this class will not ensure this automatically. So any normal
passed in has to be normalized in advance. No change to the normal will be
made by any of the class methods.
*/
template <class T>
class plane3d
{

View File

@ -422,7 +422,7 @@ namespace core
inline vector3d<s32>& vector3d<s32>::operator /=(s32 val) {X/=val;Y/=val;Z/=val; return *this;}
template <>
inline vector3d<s32> vector3d<s32>::getSphericalCoordinateAngles()
inline vector3d<s32> vector3d<s32>::getSphericalCoordinateAngles() const
{
vector3d<s32> angle;
const f64 length = X*X + Y*Y + Z*Z;

View File

@ -504,8 +504,10 @@ void CAnimatedMeshHalfLife::initModel()
m.Lighting = false;
MeshIPol.addMeshBuffer ( buffer );
buffer->recalculateBoundingBox();
buffer->drop ();
} // mesh
MeshIPol.recalculateBoundingBox();
} // model
} // body part
}
@ -1169,13 +1171,13 @@ bool CAnimatedMeshHalfLife::postLoadModel( const io::path &filename )
/*!
*/
void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
void CAnimatedMeshHalfLife::dumpModelInfo(u32 level) const
{
u8 *phdr = (u8*) Header;
SHalflifeHeader * hdr = Header;
const u8 *phdr = (const u8*) Header;
const SHalflifeHeader * hdr = Header;
u32 i;
if ( level == 0 )
if (level == 0)
{
printf (
"Bones: %d\n"
@ -1219,7 +1221,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
printf("numbones: %d\n", hdr->numbones);
for (i = 0; i < hdr->numbones; i++)
{
SHalflifeBone *bone = (SHalflifeBone *) (phdr + hdr->boneindex);
const SHalflifeBone *bone = (const SHalflifeBone *) (phdr + hdr->boneindex);
printf("bone %d.name: \"%s\"\n", i + 1, bone[i].name);
printf("bone %d.parent: %d\n", i + 1, bone[i].parent);
printf("bone %d.flags: %d\n", i + 1, bone[i].flags);
@ -1229,7 +1231,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
}
printf("\nnumbonecontrollers: %d\n", hdr->numbonecontrollers);
SHalflifeBoneController *bonecontrollers = (SHalflifeBoneController *) (phdr + hdr->bonecontrollerindex);
const SHalflifeBoneController *bonecontrollers = (const SHalflifeBoneController *) (phdr + hdr->bonecontrollerindex);
for (i = 0; i < hdr->numbonecontrollers; i++)
{
printf("bonecontroller %d.bone: %d\n", i + 1, bonecontrollers[i].bone);
@ -1241,7 +1243,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
}
printf("\nnumhitboxes: %d\n", hdr->numhitboxes);
SHalflifeBBox *box = (SHalflifeBBox *) (phdr + hdr->hitboxindex);
const SHalflifeBBox *box = (const SHalflifeBBox *) (phdr + hdr->hitboxindex);
for (i = 0; i < hdr->numhitboxes; i++)
{
printf("hitbox %d.bone: %d\n", i + 1, box[i].bone);
@ -1251,7 +1253,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
}
printf("\nnumseq: %d\n", hdr->numseq);
SHalflifeSequence *seq = (SHalflifeSequence *) (phdr + hdr->seqindex);
const SHalflifeSequence *seq = (const SHalflifeSequence *) (phdr + hdr->seqindex);
for (i = 0; i < hdr->numseq; i++)
{
printf("seqdesc %d.label: \"%s\"\n", i + 1, seq[i].label);
@ -1263,7 +1265,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
printf("\nnumseqgroups: %d\n", hdr->numseqgroups);
for (i = 0; i < hdr->numseqgroups; i++)
{
SHalflifeSequenceGroup *group = (SHalflifeSequenceGroup *) (phdr + hdr->seqgroupindex);
const SHalflifeSequenceGroup *group = (const SHalflifeSequenceGroup *) (phdr + hdr->seqgroupindex);
printf("\nseqgroup %d.label: \"%s\"\n", i + 1, group[i].label);
printf("\nseqgroup %d.namel: \"%s\"\n", i + 1, group[i].name);
printf("\nseqgroup %d.data: %d\n", i + 1, group[i].data);
@ -1273,7 +1275,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
printf("numskinfamilies: %d\n", hdr->numskinfamilies);
printf("\nnumbodyparts: %d\n", hdr->numbodyparts);
SHalflifeBody *pbodyparts = (SHalflifeBody*) ((u8*) hdr + hdr->bodypartindex);
const SHalflifeBody *pbodyparts = (const SHalflifeBody*) ((const u8*) hdr + hdr->bodypartindex);
for (i = 0; i < hdr->numbodyparts; i++)
{
printf("bodypart %d.name: \"%s\"\n", i + 1, pbodyparts[i].name);
@ -1285,7 +1287,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
printf("\nnumattachments: %d\n", hdr->numattachments);
for (i = 0; i < hdr->numattachments; i++)
{
SHalflifeAttachment *attach = (SHalflifeAttachment *) ((u8*) hdr + hdr->attachmentindex);
const SHalflifeAttachment *attach = (const SHalflifeAttachment *) ((const u8*) hdr + hdr->attachmentindex);
printf("attachment %d.name: \"%s\"\n", i + 1, attach[i].name);
}
@ -1293,7 +1295,7 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
printf("\nnumtextures: %d\n", hdr->numtextures);
printf("textureindex: %d\n", hdr->textureindex);
printf("texturedataindex: %d\n", hdr->texturedataindex);
SHalflifeTexture *ptextures = (SHalflifeTexture *) ((u8*) hdr + hdr->textureindex);
const SHalflifeTexture *ptextures = (const SHalflifeTexture *) ((const u8*) hdr + hdr->textureindex);
for (i = 0; i < hdr->numtextures; i++)
{
printf("texture %d.name: \"%s\"\n", i + 1, ptextures[i].name);
@ -1307,9 +1309,9 @@ void CAnimatedMeshHalfLife::dumpModelInfo ( u32 level )
/*!
*/
void CAnimatedMeshHalfLife::ExtractBbox( s32 sequence, core::aabbox3df &box )
void CAnimatedMeshHalfLife::ExtractBbox(s32 sequence, core::aabbox3df &box) const
{
SHalflifeSequence *seq = (SHalflifeSequence *)((u8*)Header + Header->seqindex) + sequence;
const SHalflifeSequence *seq = (const SHalflifeSequence *)((const u8*)Header + Header->seqindex) + sequence;
box.MinEdge.X = seq[0].bbmin[0];
box.MinEdge.Y = seq[0].bbmin[1];
@ -1325,13 +1327,12 @@ void CAnimatedMeshHalfLife::ExtractBbox( s32 sequence, core::aabbox3df &box )
*/
void CAnimatedMeshHalfLife::calcBoneAdj()
{
SHalflifeBoneController *bonecontroller =
(SHalflifeBoneController *)((u8*) Header + Header->bonecontrollerindex);
const SHalflifeBoneController *bonecontroller =
(const SHalflifeBoneController *)((const u8*) Header + Header->bonecontrollerindex);
for (u32 j = 0; j < Header->numbonecontrollers; j++)
{
s32 i = bonecontroller[j].index;
f32 range = i <= 3 ? 255.f : 64.f;
const s32 i = bonecontroller[j].index;
// check for 360% wrapping
f32 value;
if (bonecontroller[j].type & STUDIO_RLOOP)
@ -1340,9 +1341,8 @@ void CAnimatedMeshHalfLife::calcBoneAdj()
}
else
{
value = BoneController[i] / range;
if (value < 0.f) value = 0.f;
if (value > 1.f) value = 1.f;
const f32 range = i <= 3 ? 255.f : 64.f;
value = core::clamp(BoneController[i] / range,0.f,1.f);
value = (1.f - value) * bonecontroller[j].start + value * bonecontroller[j].end;
}
@ -1351,7 +1351,7 @@ void CAnimatedMeshHalfLife::calcBoneAdj()
case STUDIO_XR:
case STUDIO_YR:
case STUDIO_ZR:
BoneAdj[j] = value * (core::PI / 180.f);
BoneAdj[j] = value * core::DEGTORAD;
break;
case STUDIO_X:
case STUDIO_Y:
@ -1674,7 +1674,7 @@ void CAnimatedMeshHalfLife::setMaterialFlag(video::E_MATERIAL_FLAG flag, bool ne
//! set user axis aligned bounding box
void CAnimatedMeshHalfLife::setBoundingBox(const core::aabbox3df& box)
{
return;
MeshIPol.setBoundingBox(box);
}

View File

@ -564,10 +564,10 @@ namespace scene
u32 SkinGroupSelection; // skin group selection
u32 SetSkin( u32 value );
void initModel ();
void dumpModelInfo ( u32 level);
void initModel();
void dumpModelInfo(u32 level) const;
void ExtractBbox( s32 sequence, core::aabbox3df &box );
void ExtractBbox(s32 sequence, core::aabbox3df &box) const;
void setUpBones ();
SHalflifeAnimOffset * getAnim( SHalflifeSequence *seq );

View File

@ -163,7 +163,7 @@ namespace
CLightPrefab(const core::stringc& id) : CPrefab(id)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: loaded light prefab", Id.c_str());
os::Printer::log("COLLADA: loaded light prefab", Id.c_str(), ELL_DEBUG);
#endif
}
@ -174,7 +174,7 @@ namespace
scene::ISceneManager* mgr)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: Constructing light instance", Id.c_str());
os::Printer::log("COLLADA: Constructing light instance", Id.c_str(), ELL_DEBUG);
#endif
scene::ILightSceneNode* l = mgr->addLightSceneNode(parent);
@ -204,7 +204,7 @@ namespace
scene::ISceneManager* mgr)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: Constructing mesh instance", Id.c_str());
os::Printer::log("COLLADA: Constructing mesh instance", Id.c_str(), ELL_DEBUG);
#endif
scene::ISceneNode* m = mgr->addMeshSceneNode(Mesh, parent);
@ -228,7 +228,7 @@ namespace
: CPrefab(id), YFov(core::PI / 2.5f), ZNear(1.0f), ZFar(3000.0f)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: loaded camera prefab", Id.c_str());
os::Printer::log("COLLADA: loaded camera prefab", Id.c_str(), ELL_DEBUG);
#endif
}
@ -242,7 +242,7 @@ namespace
scene::ISceneManager* mgr)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: Constructing camera instance", Id.c_str());
os::Printer::log("COLLADA: Constructing camera instance", Id.c_str(), ELL_DEBUG);
#endif
scene::ICameraSceneNode* c = mgr->addCameraSceneNode(parent);
@ -267,7 +267,7 @@ namespace
CScenePrefab(const core::stringc& id) : CPrefab(id)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: loaded scene prefab", Id.c_str());
os::Printer::log("COLLADA: loaded scene prefab", Id.c_str(), ELL_DEBUG);
#endif
}
@ -276,7 +276,7 @@ namespace
scene::ISceneManager* mgr)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: Constructing scene instance", Id.c_str());
os::Printer::log("COLLADA: Constructing scene instance", Id.c_str(), ELL_DEBUG);
#endif
if (Children.size()==0)
@ -293,7 +293,9 @@ namespace
t+=core::stringc(Transformation[i]);
t+=" ";
}
os::Printer::log("COLLADA: Transformation", t.c_str());
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA: Transformation", t.c_str(), ELL_DEBUG);
#endif
for (u32 i=0; i<Children.size(); ++i)
Children[i]->addInstance(s, mgr);
@ -412,7 +414,7 @@ void CColladaFileLoader::skipSection(io::IXMLReaderUTF8* reader, bool reportSkip
#ifndef COLLADA_READER_DEBUG
if (reportSkipping) // always report in COLLADA_READER_DEBUG mode
#endif
os::Printer::log("COLLADA skipping section", core::stringc(reader->getNodeName()).c_str());
os::Printer::log("COLLADA skipping section", core::stringc(reader->getNodeName()).c_str(), ELL_DEBUG);
// skip if this element is empty anyway.
if (reader->isEmptyElement())
@ -428,8 +430,8 @@ void CColladaFileLoader::skipSection(io::IXMLReaderUTF8* reader, bool reportSkip
{
#ifdef COLLADA_READER_DEBUG
if (reportSkipping)
os::Printer::log("Skipping COLLADA unknown element", core::stringc(reader->getNodeName()).c_str());
#endif // COLLADA_READER_DEBUG
os::Printer::log("Skipping COLLADA unknown element", core::stringc(reader->getNodeName()).c_str(), ELL_DEBUG);
#endif
++tagCounter;
}
@ -482,7 +484,7 @@ void CColladaFileLoader::readColladaSection(io::IXMLReaderUTF8* reader)
readLibrarySection(reader);
else
if (libraryVisualScenesSectionName == reader->getNodeName())
readVisualSceneLibrary(reader);
readVisualScene(reader);
else
if (assetSectionName == reader->getNodeName())
readAssetSection(reader);
@ -502,7 +504,7 @@ void CColladaFileLoader::readColladaSection(io::IXMLReaderUTF8* reader)
void CColladaFileLoader::readLibrarySection(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading library");
os::Printer::log("COLLADA reading library", ELL_DEBUG);
#endif
if (reader->isEmptyElement())
@ -571,7 +573,7 @@ void CColladaFileLoader::readLibrarySection(io::IXMLReaderUTF8* reader)
//! reads a <visual_scene> element and stores it as a prefab
void CColladaFileLoader::readVisualSceneLibrary(io::IXMLReaderUTF8* reader)
void CColladaFileLoader::readVisualScene(io::IXMLReaderUTF8* reader)
{
CScenePrefab* p = 0;
while(reader->read())
@ -615,7 +617,7 @@ void CColladaFileLoader::readVisualSceneLibrary(io::IXMLReaderUTF8* reader)
void CColladaFileLoader::readSceneSection(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading scene");
os::Printer::log("COLLADA reading scene", ELL_DEBUG);
#endif
if (reader->isEmptyElement())
@ -689,7 +691,7 @@ void CColladaFileLoader::readSceneSection(io::IXMLReaderUTF8* reader)
void CColladaFileLoader::readAssetSection(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading asset");
os::Printer::log("COLLADA reading asset", ELL_DEBUG);
#endif
if (reader->isEmptyElement())
@ -720,13 +722,13 @@ void CColladaFileLoader::readNodeSection(io::IXMLReaderUTF8* reader, scene::ISce
{
return;
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading empty node");
os::Printer::log("COLLADA reading empty node", ELL_DEBUG);
#endif
}
core::stringc name = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading node", name);
os::Printer::log("COLLADA reading node", name, ELL_DEBUG);
#endif
core::matrix4 transform; // transformation of this node
@ -850,7 +852,7 @@ core::matrix4 CColladaFileLoader::readLookAtNode(io::IXMLReaderUTF8* reader)
return mat;
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading look at node");
os::Printer::log("COLLADA reading look at node", ELL_DEBUG);
#endif
f32 floats[9];
@ -869,7 +871,7 @@ core::matrix4 CColladaFileLoader::readLookAtNode(io::IXMLReaderUTF8* reader)
core::matrix4 CColladaFileLoader::readSkewNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading skew node");
os::Printer::log("COLLADA reading skew node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -917,7 +919,7 @@ void CColladaFileLoader::readBboxNode(io::IXMLReaderUTF8* reader,
core::aabbox3df& bbox)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading boundingbox node");
os::Printer::log("COLLADA reading boundingbox node", ELL_DEBUG);
#endif
bbox.reset(core::aabbox3df());
@ -959,7 +961,7 @@ void CColladaFileLoader::readBboxNode(io::IXMLReaderUTF8* reader,
core::matrix4 CColladaFileLoader::readMatrixNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading matrix node");
os::Printer::log("COLLADA reading matrix node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -993,7 +995,7 @@ core::matrix4 CColladaFileLoader::readMatrixNode(io::IXMLReaderUTF8* reader)
core::matrix4 CColladaFileLoader::readPerspectiveNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading perspective node");
os::Printer::log("COLLADA reading perspective node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -1015,7 +1017,7 @@ core::matrix4 CColladaFileLoader::readPerspectiveNode(io::IXMLReaderUTF8* reader
core::matrix4 CColladaFileLoader::readRotateNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading rotate node");
os::Printer::log("COLLADA reading rotate node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -1043,7 +1045,7 @@ core::matrix4 CColladaFileLoader::readRotateNode(io::IXMLReaderUTF8* reader)
core::matrix4 CColladaFileLoader::readScaleNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading scale node");
os::Printer::log("COLLADA reading scale node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -1066,7 +1068,7 @@ core::matrix4 CColladaFileLoader::readScaleNode(io::IXMLReaderUTF8* reader)
core::matrix4 CColladaFileLoader::readTranslateNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading translate node");
os::Printer::log("COLLADA reading translate node", ELL_DEBUG);
#endif
core::matrix4 mat;
@ -1095,7 +1097,7 @@ void CColladaFileLoader::readInstanceNode(io::IXMLReaderUTF8* reader,
uriToId(url);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading instance", url);
os::Printer::log("COLLADA reading instance", url, ELL_DEBUG);
#endif
if (!reader->isEmptyElement())
@ -1124,7 +1126,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent,
const core::stringc& type)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA instantiate node");
os::Printer::log("COLLADA instantiate node", ELL_DEBUG);
#endif
for (u32 i=0; i<Prefabs.size(); ++i)
@ -1163,7 +1165,7 @@ void CColladaFileLoader::instantiateNode(scene::ISceneNode* parent,
void CColladaFileLoader::readCameraPrefab(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading camera prefab");
os::Printer::log("COLLADA reading camera prefab", ELL_DEBUG);
#endif
CCameraPrefab* prefab = new CCameraPrefab(readId(reader));
@ -1203,7 +1205,7 @@ void CColladaFileLoader::readImage(io::IXMLReaderUTF8* reader)
image.Id = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading image", core::stringc(image.Id));
os::Printer::log("COLLADA reading image", core::stringc(image.Id), ELL_DEBUG);
#endif
image.Dimension.Height = (u32)reader->getAttributeValueAsInt("height");
image.Dimension.Width = (u32)reader->getAttributeValueAsInt("width");
@ -1262,7 +1264,7 @@ void CColladaFileLoader::readTexture(io::IXMLReaderUTF8* reader)
texture.Id = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading texture", core::stringc(texture.Id));
os::Printer::log("COLLADA reading texture", core::stringc(texture.Id), ELL_DEBUG);
#endif
if (!reader->isEmptyElement())
@ -1287,7 +1289,7 @@ void CColladaFileLoader::readMaterial(io::IXMLReaderUTF8* reader)
SColladaMaterial& material = Materials.getLast();
material.Id = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading material", core::stringc(material.Id));
os::Printer::log("COLLADA reading material", core::stringc(material.Id), ELL_DEBUG);
#endif
if (Version >= 10400)
@ -1376,7 +1378,7 @@ void CColladaFileLoader::readEffect(io::IXMLReaderUTF8* reader, SColladaEffect *
effect->Mat.Lighting=true;
effect->Mat.NormalizeNormals=true;
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading effect", core::stringc(effect->Id));
os::Printer::log("COLLADA reading effect", core::stringc(effect->Id), ELL_DEBUG);
#endif
}
while(reader->read())
@ -1398,7 +1400,7 @@ void CColladaFileLoader::readEffect(io::IXMLReaderUTF8* reader, SColladaEffect *
blinnNode == reader->getNodeName())
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading effect part", reader->getNodeName());
os::Printer::log("COLLADA reading effect part", reader->getNodeName(), ELL_DEBUG);
#endif
effect->Mat.setFlag(irr::video::EMF_GOURAUD_SHADING,
phongNode == reader->getNodeName() ||
@ -1502,7 +1504,7 @@ void CColladaFileLoader::readEffect(io::IXMLReaderUTF8* reader, SColladaEffect *
if (doubleSided)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Setting double sided flag for effect.");
os::Printer::log("Setting double sided flag for effect.", ELL_DEBUG);
#endif
effect->Mat.setFlag(irr::video::EMF_BACK_FACE_CULLING,false);
@ -1549,7 +1551,7 @@ void CColladaFileLoader::readEffect(io::IXMLReaderUTF8* reader, SColladaEffect *
const SColladaMaterial* CColladaFileLoader::findMaterial(const core::stringc& materialName)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA find material", materialName);
os::Printer::log("COLLADA find material", materialName, ELL_DEBUG);
#endif
// do a quick lookup in the materials
@ -1585,7 +1587,7 @@ const SColladaMaterial* CColladaFileLoader::findMaterial(const core::stringc& ma
void CColladaFileLoader::readBindMaterialSection(io::IXMLReaderUTF8* reader, const core::stringc & id)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading bind material");
os::Printer::log("COLLADA reading bind material", ELL_DEBUG);
#endif
while(reader->read())
@ -1608,15 +1610,15 @@ void CColladaFileLoader::readBindMaterialSection(io::IXMLReaderUTF8* reader, con
// bind any pending materials for this node
meshbufferReference = id+"/"+meshbufferReference;
#ifdef COLLADA_READER_DEBUG
os::Printer::log((core::stringc("Material binding: ")+meshbufferReference+" "+target).c_str());
os::Printer::log((core::stringc("Material binding: ")+meshbufferReference+" "+target).c_str(), ELL_DEBUG);
#endif
if (MaterialsToBind.find(meshbufferReference))
{
core::array<irr::scene::IMeshBuffer*> & toBind
= MeshesToBind[MaterialsToBind[meshbufferReference]];
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Material binding now ",material->Id.c_str());
os::Printer::log("#meshbuffers",core::stringc(toBind.size()).c_str());
os::Printer::log("Material binding now ",material->Id.c_str(), ELL_DEBUG);
os::Printer::log("#meshbuffers",core::stringc(toBind.size()).c_str(), ELL_DEBUG);
#endif
SMesh tmpmesh;
for (u32 i = 0; i < toBind.size(); ++i)
@ -1634,7 +1636,7 @@ void CColladaFileLoader::readBindMaterialSection(io::IXMLReaderUTF8* reader, con
if ((material->Transparency!=0.0f) && (material->Transparency!=1.0f))
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA found transparency material", core::stringc(material->Transparency).c_str());
os::Printer::log("COLLADA found transparency material", core::stringc(material->Transparency).c_str(), ELL_DEBUG);
#endif
SceneManager->getMeshManipulator()->setVertexColorAlpha(&tmpmesh, core::floor32(material->Transparency*255.0f));
}
@ -1654,7 +1656,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
{
core::stringc id = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading geometry", id);
os::Printer::log("COLLADA reading geometry", id, ELL_DEBUG);
#endif
SAnimatedMesh* amesh = new SAnimatedMesh();
@ -1683,7 +1685,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
sources.getLast().Id = readId(reader);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Reading source", sources.getLast().Id.c_str());
os::Printer::log("Reading source", sources.getLast().Id.c_str(), ELL_DEBUG);
#endif
}
else
@ -1702,13 +1704,13 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
okToReadArray = (type && (!strcmp("float", type) || !strcmp("int", type))) || floatArraySectionName == nodeName || intArraySectionName == nodeName;
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Read array", sources.getLast().Array.Name.c_str());
os::Printer::log("Read array", sources.getLast().Array.Name.c_str(), ELL_DEBUG);
#endif
}
#ifdef COLLADA_READER_DEBUG
else
os::Printer::log("Warning, array outside source found",
readId(reader).c_str());
readId(reader).c_str(), ELL_DEBUG);
#endif
}
@ -1716,7 +1718,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
if (accessorSectionName == nodeName) // child of source (below a technique tag)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Reading accessor");
os::Printer::log("Reading accessor", ELL_DEBUG);
#endif
SAccessor accessor;
accessor.Count = reader->getAttributeValueAsInt("count");
@ -1738,7 +1740,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
if (verticesSectionName == nodeName)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Reading vertices");
os::Printer::log("Reading vertices", ELL_DEBUG);
#endif
// read vertex input position source
readColladaInputs(reader, verticesSectionName);
@ -1762,7 +1764,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
if (doubleSided)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("Setting double sided flag for mesh.");
os::Printer::log("Setting double sided flag for mesh.", ELL_DEBUG);
#endif
amesh->setMaterialFlag(irr::video::EMF_BACK_FACE_CULLING,false);
}
@ -1826,7 +1828,7 @@ void CColladaFileLoader::readGeometry(io::IXMLReaderUTF8* reader)
if (LoadedMeshCount)
{
SceneManager->getMeshCache()->addMesh(filename.c_str(), amesh);
os::Printer::log("Added COLLADA mesh", filename.c_str());
os::Printer::log("Added COLLADA mesh", filename.c_str(), ELL_DEBUG);
}
else
{
@ -1876,7 +1878,7 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
const core::stringc& geometryId)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading polygon section");
os::Printer::log("COLLADA reading polygon section", ELL_DEBUG);
#endif
core::stringc materialName = reader->getAttributeValue("material");
@ -2043,7 +2045,7 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
if (s == sources.size())
{
os::Printer::log("COLLADA Warning, polygon input source not found",
inp.Source.c_str());
inp.Source.c_str(), ELL_DEBUG);
inp.Semantic=ECIS_COUNT; // for unknown
unresolvedInput=true;
}
@ -2055,7 +2057,7 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
tmp += inputSemanticNames[inp.Semantic];
tmp += " sourceArray:";
tmp += inp.Source;
os::Printer::log(tmp.c_str());
os::Printer::log(tmp.c_str(), ELL_DEBUG);
#endif
}
}
@ -2341,7 +2343,7 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
// add mesh buffer
mesh->addMeshBuffer(buffer);
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA added meshbuffer", core::stringc(buffer->getVertexCount())+" vertices, "+core::stringc(buffer->getIndexCount())+" indices.");
os::Printer::log("COLLADA added meshbuffer", core::stringc(buffer->getVertexCount())+" vertices, "+core::stringc(buffer->getIndexCount())+" indices.", ELL_DEBUG);
#endif
buffer->drop();
@ -2352,7 +2354,7 @@ void CColladaFileLoader::readPolygonSection(io::IXMLReaderUTF8* reader,
void CColladaFileLoader::readLightPrefab(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading light prefab");
os::Printer::log("COLLADA reading light prefab", ELL_DEBUG);
#endif
CLightPrefab* prefab = new CLightPrefab(readId(reader));
@ -2680,7 +2682,7 @@ video::SColorf CColladaFileLoader::readColorNode(io::IXMLReaderUTF8* reader)
f32 CColladaFileLoader::readFloatNode(io::IXMLReaderUTF8* reader)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading <float>");
os::Printer::log("COLLADA reading <float>", ELL_DEBUG);
#endif
f32 result = 0.0f;
@ -2757,7 +2759,7 @@ core::stringc CColladaFileLoader::readId(io::IXMLReaderUTF8* reader)
video::ITexture* CColladaFileLoader::getTextureFromImage(core::stringc uri, SColladaEffect * effect)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA searching texture", uri);
os::Printer::log("COLLADA searching texture", uri, ELL_DEBUG);
#endif
video::IVideoDriver* driver = SceneManager->getVideoDriver();
for (;;)
@ -2799,7 +2801,7 @@ video::ITexture* CColladaFileLoader::getTextureFromImage(core::stringc uri, SCol
{
uri = effect->Parameters->getAttributeAsString(uri.c_str());
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA now searching texture", uri.c_str());
os::Printer::log("COLLADA now searching texture", uri.c_str(), ELL_DEBUG);
#endif
}
else
@ -2813,7 +2815,7 @@ video::ITexture* CColladaFileLoader::getTextureFromImage(core::stringc uri, SCol
void CColladaFileLoader::readParameter(io::IXMLReaderUTF8* reader, io::IAttributes* parameters)
{
#ifdef COLLADA_READER_DEBUG
os::Printer::log("COLLADA reading parameter");
os::Printer::log("COLLADA reading parameter", ELL_DEBUG);
#endif
if ( !parameters )

View File

@ -207,7 +207,7 @@ private:
void readLibrarySection(io::IXMLReaderUTF8* reader);
//! reads a <visual_scene> element and stores it as a prefab
void readVisualSceneLibrary(io::IXMLReaderUTF8* reader);
void readVisualScene(io::IXMLReaderUTF8* reader);
//! reads a <scene> section and its content
void readSceneSection(io::IXMLReaderUTF8* reader);

View File

@ -115,7 +115,7 @@ void CGUIEditBox::setOverrideColor(video::SColor color)
}
video::SColor const& CGUIEditBox::getOverrideColor() const
video::SColor CGUIEditBox::getOverrideColor() const
{
return OverrideColor;
}

View File

@ -43,7 +43,7 @@ namespace gui
virtual void setOverrideColor(video::SColor color);
//! Gets the override color
virtual video::SColor const & getOverrideColor() const;
virtual video::SColor getOverrideColor() const;
//! Sets if the text should use the overide color or the
//! color in the gui skin.

View File

@ -811,7 +811,7 @@ void CGUIListBox::swapItems(u32 index1, u32 index2)
}
void CGUIListBox::setItemOverrideColor(u32 index, const video::SColor &color)
void CGUIListBox::setItemOverrideColor(u32 index, video::SColor color)
{
for ( u32 c=0; c < EGUI_LBC_COUNT; ++c )
{
@ -821,7 +821,7 @@ void CGUIListBox::setItemOverrideColor(u32 index, const video::SColor &color)
}
void CGUIListBox::setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color)
void CGUIListBox::setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color)
{
if ( index >= Items.size() || colorType < 0 || colorType >= EGUI_LBC_COUNT )
return;

View File

@ -95,10 +95,10 @@ namespace gui
virtual void deserializeAttributes(io::IAttributes* in, io::SAttributeReadWriteOptions* options);
//! set all item colors at given index to color
virtual void setItemOverrideColor(u32 index, const video::SColor &color);
virtual void setItemOverrideColor(u32 index, video::SColor color);
//! set all item colors of specified type at given index to color
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, const video::SColor &color);
virtual void setItemOverrideColor(u32 index, EGUI_LISTBOX_COLOR colorType, video::SColor color);
//! clear all item colors at index
virtual void clearItemOverrideColor(u32 index);

View File

@ -201,6 +201,21 @@ void CGUIStaticText::setDrawBackground(bool draw)
}
//! Gets the background color
video::SColor CGUIStaticText::getBackgroundColor() const
{
return BGColor;
}
//! Checks if background drawing is enabled
bool CGUIStaticText::isDrawBackgroundEnabled() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return Background;
}
//! Sets whether to draw the border
void CGUIStaticText::setDrawBorder(bool draw)
{
@ -208,6 +223,14 @@ void CGUIStaticText::setDrawBorder(bool draw)
}
//! Checks if border drawing is enabled
bool CGUIStaticText::isDrawBorderEnabled() const
{
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return Border;
}
void CGUIStaticText::setTextRestrainedInside(bool restrainTextInside)
{
RestrainTextInside = restrainTextInside;
@ -227,7 +250,7 @@ void CGUIStaticText::setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT
}
video::SColor const& CGUIStaticText::getOverrideColor() const
video::SColor CGUIStaticText::getOverrideColor() const
{
return OverrideColor;
}

View File

@ -48,14 +48,23 @@ namespace gui
//! Sets whether to draw the background
virtual void setDrawBackground(bool draw);
//! Gets the background color
virtual video::SColor getBackgroundColor() const;
//! Checks if background drawing is enabled
virtual bool isDrawBackgroundEnabled() const;
//! Sets whether to draw the border
virtual void setDrawBorder(bool draw);
//! Checks if border drawing is enabled
virtual bool isDrawBorderEnabled() const;
//! Sets alignment mode for text
virtual void setTextAlignment(EGUI_ALIGNMENT horizontal, EGUI_ALIGNMENT vertical);
//! Gets the override color
virtual video::SColor const & getOverrideColor() const;
virtual video::SColor getOverrideColor() const;
//! Sets if the static text should use the overide color or the
//! color in the gui skin.

View File

@ -143,7 +143,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
c8 grp[WORD_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(grp, bufPtr, WORD_BUFFER_LENGTH, bufEnd);
#ifdef _IRR_DEBUG_OBJ_LOADER_
os::Printer::log("Loaded group start",grp);
os::Printer::log("Loaded group start",grp, ELL_DEBUG);
#endif
if (useGroups)
{
@ -161,7 +161,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
c8 smooth[WORD_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(smooth, bufPtr, WORD_BUFFER_LENGTH, bufEnd);
#ifdef _IRR_DEBUG_OBJ_LOADER_
os::Printer::log("Loaded smoothing group start",smooth);
os::Printer::log("Loaded smoothing group start",smooth, ELL_DEBUG);
#endif
if (core::stringc("off")==smooth)
smoothingGroup=0;
@ -176,7 +176,7 @@ IAnimatedMesh* COBJMeshFileLoader::createMesh(io::IReadFile* file)
c8 matName[WORD_BUFFER_LENGTH];
bufPtr = goAndCopyNextWord(matName, bufPtr, WORD_BUFFER_LENGTH, bufEnd);
#ifdef _IRR_DEBUG_OBJ_LOADER_
os::Printer::log("Loaded material start",matName);
os::Printer::log("Loaded material start",matName, ELL_DEBUG);
#endif
mtlName=matName;
mtlChanged=true;

View File

@ -50,10 +50,17 @@ COpenGLExtensionHandler::COpenGLExtensionHandler() :
pGlStencilFuncSeparate(0), pGlStencilOpSeparate(0),
pGlStencilFuncSeparateATI(0), pGlStencilOpSeparateATI(0),
pGlCompressedTexImage2D(0),
// ARB framebuffer object
pGlBindFramebuffer(0), pGlDeleteFramebuffers(0), pGlGenFramebuffers(0),
pGlCheckFramebufferStatus(0), pGlFramebufferTexture2D(0),
pGlBindRenderbuffer(0), pGlDeleteRenderbuffers(0), pGlGenRenderbuffers(0),
pGlRenderbufferStorage(0), pGlFramebufferRenderbuffer(0),
// EXT framebuffer object
pGlBindFramebufferEXT(0), pGlDeleteFramebuffersEXT(0), pGlGenFramebuffersEXT(0),
pGlCheckFramebufferStatusEXT(0), pGlFramebufferTexture2DEXT(0),
pGlBindRenderbufferEXT(0), pGlDeleteRenderbuffersEXT(0), pGlGenRenderbuffersEXT(0),
pGlRenderbufferStorageEXT(0), pGlFramebufferRenderbufferEXT(0),
// MRTs
pGlDrawBuffersARB(0), pGlDrawBuffersATI(0),
pGlGenBuffersARB(0), pGlBindBufferARB(0), pGlBufferDataARB(0), pGlDeleteBuffersARB(0),
pGlBufferSubDataARB(0), pGlGetBufferSubDataARB(0), pGlMapBufferARB(0), pGlUnmapBufferARB(0),
@ -463,7 +470,18 @@ void COpenGLExtensionHandler::initExtensions(bool stencilBuffer)
// compressed textures
pGlCompressedTexImage2D = (PFNGLCOMPRESSEDTEXIMAGE2DPROC) IRR_OGL_LOAD_EXTENSION("glCompressedTexImage2D");
// FrameBufferObjects
// ARB FrameBufferObjects
pGlBindFramebuffer = (PFNGLBINDFRAMEBUFFERPROC) IRR_OGL_LOAD_EXTENSION("glBindFramebuffer");
pGlDeleteFramebuffers = (PFNGLDELETEFRAMEBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glDeleteFramebuffers");
pGlGenFramebuffers = (PFNGLGENFRAMEBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glGenFramebuffers");
pGlCheckFramebufferStatus = (PFNGLCHECKFRAMEBUFFERSTATUSPROC) IRR_OGL_LOAD_EXTENSION("glCheckFramebufferStatus");
pGlFramebufferTexture2D = (PFNGLFRAMEBUFFERTEXTURE2DPROC) IRR_OGL_LOAD_EXTENSION("glFramebufferTexture2D");
pGlBindRenderbuffer = (PFNGLBINDRENDERBUFFERPROC) IRR_OGL_LOAD_EXTENSION("glBindRenderbuffer");
pGlDeleteRenderbuffers = (PFNGLDELETERENDERBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glDeleteRenderbuffers");
pGlGenRenderbuffers = (PFNGLGENRENDERBUFFERSPROC) IRR_OGL_LOAD_EXTENSION("glGenRenderbuffers");
pGlRenderbufferStorage = (PFNGLRENDERBUFFERSTORAGEPROC) IRR_OGL_LOAD_EXTENSION("glRenderbufferStorage");
pGlFramebufferRenderbuffer = (PFNGLFRAMEBUFFERRENDERBUFFERPROC) IRR_OGL_LOAD_EXTENSION("glFramebufferRenderbuffer");
// EXT FrameBufferObjects
pGlBindFramebufferEXT = (PFNGLBINDFRAMEBUFFEREXTPROC) IRR_OGL_LOAD_EXTENSION("glBindFramebufferEXT");
pGlDeleteFramebuffersEXT = (PFNGLDELETEFRAMEBUFFERSEXTPROC) IRR_OGL_LOAD_EXTENSION("glDeleteFramebuffersEXT");
pGlGenFramebuffersEXT = (PFNGLGENFRAMEBUFFERSEXTPROC) IRR_OGL_LOAD_EXTENSION("glGenFramebuffersEXT");

View File

@ -94,8 +94,10 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_AMD_debug_output",
"GL_AMD_depth_clamp_separate",
"GL_AMD_draw_buffers_blend",
"GL_AMD_multi_draw_indirect",
"GL_AMD_name_gen_delete",
"GL_AMD_performance_monitor",
"GL_AMD_sample_positions",
"GL_AMD_seamless_cubemap_per_texture",
"GL_AMD_shader_stencil_export",
"GL_AMD_texture_texture4",
@ -117,10 +119,13 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_APPLE_vertex_array_range",
"GL_APPLE_vertex_program_evaluators",
"GL_APPLE_ycbcr_422",
"GL_ARB_base_instance",
"GL_ARB_blend_func_extended",
"GL_ARB_cl_event",
"GL_ARB_color_buffer_float",
"GL_ARB_compatibility",
"GL_ARB_compressed_texture_pixel_storage",
"GL_ARB_conservative_depth",
"GL_ARB_copy_buffer",
"GL_ARB_debug_output",
"GL_ARB_depth_buffer_float",
@ -147,6 +152,8 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_ARB_half_float_vertex",
"GL_ARB_imaging",
"GL_ARB_instanced_arrays",
"GL_ARB_internalformat_query",
"GL_ARB_map_buffer_alignment",
"GL_ARB_map_buffer_range",
"GL_ARB_matrix_palette",
"GL_ARB_multisample",
@ -162,13 +169,18 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_ARB_sampler_objects",
"GL_ARB_seamless_cube_map",
"GL_ARB_separate_shader_objects",
"GL_ARB_shader_atomic_counters",
"GL_ARB_shader_bit_encoding",
"GL_ARB_shader_image_load_store",
"GL_ARB_shader_objects",
"GL_ARB_shader_precision",
"GL_ARB_shader_stencil_export",
"GL_ARB_shader_subroutine",
"GL_ARB_shader_texture_lod",
"GL_ARB_shading_language_100",
"GL_ARB_shading_language_420pack",
"GL_ARB_shading_language_include",
"GL_ARB_shading_language_packing",
"GL_ARB_shadow",
"GL_ARB_shadow_ambient",
"GL_ARB_sync",
@ -194,10 +206,12 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_ARB_texture_rectangle",
"GL_ARB_texture_rg",
"GL_ARB_texture_rgb10_a2ui",
"GL_ARB_texture_storage",
"GL_ARB_texture_swizzle",
"GL_ARB_timer_query",
"GL_ARB_transform_feedback2",
"GL_ARB_transform_feedback3",
"GL_ARB_transform_feedback_instanced",
"GL_ARB_transpose_matrix",
"GL_ARB_uniform_buffer_object",
"GL_ARB_vertex_array_bgra",
@ -252,6 +266,7 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_EXT_fog_coord",
"GL_EXT_framebuffer_blit",
"GL_EXT_framebuffer_multisample",
"GL_EXT_framebuffer_multisample_blit_scaled",
"GL_EXT_framebuffer_object",
"GL_EXT_framebuffer_sRGB",
"GL_EXT_geometry_shader4",
@ -316,6 +331,7 @@ static const char* const OpenGLFeatureStrings[] = {
"GL_EXT_vertex_attrib_64bit",
"GL_EXT_vertex_shader",
"GL_EXT_vertex_weighting",
"GL_EXT_x11_sync_object",
"GL_FfdMaskSGIX",
"GL_GREMEDY_frame_terminator",
"GL_GREMEDY_string_marker",
@ -496,8 +512,10 @@ class COpenGLExtensionHandler
IRR_AMD_debug_output,
IRR_AMD_depth_clamp_separate,
IRR_AMD_draw_buffers_blend,
IRR_AMD_multi_draw_indirect,
IRR_AMD_name_gen_delete,
IRR_AMD_performance_monitor,
IRR_AMD_sample_positions,
IRR_AMD_seamless_cubemap_per_texture,
IRR_AMD_shader_stencil_export,
IRR_AMD_texture_texture4,
@ -519,10 +537,13 @@ class COpenGLExtensionHandler
IRR_APPLE_vertex_array_range,
IRR_APPLE_vertex_program_evaluators,
IRR_APPLE_ycbcr_422,
IRR_ARB_base_instance,
IRR_ARB_blend_func_extended,
IRR_ARB_cl_event,
IRR_ARB_color_buffer_float,
IRR_ARB_compatibility,
IRR_ARB_compressed_texture_pixel_storage,
IRR_ARB_conservative_depth,
IRR_ARB_copy_buffer,
IRR_ARB_debug_output,
IRR_ARB_depth_buffer_float,
@ -549,6 +570,8 @@ class COpenGLExtensionHandler
IRR_ARB_half_float_vertex,
IRR_ARB_imaging,
IRR_ARB_instanced_arrays,
IRR_ARB_internalformat_query,
IRR_ARB_map_buffer_alignment,
IRR_ARB_map_buffer_range,
IRR_ARB_matrix_palette,
IRR_ARB_multisample,
@ -564,13 +587,18 @@ class COpenGLExtensionHandler
IRR_ARB_sampler_objects,
IRR_ARB_seamless_cube_map,
IRR_ARB_separate_shader_objects,
IRR_ARB_shader_atomic_counters,
IRR_ARB_shader_bit_encoding,
IRR_ARB_shader_image_load_store,
IRR_ARB_shader_objects,
IRR_ARB_shader_precision,
IRR_ARB_shader_stencil_export,
IRR_ARB_shader_subroutine,
IRR_ARB_shader_texture_lod,
IRR_ARB_shading_language_100,
IRR_ARB_shading_language_420pack,
IRR_ARB_shading_language_include,
IRR_ARB_shading_language_packing,
IRR_ARB_shadow,
IRR_ARB_shadow_ambient,
IRR_ARB_sync,
@ -596,10 +624,12 @@ class COpenGLExtensionHandler
IRR_ARB_texture_rectangle,
IRR_ARB_texture_rg,
IRR_ARB_texture_rgb10_a2ui,
IRR_ARB_texture_storage,
IRR_ARB_texture_swizzle,
IRR_ARB_timer_query,
IRR_ARB_transform_feedback2,
IRR_ARB_transform_feedback3,
IRR_ARB_transform_feedback_instanced,
IRR_ARB_transpose_matrix,
IRR_ARB_uniform_buffer_object,
IRR_ARB_vertex_array_bgra,
@ -654,6 +684,7 @@ class COpenGLExtensionHandler
IRR_EXT_fog_coord,
IRR_EXT_framebuffer_blit,
IRR_EXT_framebuffer_multisample,
IRR_EXT_framebuffer_multisample_blit_scaled,
IRR_EXT_framebuffer_object,
IRR_EXT_framebuffer_sRGB,
IRR_EXT_geometry_shader4,
@ -718,6 +749,7 @@ class COpenGLExtensionHandler
IRR_EXT_vertex_attrib_64bit,
IRR_EXT_vertex_shader,
IRR_EXT_vertex_weighting,
IRR_EXT_x11_sync_object,
IRR_FfdMaskSGIX,
IRR_GREMEDY_frame_terminator,
IRR_GREMEDY_string_marker,
@ -1126,6 +1158,18 @@ class COpenGLExtensionHandler
PFNGLSTENCILFUNCSEPARATEATIPROC pGlStencilFuncSeparateATI;
PFNGLSTENCILOPSEPARATEATIPROC pGlStencilOpSeparateATI;
PFNGLCOMPRESSEDTEXIMAGE2DPROC pGlCompressedTexImage2D;
// ARB framebuffer object
PFNGLBINDFRAMEBUFFERPROC pGlBindFramebuffer;
PFNGLDELETEFRAMEBUFFERSPROC pGlDeleteFramebuffers;
PFNGLGENFRAMEBUFFERSPROC pGlGenFramebuffers;
PFNGLCHECKFRAMEBUFFERSTATUSPROC pGlCheckFramebufferStatus;
PFNGLFRAMEBUFFERTEXTURE2DPROC pGlFramebufferTexture2D;
PFNGLBINDRENDERBUFFERPROC pGlBindRenderbuffer;
PFNGLDELETERENDERBUFFERSPROC pGlDeleteRenderbuffers;
PFNGLGENRENDERBUFFERSPROC pGlGenRenderbuffers;
PFNGLRENDERBUFFERSTORAGEPROC pGlRenderbufferStorage;
PFNGLFRAMEBUFFERRENDERBUFFERPROC pGlFramebufferRenderbuffer;
// EXT framebuffer object
PFNGLBINDFRAMEBUFFEREXTPROC pGlBindFramebufferEXT;
PFNGLDELETEFRAMEBUFFERSEXTPROC pGlDeleteFramebuffersEXT;
PFNGLGENFRAMEBUFFERSEXTPROC pGlGenFramebuffersEXT;
@ -1831,8 +1875,12 @@ inline void COpenGLExtensionHandler::extGlCompressedTexImage2D (GLenum target, G
inline void COpenGLExtensionHandler::extGlBindFramebuffer(GLenum target, GLuint framebuffer)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlBindFramebufferEXT)
if (pGlBindFramebuffer)
pGlBindFramebuffer(target, framebuffer);
else if (pGlBindFramebufferEXT)
pGlBindFramebufferEXT(target, framebuffer);
#elif defined(GL_ARB_framebuffer_object)
glBindFramebufferARB(target, framebuffer);
#elif defined(GL_EXT_framebuffer_object)
glBindFramebufferEXT(target, framebuffer);
#else
@ -1843,8 +1891,12 @@ inline void COpenGLExtensionHandler::extGlBindFramebuffer(GLenum target, GLuint
inline void COpenGLExtensionHandler::extGlDeleteFramebuffers(GLsizei n, const GLuint *framebuffers)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlDeleteFramebuffersEXT)
if (pGlDeleteFramebuffers)
pGlDeleteFramebuffers(n, framebuffers);
else if (pGlDeleteFramebuffersEXT)
pGlDeleteFramebuffersEXT(n, framebuffers);
#elif defined(GL_ARB_framebuffer_object)
glDeleteFramebuffersARB(n, framebuffers);
#elif defined(GL_EXT_framebuffer_object)
glDeleteFramebuffersEXT(n, framebuffers);
#else
@ -1855,8 +1907,12 @@ inline void COpenGLExtensionHandler::extGlDeleteFramebuffers(GLsizei n, const GL
inline void COpenGLExtensionHandler::extGlGenFramebuffers(GLsizei n, GLuint *framebuffers)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGenFramebuffersEXT)
if (pGlGenFramebuffers)
pGlGenFramebuffers(n, framebuffers);
else if (pGlGenFramebuffersEXT)
pGlGenFramebuffersEXT(n, framebuffers);
#elif defined(GL_ARB_framebuffer_object)
glGenFramebuffersARB(n, framebuffers);
#elif defined(GL_EXT_framebuffer_object)
glGenFramebuffersEXT(n, framebuffers);
#else
@ -1867,10 +1923,14 @@ inline void COpenGLExtensionHandler::extGlGenFramebuffers(GLsizei n, GLuint *fra
inline GLenum COpenGLExtensionHandler::extGlCheckFramebufferStatus(GLenum target)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlCheckFramebufferStatusEXT)
if (pGlCheckFramebufferStatus)
return pGlCheckFramebufferStatus(target);
else if (pGlCheckFramebufferStatusEXT)
return pGlCheckFramebufferStatusEXT(target);
else
return 0;
#elif defined(GL_ARB_framebuffer_object)
return glCheckFramebufferStatusARB(target);
#elif defined(GL_EXT_framebuffer_object)
return glCheckFramebufferStatusEXT(target);
#else
@ -1882,8 +1942,12 @@ inline GLenum COpenGLExtensionHandler::extGlCheckFramebufferStatus(GLenum target
inline void COpenGLExtensionHandler::extGlFramebufferTexture2D(GLenum target, GLenum attachment, GLenum textarget, GLuint texture, GLint level)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlFramebufferTexture2DEXT)
if (pGlFramebufferTexture2D)
pGlFramebufferTexture2D(target, attachment, textarget, texture, level);
else if (pGlFramebufferTexture2DEXT)
pGlFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
#elif defined(GL_ARB_framebuffer_object)
glFramebufferTexture2DARB(target, attachment, textarget, texture, level);
#elif defined(GL_EXT_framebuffer_object)
glFramebufferTexture2DEXT(target, attachment, textarget, texture, level);
#else
@ -1894,8 +1958,12 @@ inline void COpenGLExtensionHandler::extGlFramebufferTexture2D(GLenum target, GL
inline void COpenGLExtensionHandler::extGlBindRenderbuffer(GLenum target, GLuint renderbuffer)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlBindRenderbufferEXT)
if (pGlBindRenderbuffer)
pGlBindRenderbuffer(target, renderbuffer);
else if (pGlBindRenderbufferEXT)
pGlBindRenderbufferEXT(target, renderbuffer);
#elif defined(GL_ARB_framebuffer_object)
glBindRenderbufferARB(target, renderbuffer);
#elif defined(GL_EXT_framebuffer_object)
glBindRenderbufferEXT(target, renderbuffer);
#else
@ -1906,8 +1974,12 @@ inline void COpenGLExtensionHandler::extGlBindRenderbuffer(GLenum target, GLuint
inline void COpenGLExtensionHandler::extGlDeleteRenderbuffers(GLsizei n, const GLuint *renderbuffers)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlDeleteRenderbuffersEXT)
if (pGlDeleteRenderbuffers)
pGlDeleteRenderbuffers(n, renderbuffers);
else if (pGlDeleteRenderbuffersEXT)
pGlDeleteRenderbuffersEXT(n, renderbuffers);
#elif defined(GL_ARB_framebuffer_object)
glDeleteRenderbuffersARB(n, renderbuffers);
#elif defined(GL_EXT_framebuffer_object)
glDeleteRenderbuffersEXT(n, renderbuffers);
#else
@ -1918,8 +1990,12 @@ inline void COpenGLExtensionHandler::extGlDeleteRenderbuffers(GLsizei n, const G
inline void COpenGLExtensionHandler::extGlGenRenderbuffers(GLsizei n, GLuint *renderbuffers)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlGenRenderbuffersEXT)
if (pGlGenRenderbuffers)
pGlGenRenderbuffers(n, renderbuffers);
else if (pGlGenRenderbuffersEXT)
pGlGenRenderbuffersEXT(n, renderbuffers);
#elif defined(GL_ARB_framebuffer_object)
glGenRenderbuffersARB(n, renderbuffers);
#elif defined(GL_EXT_framebuffer_object)
glGenRenderbuffersEXT(n, renderbuffers);
#else
@ -1930,8 +2006,12 @@ inline void COpenGLExtensionHandler::extGlGenRenderbuffers(GLsizei n, GLuint *re
inline void COpenGLExtensionHandler::extGlRenderbufferStorage(GLenum target, GLenum internalformat, GLsizei width, GLsizei height)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlRenderbufferStorageEXT)
if (pGlRenderbufferStorage)
pGlRenderbufferStorage(target, internalformat, width, height);
else if (pGlRenderbufferStorageEXT)
pGlRenderbufferStorageEXT(target, internalformat, width, height);
#elif defined(GL_ARB_framebuffer_object)
glRenderbufferStorageARB(target, internalformat, width, height);
#elif defined(GL_EXT_framebuffer_object)
glRenderbufferStorageEXT(target, internalformat, width, height);
#else
@ -1942,8 +2022,12 @@ inline void COpenGLExtensionHandler::extGlRenderbufferStorage(GLenum target, GLe
inline void COpenGLExtensionHandler::extGlFramebufferRenderbuffer(GLenum target, GLenum attachment, GLenum renderbuffertarget, GLuint renderbuffer)
{
#ifdef _IRR_OPENGL_USE_EXTPOINTER_
if (pGlFramebufferRenderbufferEXT)
if (pGlFramebufferRenderbuffer)
pGlFramebufferRenderbuffer(target, attachment, renderbuffertarget, renderbuffer);
else if (pGlFramebufferRenderbufferEXT)
pGlFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
#elif defined(GL_ARB_framebuffer_object)
glFramebufferRenderbufferARB(target, attachment, renderbuffertarget, renderbuffer);
#elif defined(GL_EXT_framebuffer_object)
glFramebufferRenderbufferEXT(target, attachment, renderbuffertarget, renderbuffer);
#else

View File

@ -23,8 +23,8 @@ namespace scene
#define PLY_INPUT_BUFFER_SIZE 51200 // file is loaded in 50k chunks
// constructor
CPLYMeshFileLoader::CPLYMeshFileLoader()
: File(0), Buffer(0)
CPLYMeshFileLoader::CPLYMeshFileLoader(scene::ISceneManager* smgr)
: SceneManager(smgr), File(0), Buffer(0)
{
}
@ -233,6 +233,7 @@ IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file)
mb->getIndexBuffer().reallocate(vertCount);
mb->setHardwareMappingHint(EHM_STATIC);
bool hasNormals=true;
// loop through each of the elements
for (u32 i=0; i<ElementList.size(); ++i)
{
@ -241,7 +242,7 @@ IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file)
{
// loop through vertex properties
for (u32 j=0; j < ElementList[i]->Count; ++j)
readVertex(*ElementList[i], mb);
hasNormals &= readVertex(*ElementList[i], mb);
}
else if (ElementList[i]->Name == "face")
{
@ -257,6 +258,8 @@ IAnimatedMesh* CPLYMeshFileLoader::createMesh(io::IReadFile* file)
}
}
mb->recalculateBoundingBox();
if (!hasNormals)
SceneManager->getMeshManipulator()->recalculateNormals(mb);
SMesh* m = new SMesh();
m->addMeshBuffer(mb);
m->recalculateBoundingBox();
@ -292,6 +295,7 @@ bool CPLYMeshFileLoader::readVertex(const SPLYElement &Element, scene::CDynamicM
vert.Normal.Y = 1.0f;
vert.Normal.Z = 0.0f;
bool result=false;
for (u32 i=0; i < Element.Properties.size(); ++i)
{
E_PLY_PROPERTY_TYPE t = Element.Properties[i].Type;
@ -303,11 +307,20 @@ bool CPLYMeshFileLoader::readVertex(const SPLYElement &Element, scene::CDynamicM
else if (Element.Properties[i].Name == "z")
vert.Pos.Y = getFloat(t);
else if (Element.Properties[i].Name == "nx")
{
vert.Normal.X = getFloat(t);
result=true;
}
else if (Element.Properties[i].Name == "ny")
{
vert.Normal.Z = getFloat(t);
result=true;
}
else if (Element.Properties[i].Name == "nz")
{
vert.Normal.Y = getFloat(t);
result=true;
}
else if (Element.Properties[i].Name == "u")
vert.TCoords.X = getFloat(t);
else if (Element.Properties[i].Name == "v")
@ -338,7 +351,7 @@ bool CPLYMeshFileLoader::readVertex(const SPLYElement &Element, scene::CDynamicM
mb->getVertexBuffer().push_back(vert);
return true;
return result;
}
bool CPLYMeshFileLoader::readFace(const SPLYElement &Element, scene::CDynamicMeshBuffer* mb)

View File

@ -6,6 +6,7 @@
#define __C_PLY_MESH_FILE_LOADER_H_INCLUDED__
#include "IMeshLoader.h"
#include "ISceneManager.h"
#include "CDynamicMeshBuffer.h"
namespace irr
@ -30,7 +31,7 @@ class CPLYMeshFileLoader : public IMeshLoader
public:
//! Constructor
CPLYMeshFileLoader();
CPLYMeshFileLoader(scene::ISceneManager* smgr);
//! Destructor
virtual ~CPLYMeshFileLoader();
@ -132,6 +133,7 @@ private:
core::array<SPLYElement*> ElementList;
scene::ISceneManager* SceneManager;
io::IReadFile *File;
c8 *Buffer;
bool IsBinaryFile, IsWrongEndian, EndOfFile;

View File

@ -237,7 +237,7 @@ CSceneManager::CSceneManager(video::IVideoDriver* driver, io::IFileSystem* fs,
MeshLoaderList.push_back(new CSTLMeshFileLoader());
#endif
#ifdef _IRR_COMPILE_WITH_PLY_LOADER_
MeshLoaderList.push_back(new CPLYMeshFileLoader());
MeshLoaderList.push_back(new CPLYMeshFileLoader(this));
#endif
#ifdef _IRR_COMPILE_WITH_SMF_LOADER_
MeshLoaderList.push_back(new CSMFMeshFileLoader(Driver));
@ -992,7 +992,7 @@ IAnimatedMesh* CSceneManager::addTerrainMesh(const io::path& name,
const bool debugBorders=false;
IMesh* mesh = GeometryCreator->createTerrainMesh(texture, heightmap,
stretchSize, maxHeight, getVideoDriver(),
stretchSize, maxHeight, Driver,
defaultVertexBlockSize, debugBorders);
if (!mesh)
return 0;
@ -1358,18 +1358,13 @@ void CSceneManager::drawAll()
u32 i; // new ISO for scoping problem in some compilers
// reset all transforms
video::IVideoDriver* driver = getVideoDriver();
if (driver)
{
driver->setMaterial(video::SMaterial());
driver->setTransform ( video::ETS_PROJECTION, core::IdentityMatrix );
driver->setTransform ( video::ETS_VIEW, core::IdentityMatrix );
driver->setTransform ( video::ETS_WORLD, core::IdentityMatrix );
for (i=video::ETS_COUNT-1; i>=video::ETS_TEXTURE_0; --i)
driver->setTransform ( (video::E_TRANSFORMATION_STATE)i, core::IdentityMatrix );
}
driver->setAllowZWriteOnTransparent(Parameters.getAttributeAsBool( ALLOW_ZWRITE_ON_TRANSPARENT) );
Driver->setMaterial(video::SMaterial());
Driver->setTransform ( video::ETS_PROJECTION, core::IdentityMatrix );
Driver->setTransform ( video::ETS_VIEW, core::IdentityMatrix );
Driver->setTransform ( video::ETS_WORLD, core::IdentityMatrix );
for (i=video::ETS_COUNT-1; i>=video::ETS_TEXTURE_0; --i)
Driver->setTransform ( (video::E_TRANSFORMATION_STATE)i, core::IdentityMatrix );
Driver->setAllowZWriteOnTransparent(Parameters.getAttributeAsBool( ALLOW_ZWRITE_ON_TRANSPARENT) );
// do animations and other stuff.
OnAnimate(os::Timer::getTime());
@ -2169,6 +2164,7 @@ bool CSceneManager::loadScene(const io::path& filename, ISceneUserDataSerializer
if (!ret)
os::Printer::log("Could not load scene file, perhaps the format is unsupported: ", filename.c_str(), ELL_ERROR);
file->drop();
_IRR_IMPLEMENT_MANAGED_MARSHALLING_BUGFIX;
return ret;
@ -2244,7 +2240,7 @@ void CSceneManager::writeSceneNode(io::IXMLWriter* writer, ISceneNode* node, ISc
// write materials
if (node->getMaterialCount() && getVideoDriver())
if (node->getMaterialCount() && Driver)
{
const wchar_t* materialElement = L"materials";
@ -2254,7 +2250,7 @@ void CSceneManager::writeSceneNode(io::IXMLWriter* writer, ISceneNode* node, ISc
for (u32 i=0; i < node->getMaterialCount(); ++i)
{
io::IAttributes* tmp_attr =
getVideoDriver()->createAttributesFromMaterial(node->getMaterial(i), &options);
Driver->createAttributesFromMaterial(node->getMaterial(i), &options);
tmp_attr->write(writer);
tmp_attr->drop();
}

View File

@ -37,11 +37,11 @@ CSceneNodeAnimatorCameraFPS::CSceneNodeAnimatorCameraFPS(gui::ICursorControl* cu
if (!keyMapArray || !keyMapSize)
{
// create default key map
KeyMap.push_back(SCamKeyMap(EKA_MOVE_FORWARD, irr::KEY_UP));
KeyMap.push_back(SCamKeyMap(EKA_MOVE_BACKWARD, irr::KEY_DOWN));
KeyMap.push_back(SCamKeyMap(EKA_STRAFE_LEFT, irr::KEY_LEFT));
KeyMap.push_back(SCamKeyMap(EKA_STRAFE_RIGHT, irr::KEY_RIGHT));
KeyMap.push_back(SCamKeyMap(EKA_JUMP_UP, irr::KEY_KEY_J));
KeyMap.push_back(SKeyMap(EKA_MOVE_FORWARD, irr::KEY_UP));
KeyMap.push_back(SKeyMap(EKA_MOVE_BACKWARD, irr::KEY_DOWN));
KeyMap.push_back(SKeyMap(EKA_STRAFE_LEFT, irr::KEY_LEFT));
KeyMap.push_back(SKeyMap(EKA_STRAFE_RIGHT, irr::KEY_RIGHT));
KeyMap.push_back(SKeyMap(EKA_JUMP_UP, irr::KEY_KEY_J));
}
else
{
@ -71,9 +71,9 @@ bool CSceneNodeAnimatorCameraFPS::OnEvent(const SEvent& evt)
case EET_KEY_INPUT_EVENT:
for (u32 i=0; i<KeyMap.size(); ++i)
{
if (KeyMap[i].keycode == evt.KeyInput.Key)
if (KeyMap[i].KeyCode == evt.KeyInput.Key)
{
CursorKeys[KeyMap[i].action] = evt.KeyInput.PressedDown;
CursorKeys[KeyMap[i].Action] = evt.KeyInput.PressedDown;
return true;
}
}
@ -257,7 +257,7 @@ void CSceneNodeAnimatorCameraFPS::animateNode(ISceneNode* node, u32 timeMs)
void CSceneNodeAnimatorCameraFPS::allKeysUp()
{
for (u32 i=0; i<6; ++i)
for (u32 i=0; i<EKA_COUNT; ++i)
CursorKeys[i] = false;
}
@ -299,24 +299,20 @@ void CSceneNodeAnimatorCameraFPS::setKeyMap(SKeyMap *map, u32 count)
// add actions
for (u32 i=0; i<count; ++i)
{
switch(map[i].Action)
{
case EKA_MOVE_FORWARD: KeyMap.push_back(SCamKeyMap(EKA_MOVE_FORWARD, map[i].KeyCode));
break;
case EKA_MOVE_BACKWARD: KeyMap.push_back(SCamKeyMap(EKA_MOVE_BACKWARD, map[i].KeyCode));
break;
case EKA_STRAFE_LEFT: KeyMap.push_back(SCamKeyMap(EKA_STRAFE_LEFT, map[i].KeyCode));
break;
case EKA_STRAFE_RIGHT: KeyMap.push_back(SCamKeyMap(EKA_STRAFE_RIGHT, map[i].KeyCode));
break;
case EKA_JUMP_UP: KeyMap.push_back(SCamKeyMap(EKA_JUMP_UP, map[i].KeyCode));
break;
default:
break;
}
KeyMap.push_back(map[i]);
}
}
void CSceneNodeAnimatorCameraFPS::setKeyMap(const core::array<SKeyMap>& keymap)
{
KeyMap=keymap;
}
const core::array<SKeyMap>& CSceneNodeAnimatorCameraFPS::getKeyMap() const
{
return KeyMap;
}
//! Sets whether vertical movement should be allowed.
void CSceneNodeAnimatorCameraFPS::setVerticalMovement(bool allow)
@ -345,12 +341,6 @@ ISceneNodeAnimator* CSceneNodeAnimatorCameraFPS::createClone(ISceneNode* node, I
}
void CSceneNodeAnimatorCameraFPS::setKeyMap(const core::array<SCamKeyMap>& keymap)
{
KeyMap=keymap;
}
} // namespace scene
} // namespace irr

View File

@ -53,11 +53,18 @@ namespace scene
//! Set the rotation speed
virtual void setRotateSpeed(f32 rotateSpeed);
//! Sets the keyboard mapping for this animator
//! Sets the keyboard mapping for this animator (old style)
//! \param keymap: an array of keyboard mappings, see SKeyMap
//! \param count: the size of the keyboard map array
virtual void setKeyMap(SKeyMap *map, u32 count);
//! Sets the keyboard mapping for this animator
//! \param keymap The new keymap array
virtual void setKeyMap(const core::array<SKeyMap>& keymap);
//! Gets the keyboard mapping for this animator
virtual const core::array<SKeyMap>& getKeyMap() const;
//! Sets whether vertical movement should be allowed.
virtual void setVerticalMovement(bool allow);
@ -84,20 +91,6 @@ namespace scene
done with it. */
virtual ISceneNodeAnimator* createClone(ISceneNode* node, ISceneManager* newManager=0);
struct SCamKeyMap
{
SCamKeyMap() {};
SCamKeyMap(s32 a, EKEY_CODE k) : action(a), keycode(k) {}
s32 action;
EKEY_CODE keycode;
};
//! Sets the keyboard mapping for this animator
/** Helper function for the clone method.
\param keymap the new keymap array */
void setKeyMap(const core::array<SCamKeyMap>& keymap);
private:
void allKeysUp();
@ -113,10 +106,10 @@ namespace scene
s32 LastAnimationTime;
core::array<SCamKeyMap> KeyMap;
core::array<SKeyMap> KeyMap;
core::position2d<f32> CenterCursor, CursorPos;
bool CursorKeys[6];
bool CursorKeys[EKA_COUNT];
bool firstUpdate;
bool NoVerticalMovement;

View File

@ -19,7 +19,8 @@ namespace scene
//! constructor
CSkinnedMesh::CSkinnedMesh()
: SkinningBuffers(0), AnimationFrames(0.f), FramesPerSecond(25.f),
LastAnimatedFrame(0.f), InterpolationMode(EIM_LINEAR),
LastAnimatedFrame(-1), SkinnedLastFrame(false),
InterpolationMode(EIM_LINEAR),
HasAnimation(false), PreparedForSkinning(false),
AnimateNormals(true), HardwareSkinning(false)
{
@ -96,6 +97,7 @@ void CSkinnedMesh::animateMesh(f32 frame, f32 blend)
return;
LastAnimatedFrame=frame;
SkinnedLastFrame=false;
if (blend<=0.f)
return; //No need to animate
@ -213,6 +215,7 @@ void CSkinnedMesh::buildAllLocalAnimatedMatrices()
joint->LocalAnimatedMatrix=joint->LocalMatrix;
}
}
SkinnedLastFrame=false;
}
@ -442,7 +445,7 @@ void CSkinnedMesh::getFrameData(f32 frame, SJoint *joint,
//! Preforms a software skin on this mesh based of joint positions
void CSkinnedMesh::skinMesh()
{
if (!HasAnimation)
if (!HasAnimation || SkinnedLastFrame)
return;
//----------------
@ -450,6 +453,7 @@ void CSkinnedMesh::skinMesh()
buildAllGlobalAnimatedMatrices();
//-----------------
SkinnedLastFrame=true;
if (!HardwareSkinning)
{
//Software skin....
@ -763,6 +767,7 @@ void CSkinnedMesh::calculateGlobalMatrices(SJoint *joint,SJoint *parentJoint)
for (u32 j=0; j<joint->Children.size(); ++j)
calculateGlobalMatrices(joint->Children[j],joint);
SkinnedLastFrame=false;
}
@ -871,6 +876,7 @@ void CSkinnedMesh::checkForAnimation()
// normalize weights
normalizeWeights();
}
SkinnedLastFrame=false;
}
@ -881,6 +887,7 @@ void CSkinnedMesh::finalize()
// Make sure we recalc the next frame
LastAnimatedFrame=-1;
SkinnedLastFrame=false;
//calculate bounding box
for (i=0; i<LocalBuffers.size(); ++i)
@ -1300,6 +1307,7 @@ void CSkinnedMesh::transferJointsToMesh(const core::array<IBoneSceneNode*> &join
}
// Make sure we recalc the next frame
LastAnimatedFrame=-1;
SkinnedLastFrame=false;
}
@ -1314,6 +1322,7 @@ void CSkinnedMesh::transferOnlyJointsHintsToMesh(const core::array<IBoneSceneNod
joint->scaleHint=node->scaleHint;
joint->rotationHint=node->rotationHint;
}
SkinnedLastFrame=false;
}
@ -1357,6 +1366,7 @@ void CSkinnedMesh::addJoints(core::array<IBoneSceneNode*> &jointChildSceneNodes,
bone->drop();
}
SkinnedLastFrame=false;
}

View File

@ -198,6 +198,7 @@ private:
f32 FramesPerSecond;
f32 LastAnimatedFrame;
bool SkinnedLastFrame;
E_INTERPOLATION_MODE InterpolationMode:8;

View File

@ -794,9 +794,12 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
SizeT tmpDstSize = uncompressedSize;
SizeT tmpSrcSize = decryptedSize;
unsigned int propSize = (pcData[3]<<8)+pcData[2];
int err = LzmaDecode((Byte*)pBuf, &tmpDstSize,
pcData, &tmpSrcSize,
0, 0, LZMA_FINISH_END, &status, &lzmaAlloc);
pcData+4+propSize, &tmpSrcSize,
pcData+4, propSize,
e.header.GeneralBitFlag&0x1?LZMA_FINISH_END:LZMA_FINISH_ANY, &status,
&lzmaAlloc);
uncompressedSize = tmpDstSize; // may be different to expected value
if (decrypted)
@ -806,8 +809,7 @@ IReadFile* CZipReader::createAndOpenFile(u32 index)
if (err != SZ_OK)
{
swprintf ( buf, 64, L"Error decompressing %s", Files[index].FullName.c_str() );
os::Printer::log( buf, ELL_ERROR);
os::Printer::log( "Error decompressing", Files[index].FullName, ELL_ERROR);
delete [] pBuf;
return 0;
}

View File

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2011 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the
@ -29,9 +29,9 @@ extern "C" {
*/
/* Header file version number, required by OpenGL ABI for Linux */
/* glext.h last updated $Date: 2011-04-05 23:08:32 -0700 (Tue, 05 Apr 2011) $ */
/* glext.h last updated $Date: 2011-08-08 00:34:29 -0700 (Mon, 08 Aug 2011) $ */
/* Current version at http://www.opengl.org/registry/ */
#define GL_GLEXT_VERSION 68
#define GL_GLEXT_VERSION 72
/* Function declaration macros - to move into glplatform.h */
#if defined(_WIN32) && !defined(APIENTRY) && !defined(__CYGWIN__) && !defined(__SCITECH_SNAP__)
@ -1047,6 +1047,124 @@ extern "C" {
/* reuse GL_UNDEFINED_VERTEX */
#endif
#ifndef GL_VERSION_4_2
/* Reuse tokens from ARB_base_instance (none) */
/* Reuse tokens from ARB_shading_language_420pack (none) */
/* Reuse tokens from ARB_transform_feedback_instanced (none) */
/* Reuse tokens from ARB_compressed_texture_pixel_storage */
/* reuse GL_UNPACK_COMPRESSED_BLOCK_WIDTH */
/* reuse GL_UNPACK_COMPRESSED_BLOCK_HEIGHT */
/* reuse GL_UNPACK_COMPRESSED_BLOCK_DEPTH */
/* reuse GL_UNPACK_COMPRESSED_BLOCK_SIZE */
/* reuse GL_PACK_COMPRESSED_BLOCK_WIDTH */
/* reuse GL_PACK_COMPRESSED_BLOCK_HEIGHT */
/* reuse GL_PACK_COMPRESSED_BLOCK_DEPTH */
/* reuse GL_PACK_COMPRESSED_BLOCK_SIZE */
/* Reuse tokens from ARB_conservative_depth (none) */
/* Reuse tokens from ARB_internalformat_query */
/* reuse GL_NUM_SAMPLE_COUNTS */
/* Reuse tokens from ARB_map_buffer_alignment */
/* reuse GL_MIN_MAP_BUFFER_ALIGNMENT */
/* Reuse tokens from ARB_shader_atomic_counters */
/* reuse GL_ATOMIC_COUNTER_BUFFER */
/* reuse GL_ATOMIC_COUNTER_BUFFER_BINDING */
/* reuse GL_ATOMIC_COUNTER_BUFFER_START */
/* reuse GL_ATOMIC_COUNTER_BUFFER_SIZE */
/* reuse GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE */
/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS */
/* reuse GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES */
/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER */
/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER */
/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER */
/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER */
/* reuse GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER */
/* reuse GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_MAX_VERTEX_ATOMIC_COUNTERS */
/* reuse GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS */
/* reuse GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS */
/* reuse GL_MAX_GEOMETRY_ATOMIC_COUNTERS */
/* reuse GL_MAX_FRAGMENT_ATOMIC_COUNTERS */
/* reuse GL_MAX_COMBINED_ATOMIC_COUNTERS */
/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE */
/* reuse GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS */
/* reuse GL_ACTIVE_ATOMIC_COUNTER_BUFFERS */
/* reuse GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX */
/* reuse GL_UNSIGNED_INT_ATOMIC_COUNTER */
/* Reuse tokens from ARB_shader_image_load_store */
/* reuse GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT */
/* reuse GL_ELEMENT_ARRAY_BARRIER_BIT */
/* reuse GL_UNIFORM_BARRIER_BIT */
/* reuse GL_TEXTURE_FETCH_BARRIER_BIT */
/* reuse GL_SHADER_IMAGE_ACCESS_BARRIER_BIT */
/* reuse GL_COMMAND_BARRIER_BIT */
/* reuse GL_PIXEL_BUFFER_BARRIER_BIT */
/* reuse GL_TEXTURE_UPDATE_BARRIER_BIT */
/* reuse GL_BUFFER_UPDATE_BARRIER_BIT */
/* reuse GL_FRAMEBUFFER_BARRIER_BIT */
/* reuse GL_TRANSFORM_FEEDBACK_BARRIER_BIT */
/* reuse GL_ATOMIC_COUNTER_BARRIER_BIT */
/* reuse GL_ALL_BARRIER_BITS */
/* reuse GL_MAX_IMAGE_UNITS */
/* reuse GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS */
/* reuse GL_IMAGE_BINDING_NAME */
/* reuse GL_IMAGE_BINDING_LEVEL */
/* reuse GL_IMAGE_BINDING_LAYERED */
/* reuse GL_IMAGE_BINDING_LAYER */
/* reuse GL_IMAGE_BINDING_ACCESS */
/* reuse GL_IMAGE_1D */
/* reuse GL_IMAGE_2D */
/* reuse GL_IMAGE_3D */
/* reuse GL_IMAGE_2D_RECT */
/* reuse GL_IMAGE_CUBE */
/* reuse GL_IMAGE_BUFFER */
/* reuse GL_IMAGE_1D_ARRAY */
/* reuse GL_IMAGE_2D_ARRAY */
/* reuse GL_IMAGE_CUBE_MAP_ARRAY */
/* reuse GL_IMAGE_2D_MULTISAMPLE */
/* reuse GL_IMAGE_2D_MULTISAMPLE_ARRAY */
/* reuse GL_INT_IMAGE_1D */
/* reuse GL_INT_IMAGE_2D */
/* reuse GL_INT_IMAGE_3D */
/* reuse GL_INT_IMAGE_2D_RECT */
/* reuse GL_INT_IMAGE_CUBE */
/* reuse GL_INT_IMAGE_BUFFER */
/* reuse GL_INT_IMAGE_1D_ARRAY */
/* reuse GL_INT_IMAGE_2D_ARRAY */
/* reuse GL_INT_IMAGE_CUBE_MAP_ARRAY */
/* reuse GL_INT_IMAGE_2D_MULTISAMPLE */
/* reuse GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
/* reuse GL_UNSIGNED_INT_IMAGE_1D */
/* reuse GL_UNSIGNED_INT_IMAGE_2D */
/* reuse GL_UNSIGNED_INT_IMAGE_3D */
/* reuse GL_UNSIGNED_INT_IMAGE_2D_RECT */
/* reuse GL_UNSIGNED_INT_IMAGE_CUBE */
/* reuse GL_UNSIGNED_INT_IMAGE_BUFFER */
/* reuse GL_UNSIGNED_INT_IMAGE_1D_ARRAY */
/* reuse GL_UNSIGNED_INT_IMAGE_2D_ARRAY */
/* reuse GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY */
/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE */
/* reuse GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY */
/* reuse GL_MAX_IMAGE_SAMPLES */
/* reuse GL_IMAGE_BINDING_FORMAT */
/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_TYPE */
/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE */
/* reuse GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS */
/* reuse GL_MAX_VERTEX_IMAGE_UNIFORMS */
/* reuse GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS */
/* reuse GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS */
/* reuse GL_MAX_GEOMETRY_IMAGE_UNIFORMS */
/* reuse GL_MAX_FRAGMENT_IMAGE_UNIFORMS */
/* reuse GL_MAX_COMBINED_IMAGE_UNIFORMS */
/* Reuse tokens from ARB_shading_language_packing (none) */
/* Reuse tokens from ARB_texture_storage */
/* reuse GL_TEXTURE_IMMUTABLE_FORMAT */
#endif
#ifndef GL_ARB_multitexture
#define GL_TEXTURE0_ARB 0x84C0
#define GL_TEXTURE1_ARB 0x84C1
@ -2140,6 +2258,143 @@ extern "C" {
#ifndef GL_ARB_shader_stencil_export
#endif
#ifndef GL_ARB_base_instance
#endif
#ifndef GL_ARB_shading_language_420pack
#endif
#ifndef GL_ARB_transform_feedback_instanced
#endif
#ifndef GL_ARB_compressed_texture_pixel_storage
#define GL_UNPACK_COMPRESSED_BLOCK_WIDTH 0x9127
#define GL_UNPACK_COMPRESSED_BLOCK_HEIGHT 0x9128
#define GL_UNPACK_COMPRESSED_BLOCK_DEPTH 0x9129
#define GL_UNPACK_COMPRESSED_BLOCK_SIZE 0x912A
#define GL_PACK_COMPRESSED_BLOCK_WIDTH 0x912B
#define GL_PACK_COMPRESSED_BLOCK_HEIGHT 0x912C
#define GL_PACK_COMPRESSED_BLOCK_DEPTH 0x912D
#define GL_PACK_COMPRESSED_BLOCK_SIZE 0x912E
#endif
#ifndef GL_ARB_conservative_depth
#endif
#ifndef GL_ARB_internalformat_query
#define GL_NUM_SAMPLE_COUNTS 0x9380
#endif
#ifndef GL_ARB_map_buffer_alignment
#define GL_MIN_MAP_BUFFER_ALIGNMENT 0x90BC
#endif
#ifndef GL_ARB_shader_atomic_counters
#define GL_ATOMIC_COUNTER_BUFFER 0x92C0
#define GL_ATOMIC_COUNTER_BUFFER_BINDING 0x92C1
#define GL_ATOMIC_COUNTER_BUFFER_START 0x92C2
#define GL_ATOMIC_COUNTER_BUFFER_SIZE 0x92C3
#define GL_ATOMIC_COUNTER_BUFFER_DATA_SIZE 0x92C4
#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTERS 0x92C5
#define GL_ATOMIC_COUNTER_BUFFER_ACTIVE_ATOMIC_COUNTER_INDICES 0x92C6
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_VERTEX_SHADER 0x92C7
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_CONTROL_SHADER 0x92C8
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_TESS_EVALUATION_SHADER 0x92C9
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_GEOMETRY_SHADER 0x92CA
#define GL_ATOMIC_COUNTER_BUFFER_REFERENCED_BY_FRAGMENT_SHADER 0x92CB
#define GL_MAX_VERTEX_ATOMIC_COUNTER_BUFFERS 0x92CC
#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTER_BUFFERS 0x92CD
#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTER_BUFFERS 0x92CE
#define GL_MAX_GEOMETRY_ATOMIC_COUNTER_BUFFERS 0x92CF
#define GL_MAX_FRAGMENT_ATOMIC_COUNTER_BUFFERS 0x92D0
#define GL_MAX_COMBINED_ATOMIC_COUNTER_BUFFERS 0x92D1
#define GL_MAX_VERTEX_ATOMIC_COUNTERS 0x92D2
#define GL_MAX_TESS_CONTROL_ATOMIC_COUNTERS 0x92D3
#define GL_MAX_TESS_EVALUATION_ATOMIC_COUNTERS 0x92D4
#define GL_MAX_GEOMETRY_ATOMIC_COUNTERS 0x92D5
#define GL_MAX_FRAGMENT_ATOMIC_COUNTERS 0x92D6
#define GL_MAX_COMBINED_ATOMIC_COUNTERS 0x92D7
#define GL_MAX_ATOMIC_COUNTER_BUFFER_SIZE 0x92D8
#define GL_MAX_ATOMIC_COUNTER_BUFFER_BINDINGS 0x92DC
#define GL_ACTIVE_ATOMIC_COUNTER_BUFFERS 0x92D9
#define GL_UNIFORM_ATOMIC_COUNTER_BUFFER_INDEX 0x92DA
#define GL_UNSIGNED_INT_ATOMIC_COUNTER 0x92DB
#endif
#ifndef GL_ARB_shader_image_load_store
#define GL_VERTEX_ATTRIB_ARRAY_BARRIER_BIT 0x00000001
#define GL_ELEMENT_ARRAY_BARRIER_BIT 0x00000002
#define GL_UNIFORM_BARRIER_BIT 0x00000004
#define GL_TEXTURE_FETCH_BARRIER_BIT 0x00000008
#define GL_SHADER_IMAGE_ACCESS_BARRIER_BIT 0x00000020
#define GL_COMMAND_BARRIER_BIT 0x00000040
#define GL_PIXEL_BUFFER_BARRIER_BIT 0x00000080
#define GL_TEXTURE_UPDATE_BARRIER_BIT 0x00000100
#define GL_BUFFER_UPDATE_BARRIER_BIT 0x00000200
#define GL_FRAMEBUFFER_BARRIER_BIT 0x00000400
#define GL_TRANSFORM_FEEDBACK_BARRIER_BIT 0x00000800
#define GL_ATOMIC_COUNTER_BARRIER_BIT 0x00001000
#define GL_ALL_BARRIER_BITS 0xFFFFFFFF
#define GL_MAX_IMAGE_UNITS 0x8F38
#define GL_MAX_COMBINED_IMAGE_UNITS_AND_FRAGMENT_OUTPUTS 0x8F39
#define GL_IMAGE_BINDING_NAME 0x8F3A
#define GL_IMAGE_BINDING_LEVEL 0x8F3B
#define GL_IMAGE_BINDING_LAYERED 0x8F3C
#define GL_IMAGE_BINDING_LAYER 0x8F3D
#define GL_IMAGE_BINDING_ACCESS 0x8F3E
#define GL_IMAGE_1D 0x904C
#define GL_IMAGE_2D 0x904D
#define GL_IMAGE_3D 0x904E
#define GL_IMAGE_2D_RECT 0x904F
#define GL_IMAGE_CUBE 0x9050
#define GL_IMAGE_BUFFER 0x9051
#define GL_IMAGE_1D_ARRAY 0x9052
#define GL_IMAGE_2D_ARRAY 0x9053
#define GL_IMAGE_CUBE_MAP_ARRAY 0x9054
#define GL_IMAGE_2D_MULTISAMPLE 0x9055
#define GL_IMAGE_2D_MULTISAMPLE_ARRAY 0x9056
#define GL_INT_IMAGE_1D 0x9057
#define GL_INT_IMAGE_2D 0x9058
#define GL_INT_IMAGE_3D 0x9059
#define GL_INT_IMAGE_2D_RECT 0x905A
#define GL_INT_IMAGE_CUBE 0x905B
#define GL_INT_IMAGE_BUFFER 0x905C
#define GL_INT_IMAGE_1D_ARRAY 0x905D
#define GL_INT_IMAGE_2D_ARRAY 0x905E
#define GL_INT_IMAGE_CUBE_MAP_ARRAY 0x905F
#define GL_INT_IMAGE_2D_MULTISAMPLE 0x9060
#define GL_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x9061
#define GL_UNSIGNED_INT_IMAGE_1D 0x9062
#define GL_UNSIGNED_INT_IMAGE_2D 0x9063
#define GL_UNSIGNED_INT_IMAGE_3D 0x9064
#define GL_UNSIGNED_INT_IMAGE_2D_RECT 0x9065
#define GL_UNSIGNED_INT_IMAGE_CUBE 0x9066
#define GL_UNSIGNED_INT_IMAGE_BUFFER 0x9067
#define GL_UNSIGNED_INT_IMAGE_1D_ARRAY 0x9068
#define GL_UNSIGNED_INT_IMAGE_2D_ARRAY 0x9069
#define GL_UNSIGNED_INT_IMAGE_CUBE_MAP_ARRAY 0x906A
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE 0x906B
#define GL_UNSIGNED_INT_IMAGE_2D_MULTISAMPLE_ARRAY 0x906C
#define GL_MAX_IMAGE_SAMPLES 0x906D
#define GL_IMAGE_BINDING_FORMAT 0x906E
#define GL_IMAGE_FORMAT_COMPATIBILITY_TYPE 0x90C7
#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_SIZE 0x90C8
#define GL_IMAGE_FORMAT_COMPATIBILITY_BY_CLASS 0x90C9
#define GL_MAX_VERTEX_IMAGE_UNIFORMS 0x90CA
#define GL_MAX_TESS_CONTROL_IMAGE_UNIFORMS 0x90CB
#define GL_MAX_TESS_EVALUATION_IMAGE_UNIFORMS 0x90CC
#define GL_MAX_GEOMETRY_IMAGE_UNIFORMS 0x90CD
#define GL_MAX_FRAGMENT_IMAGE_UNIFORMS 0x90CE
#define GL_MAX_COMBINED_IMAGE_UNIFORMS 0x90CF
#endif
#ifndef GL_ARB_shading_language_packing
#endif
#ifndef GL_ARB_texture_storage
#define GL_TEXTURE_IMMUTABLE_FORMAT 0x912F
#endif
#ifndef GL_EXT_abgr
#define GL_ABGR_EXT 0x8000
#endif
@ -5042,6 +5297,22 @@ extern "C" {
#define GL_FACTOR_MAX_AMD 0x901D
#endif
#ifndef GL_AMD_sample_positions
#define GL_SUBSAMPLE_DISTANCE_AMD 0x883F
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_SYNC_X11_FENCE_EXT 0x90E1
#endif
#ifndef GL_AMD_multi_draw_indirect
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_SCALED_RESOLVE_FASTEST_EXT 0x90BA
#define GL_SCALED_RESOLVE_NICEST_EXT 0x90BB
#endif
/*************************************************************/
@ -5901,7 +6172,7 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB,
#ifndef GL_VERSION_4_1
#define GL_VERSION_4_1 1
/* OpenGL 4.1 also reuses entry points from these extensions: */
/* OpenGL 4.1 reuses entry points from these extensions: */
/* ARB_ES2_compatibility */
/* ARB_get_program_binary */
/* ARB_separate_shader_objects */
@ -5910,6 +6181,22 @@ typedef void (APIENTRYP PFNGLBLENDFUNCSEPARATEIPROC) (GLuint buf, GLenum srcRGB,
/* ARB_viewport_array */
#endif
#ifndef GL_VERSION_4_2
#define GL_VERSION_4_2 1
/* OpenGL 4.2 reuses entry points from these extensions: */
/* ARB_base_instance */
/* ARB_shading_language_420pack (no entry points) */
/* ARB_transform_feedback_instanced */
/* ARB_compressed_texture_pixel_storage (no entry points) */
/* ARB_conservative_depth (no entry points) */
/* ARB_internalformat_query */
/* ARB_map_buffer_alignment (no entry points) */
/* ARB_shader_atomic_counters */
/* ARB_shader_image_load_store */
/* ARB_shading_language_packing (no entry points) */
/* ARB_texture_storage */
#endif
#ifndef GL_ARB_multitexture
#define GL_ARB_multitexture 1
#ifdef GL_GLEXT_PROTOTYPES
@ -6835,6 +7122,10 @@ typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERFVPROC) (GLuint sampler, GLenum
typedef void (APIENTRYP PFNGLGETSAMPLERPARAMETERIUIVPROC) (GLuint sampler, GLenum pname, GLuint *params);
#endif
#ifndef GL_ARB_shader_bit_encoding
#define GL_ARB_shader_bit_encoding 1
#endif
#ifndef GL_ARB_texture_rgb10_a2ui
#define GL_ARB_texture_rgb10_a2ui 1
#endif
@ -7341,6 +7632,92 @@ typedef void (APIENTRYP PFNGLGETNUNIFORMDVARBPROC) (GLuint program, GLint locati
#define GL_ARB_shader_stencil_export 1
#endif
#ifndef GL_ARB_base_instance
#define GL_ARB_base_instance 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawArraysInstancedBaseInstance (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
GLAPI void APIENTRY glDrawElementsInstancedBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance);
GLAPI void APIENTRY glDrawElementsInstancedBaseVertexBaseInstance (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDRAWARRAYSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLint first, GLsizei count, GLsizei primcount, GLuint baseinstance);
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLuint baseinstance);
typedef void (APIENTRYP PFNGLDRAWELEMENTSINSTANCEDBASEVERTEXBASEINSTANCEPROC) (GLenum mode, GLsizei count, GLenum type, const void *indices, GLsizei primcount, GLint basevertex, GLuint baseinstance);
#endif
#ifndef GL_ARB_shading_language_420pack
#define GL_ARB_shading_language_420pack 1
#endif
#ifndef GL_ARB_transform_feedback_instanced
#define GL_ARB_transform_feedback_instanced 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glDrawTransformFeedbackInstanced (GLenum mode, GLuint id, GLsizei primcount);
GLAPI void APIENTRY glDrawTransformFeedbackStreamInstanced (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKINSTANCEDPROC) (GLenum mode, GLuint id, GLsizei primcount);
typedef void (APIENTRYP PFNGLDRAWTRANSFORMFEEDBACKSTREAMINSTANCEDPROC) (GLenum mode, GLuint id, GLuint stream, GLsizei primcount);
#endif
#ifndef GL_ARB_compressed_texture_pixel_storage
#define GL_ARB_compressed_texture_pixel_storage 1
#endif
#ifndef GL_ARB_conservative_depth
#define GL_ARB_conservative_depth 1
#endif
#ifndef GL_ARB_internalformat_query
#define GL_ARB_internalformat_query 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetInternalformativ (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETINTERNALFORMATIVPROC) (GLenum target, GLenum internalformat, GLenum pname, GLsizei bufSize, GLint *params);
#endif
#ifndef GL_ARB_map_buffer_alignment
#define GL_ARB_map_buffer_alignment 1
#endif
#ifndef GL_ARB_shader_atomic_counters
#define GL_ARB_shader_atomic_counters 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glGetActiveAtomicCounterBufferiv (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLGETACTIVEATOMICCOUNTERBUFFERIVPROC) (GLuint program, GLuint bufferIndex, GLenum pname, GLint *params);
#endif
#ifndef GL_ARB_shader_image_load_store
#define GL_ARB_shader_image_load_store 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glBindImageTexture (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
GLAPI void APIENTRY glMemoryBarrier (GLbitfield barriers);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLBINDIMAGETEXTUREPROC) (GLuint unit, GLuint texture, GLint level, GLboolean layered, GLint layer, GLenum access, GLenum format);
typedef void (APIENTRYP PFNGLMEMORYBARRIERPROC) (GLbitfield barriers);
#endif
#ifndef GL_ARB_shading_language_packing
#define GL_ARB_shading_language_packing 1
#endif
#ifndef GL_ARB_texture_storage
#define GL_ARB_texture_storage 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glTexStorage1D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
GLAPI void APIENTRY glTexStorage2D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glTexStorage3D (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
GLAPI void APIENTRY glTextureStorage1DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
GLAPI void APIENTRY glTextureStorage2DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
GLAPI void APIENTRY glTextureStorage3DEXT (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLTEXSTORAGE1DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (APIENTRYP PFNGLTEXSTORAGE2DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXSTORAGE3DPROC) (GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE1DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE2DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height);
typedef void (APIENTRYP PFNGLTEXTURESTORAGE3DEXTPROC) (GLuint texture, GLenum target, GLsizei levels, GLenum internalformat, GLsizei width, GLsizei height, GLsizei depth);
#endif
#ifndef GL_EXT_abgr
#define GL_EXT_abgr 1
#endif
@ -11073,6 +11450,36 @@ typedef void (APIENTRYP PFNGLTEXTUREIMAGE3DMULTISAMPLECOVERAGENVPROC) (GLuint te
#define GL_AMD_blend_minmax_factor 1
#endif
#ifndef GL_AMD_sample_positions
#define GL_AMD_sample_positions 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glSetMultisamplefvAMD (GLenum pname, GLuint index, const GLfloat *val);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLSETMULTISAMPLEFVAMDPROC) (GLenum pname, GLuint index, const GLfloat *val);
#endif
#ifndef GL_EXT_x11_sync_object
#define GL_EXT_x11_sync_object 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI GLsync APIENTRY glImportSyncEXT (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif /* GL_GLEXT_PROTOTYPES */
typedef GLsync (APIENTRYP PFNGLIMPORTSYNCEXTPROC) (GLenum external_sync_type, GLintptr external_sync, GLbitfield flags);
#endif
#ifndef GL_AMD_multi_draw_indirect
#define GL_AMD_multi_draw_indirect 1
#ifdef GL_GLEXT_PROTOTYPES
GLAPI void APIENTRY glMultiDrawArraysIndirectAMD (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
GLAPI void APIENTRY glMultiDrawElementsIndirectAMD (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif /* GL_GLEXT_PROTOTYPES */
typedef void (APIENTRYP PFNGLMULTIDRAWARRAYSINDIRECTAMDPROC) (GLenum mode, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
typedef void (APIENTRYP PFNGLMULTIDRAWELEMENTSINDIRECTAMDPROC) (GLenum mode, GLenum type, const GLvoid *indirect, GLsizei primcount, GLsizei stride);
#endif
#ifndef GL_EXT_framebuffer_multisample_blit_scaled
#define GL_EXT_framebuffer_multisample_blit_scaled 1
#endif
#ifdef __cplusplus
}

View File

@ -6,7 +6,7 @@ extern "C" {
#endif
/*
** Copyright (c) 2007-2010 The Khronos Group Inc.
** Copyright (c) 2007-2011 The Khronos Group Inc.
**
** Permission is hereby granted, free of charge, to any person obtaining a
** copy of this software and/or associated documentation files (the

View File

@ -205,6 +205,7 @@ LN_S = @LN_S@
LTLIBOBJS = @LTLIBOBJS@
MAINT = @MAINT@
MAKEINFO = @MAKEINFO@
MANIFEST_TOOL = @MANIFEST_TOOL@
MEMORYMGR = @MEMORYMGR@
MKDIR_P = @MKDIR_P@
NM = @NM@
@ -232,6 +233,7 @@ abs_builddir = @abs_builddir@
abs_srcdir = @abs_srcdir@
abs_top_builddir = @abs_top_builddir@
abs_top_srcdir = @abs_top_srcdir@
ac_ct_AR = @ac_ct_AR@
ac_ct_CC = @ac_ct_CC@
ac_ct_DUMPBIN = @ac_ct_DUMPBIN@
am__include = @am__include@
@ -264,7 +266,6 @@ libdir = @libdir@
libexecdir = @libexecdir@
localedir = @localedir@
localstatedir = @localstatedir@
lt_ECHO = @lt_ECHO@
mandir = @mandir@
mkdir_p = @mkdir_p@
oldincludedir = @oldincludedir@

View File

@ -1,7 +1,7 @@
The Independent JPEG Group's JPEG software
==========================================
README for release 8b of 16-May-2010
README for release 8c of 16-Jan-2011
====================================
This distribution contains the eighth public release of the Independent JPEG
@ -114,7 +114,7 @@ with respect to this software, its quality, accuracy, merchantability, or
fitness for a particular purpose. This software is provided "AS IS", and you,
its user, assume the entire risk as to its quality and accuracy.
This software is copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
This software is copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
All Rights Reserved except as specified below.
Permission is hereby granted to use, copy, modify, and distribute this
@ -254,8 +254,8 @@ ARCHIVE LOCATIONS
The "official" archive site for this software is www.ijg.org.
The most recent released version can always be found there in
directory "files". This particular version will be archived as
http://www.ijg.org/files/jpegsrc.v8b.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr8b.zip.
http://www.ijg.org/files/jpegsrc.v8c.tar.gz, and in Windows-compatible
"zip" archive format as http://www.ijg.org/files/jpegsr8c.zip.
The JPEG FAQ (Frequently Asked Questions) article is a source of some
general information about JPEG.
@ -285,8 +285,8 @@ Thank to John Korejwa and Massimo Ballerini for inviting me to
fruitful consultations in Boston, MA and Milan, Italy.
Thank to Hendrik Elstner, Roland Fassauer, Simone Zuck, Guenther
Maier-Gerber, Walter Stoeber, and Fred Schmitz for corresponding
business development.
Maier-Gerber, Walter Stoeber, Fred Schmitz, and Norbert Braunagel
for corresponding business development.
Thank to Nico Zschach and Dirk Stelling of the technical support team
at the Digital Images company in Halle for providing me with extra

File diff suppressed because it is too large Load Diff

View File

@ -1,6 +1,17 @@
CHANGE LOG for Independent JPEG Group's JPEG software
Version 8c 16-Jan-2011
-----------------------
Add option to compression library and cjpeg (-block N) to use
different DCT block size.
All N from 1 to 16 are possible. Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality.
SmartScale capable decoder (introduced with IJG JPEG 8) required.
Version 8b 16-May-2010
-----------------------

View File

@ -1,4 +1,4 @@
.TH CJPEG 1 "30 December 2009"
.TH CJPEG 1 "14 November 2010"
.SH NAME
cjpeg \- compress an image file to a JPEG file
.SH SYNOPSIS
@ -64,7 +64,10 @@ Create progressive JPEG file (see below).
.TP
.BI \-scale " M/N"
Scale the output image by a factor M/N. Currently supported scale factors are
8/N with all N from 1 to 16.
M/N with all N from 1 to 16, where M is the destination DCT size, which is 8
by default (see
.BI \-block " N"
switch below).
.TP
.B \-targa
Input file is Targa format. Targa files that contain an "identification"
@ -152,6 +155,17 @@ about the same --- often a little smaller.
.PP
Switches for advanced users:
.TP
.BI \-block " N"
Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality
(exact DCT stage possible with 1 or 2; with the default quality of 75 and
default Luminance qtable the DCT+Quantization stage is lossless for N=1).
CAUTION: An implementation of the JPEG SmartScale extension is required for
this feature. SmartScale enabled JPEG is not yet widely implemented, so
many decoders will be unable to view a SmartScale extended JPEG file at all.
.TP
.B \-dct int
Use integer DCT method (default).
.TP

View File

@ -2,7 +2,7 @@
* cjpeg.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2008 by Guido Vollbeding.
* Modified 2003-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -165,6 +165,9 @@ usage (void)
fprintf(stderr, " -targa Input file is Targa format (usually not needed)\n");
#endif
fprintf(stderr, "Switches for advanced users:\n");
#ifdef DCT_SCALING_SUPPORTED
fprintf(stderr, " -block N DCT block size (1..16; default is 8)\n");
#endif
#ifdef DCT_ISLOW_SUPPORTED
fprintf(stderr, " -dct int Use integer DCT method%s\n",
(JDCT_DEFAULT == JDCT_ISLOW ? " (default)" : ""));
@ -254,10 +257,30 @@ parse_switches (j_compress_ptr cinfo, int argc, char **argv,
exit(EXIT_FAILURE);
#endif
} else if (keymatch(arg, "baseline", 1)) {
} else if (keymatch(arg, "baseline", 2)) {
/* Force baseline-compatible output (8-bit quantizer values). */
force_baseline = TRUE;
} else if (keymatch(arg, "block", 2)) {
/* Set DCT block size. */
#if defined(DCT_SCALING_SUPPORTED) && defined(JPEG_LIB_VERSION_MAJOR) && \
(JPEG_LIB_VERSION_MAJOR > 8 || (JPEG_LIB_VERSION_MAJOR == 8 && \
defined(JPEG_LIB_VERSION_MINOR) && JPEG_LIB_VERSION_MINOR >= 3))
int val;
if (++argn >= argc) /* advance to next argument */
usage();
if (sscanf(argv[argn], "%d", &val) != 1)
usage();
if (val < 1 || val > 16)
usage();
cinfo->block_size = val;
#else
fprintf(stderr, "%s: sorry, block size setting not supported\n",
progname);
exit(EXIT_FAILURE);
#endif
} else if (keymatch(arg, "dct", 2)) {
/* Select DCT algorithm. */
if (++argn >= argc) /* advance to next argument */

File diff suppressed because it is too large Load Diff

View File

@ -5,7 +5,7 @@
# Configure script for IJG libjpeg
#
AC_INIT([libjpeg], [8.0.2])
AC_INIT([libjpeg], [8.3.0])
# Directory where autotools helper scripts lives.
AC_CONFIG_AUX_DIR([.])
@ -63,7 +63,7 @@ VERS_2 {
global: sym;
} VERS_1;
EOF
AC_LINK_IFELSE(AC_LANG_PROGRAM([], []),
AC_LINK_IFELSE([AC_LANG_PROGRAM([], [])],
[have_ld_version_script=yes], [have_ld_version_script=no])
rm -f conftest.map
LDFLAGS="$save_LDFLAGS"
@ -306,10 +306,11 @@ AC_DEFINE([NO_MKTEMP],[1],[The mktemp() function is not available.])])])
fi
AC_SUBST(MEMORYMGR)
# Extract the library version ID from jpeglib.h.
# Extract the library version IDs from jpeglib.h.
AC_MSG_CHECKING([libjpeg version number])
[JPEG_LIB_VERSION=`sed -e '/^#define JPEG_LIB_VERSION/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION / 10`:2"]
[JPEG_LIB_VERSION_MAJOR=`sed -e '/^#define JPEG_LIB_VERSION_MAJOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
[JPEG_LIB_VERSION_MINOR=`sed -e '/^#define JPEG_LIB_VERSION_MINOR/!d' -e 's/^[^0-9]*\([0-9][0-9]*\).*$/\1/' $srcdir/jpeglib.h`]
[JPEG_LIB_VERSION="`expr $JPEG_LIB_VERSION_MAJOR + $JPEG_LIB_VERSION_MINOR`:0:$JPEG_LIB_VERSION_MINOR"]
AC_MSG_RESULT([$JPEG_LIB_VERSION])
AC_SUBST([JPEG_LIB_VERSION])

View File

@ -2,7 +2,7 @@
* jcmarker.c
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2003-2009 by Guido Vollbeding.
* Modified 2003-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -231,10 +231,10 @@ emit_dac (j_compress_ptr cinfo)
char ac_in_use[NUM_ARITH_TBLS];
int length, i;
jpeg_component_info *compptr;
for (i = 0; i < NUM_ARITH_TBLS; i++)
dc_in_use[i] = ac_in_use[i] = 0;
for (i = 0; i < cinfo->comps_in_scan; i++) {
compptr = cinfo->cur_comp_info[i];
/* DC needs no table for refinement scan */
@ -244,23 +244,25 @@ emit_dac (j_compress_ptr cinfo)
if (cinfo->Se)
ac_in_use[compptr->ac_tbl_no] = 1;
}
length = 0;
for (i = 0; i < NUM_ARITH_TBLS; i++)
length += dc_in_use[i] + ac_in_use[i];
emit_marker(cinfo, M_DAC);
emit_2bytes(cinfo, length*2 + 2);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) {
emit_byte(cinfo, i);
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
}
if (ac_in_use[i]) {
emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
if (length) {
emit_marker(cinfo, M_DAC);
emit_2bytes(cinfo, length*2 + 2);
for (i = 0; i < NUM_ARITH_TBLS; i++) {
if (dc_in_use[i]) {
emit_byte(cinfo, i);
emit_byte(cinfo, cinfo->arith_dc_L[i] + (cinfo->arith_dc_U[i]<<4));
}
if (ac_in_use[i]) {
emit_byte(cinfo, i + 0x10);
emit_byte(cinfo, cinfo->arith_ac_K[i]);
}
}
}
#endif /* C_ARITH_CODING_SUPPORTED */

View File

@ -2,7 +2,7 @@
* jcmaster.c
*
* Copyright (C) 1991-1997, Thomas G. Lane.
* Modified 2003-2010 by Guido Vollbeding.
* Modified 2003-2011 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -55,125 +55,140 @@ jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
{
#ifdef DCT_SCALING_SUPPORTED
/* Sanity check on input image dimensions to prevent overflow in
* following calculation.
* We do check jpeg_width and jpeg_height in initial_setup below,
* but image_width and image_height can come from arbitrary data,
* and we need some space for multiplication by block_size.
*/
if (((long) cinfo->image_width >> 24) || ((long) cinfo->image_height >> 24))
ERREXIT1(cinfo, JERR_IMAGE_TOO_BIG, (unsigned int) JPEG_MAX_DIMENSION);
/* Compute actual JPEG image dimensions and DCT scaling choices. */
if (cinfo->scale_num >= cinfo->scale_denom * 8) {
/* Provide 8/1 scaling */
cinfo->jpeg_width = cinfo->image_width << 3;
cinfo->jpeg_height = cinfo->image_height << 3;
if (cinfo->scale_num >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/1 scaling */
cinfo->jpeg_width = cinfo->image_width * cinfo->block_size;
cinfo->jpeg_height = cinfo->image_height * cinfo->block_size;
cinfo->min_DCT_h_scaled_size = 1;
cinfo->min_DCT_v_scaled_size = 1;
} else if (cinfo->scale_num >= cinfo->scale_denom * 4) {
/* Provide 4/1 scaling */
cinfo->jpeg_width = cinfo->image_width << 2;
cinfo->jpeg_height = cinfo->image_height << 2;
} else if (cinfo->scale_num * 2 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/2 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 2L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 2L);
cinfo->min_DCT_h_scaled_size = 2;
cinfo->min_DCT_v_scaled_size = 2;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * 8) {
/* Provide 8/3 scaling */
cinfo->jpeg_width = (cinfo->image_width << 1) + (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 2, 3L);
cinfo->jpeg_height = (cinfo->image_height << 1) + (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 2, 3L);
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/3 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 3L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 3L);
cinfo->min_DCT_h_scaled_size = 3;
cinfo->min_DCT_v_scaled_size = 3;
} else if (cinfo->scale_num >= cinfo->scale_denom * 2) {
/* Provide 2/1 scaling */
cinfo->jpeg_width = cinfo->image_width << 1;
cinfo->jpeg_height = cinfo->image_height << 1;
} else if (cinfo->scale_num * 4 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/4 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 4L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 4L);
cinfo->min_DCT_h_scaled_size = 4;
cinfo->min_DCT_v_scaled_size = 4;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * 8) {
/* Provide 8/5 scaling */
cinfo->jpeg_width = cinfo->image_width + (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 3, 5L);
cinfo->jpeg_height = cinfo->image_height + (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 3, 5L);
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/5 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 5L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 5L);
cinfo->min_DCT_h_scaled_size = 5;
cinfo->min_DCT_v_scaled_size = 5;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * 4) {
/* Provide 4/3 scaling */
cinfo->jpeg_width = cinfo->image_width + (JDIMENSION)
jdiv_round_up((long) cinfo->image_width, 3L);
cinfo->jpeg_height = cinfo->image_height + (JDIMENSION)
jdiv_round_up((long) cinfo->image_height, 3L);
} else if (cinfo->scale_num * 6 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/6 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 6L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 6L);
cinfo->min_DCT_h_scaled_size = 6;
cinfo->min_DCT_v_scaled_size = 6;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * 8) {
/* Provide 8/7 scaling */
cinfo->jpeg_width = cinfo->image_width + (JDIMENSION)
jdiv_round_up((long) cinfo->image_width, 7L);
cinfo->jpeg_height = cinfo->image_height + (JDIMENSION)
jdiv_round_up((long) cinfo->image_height, 7L);
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/7 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 7L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 7L);
cinfo->min_DCT_h_scaled_size = 7;
cinfo->min_DCT_v_scaled_size = 7;
} else if (cinfo->scale_num >= cinfo->scale_denom) {
/* Provide 1/1 scaling */
cinfo->jpeg_width = cinfo->image_width;
cinfo->jpeg_height = cinfo->image_height;
} else if (cinfo->scale_num * 8 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/8 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 8L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 8L);
cinfo->min_DCT_h_scaled_size = 8;
cinfo->min_DCT_v_scaled_size = 8;
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * 8) {
/* Provide 8/9 scaling */
} else if (cinfo->scale_num * 9 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/9 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 8, 9L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 9L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 8, 9L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 9L);
cinfo->min_DCT_h_scaled_size = 9;
cinfo->min_DCT_v_scaled_size = 9;
} else if (cinfo->scale_num * 5 >= cinfo->scale_denom * 4) {
/* Provide 4/5 scaling */
} else if (cinfo->scale_num * 10 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/10 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 4, 5L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 10L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 4, 5L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 10L);
cinfo->min_DCT_h_scaled_size = 10;
cinfo->min_DCT_v_scaled_size = 10;
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * 8) {
/* Provide 8/11 scaling */
} else if (cinfo->scale_num * 11 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/11 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 8, 11L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 11L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 8, 11L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 11L);
cinfo->min_DCT_h_scaled_size = 11;
cinfo->min_DCT_v_scaled_size = 11;
} else if (cinfo->scale_num * 3 >= cinfo->scale_denom * 2) {
/* Provide 2/3 scaling */
} else if (cinfo->scale_num * 12 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/12 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 2, 3L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 12L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 2, 3L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 12L);
cinfo->min_DCT_h_scaled_size = 12;
cinfo->min_DCT_v_scaled_size = 12;
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * 8) {
/* Provide 8/13 scaling */
} else if (cinfo->scale_num * 13 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/13 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 8, 13L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 13L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 8, 13L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 13L);
cinfo->min_DCT_h_scaled_size = 13;
cinfo->min_DCT_v_scaled_size = 13;
} else if (cinfo->scale_num * 7 >= cinfo->scale_denom * 4) {
/* Provide 4/7 scaling */
} else if (cinfo->scale_num * 14 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/14 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 4, 7L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 14L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 4, 7L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 14L);
cinfo->min_DCT_h_scaled_size = 14;
cinfo->min_DCT_v_scaled_size = 14;
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * 8) {
/* Provide 8/15 scaling */
} else if (cinfo->scale_num * 15 >= cinfo->scale_denom * cinfo->block_size) {
/* Provide block_size/15 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width * 8, 15L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 15L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height * 8, 15L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 15L);
cinfo->min_DCT_h_scaled_size = 15;
cinfo->min_DCT_v_scaled_size = 15;
} else {
/* Provide 1/2 scaling */
/* Provide block_size/16 scaling */
cinfo->jpeg_width = (JDIMENSION)
jdiv_round_up((long) cinfo->image_width, 2L);
jdiv_round_up((long) cinfo->image_width * cinfo->block_size, 16L);
cinfo->jpeg_height = (JDIMENSION)
jdiv_round_up((long) cinfo->image_height, 2L);
jdiv_round_up((long) cinfo->image_height * cinfo->block_size, 16L);
cinfo->min_DCT_h_scaled_size = 16;
cinfo->min_DCT_v_scaled_size = 16;
}
@ -193,25 +208,11 @@ jpeg_calc_jpeg_dimensions (j_compress_ptr cinfo)
LOCAL(void)
jpeg_calc_trans_dimensions (j_compress_ptr cinfo)
{
if (cinfo->min_DCT_h_scaled_size < 1 || cinfo->min_DCT_h_scaled_size > 16
|| cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
if (cinfo->min_DCT_h_scaled_size != cinfo->min_DCT_v_scaled_size)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE,
cinfo->min_DCT_h_scaled_size, cinfo->min_DCT_v_scaled_size);
cinfo->block_size = cinfo->min_DCT_h_scaled_size;
switch (cinfo->block_size) {
case 2: cinfo->natural_order = jpeg_natural_order2; break;
case 3: cinfo->natural_order = jpeg_natural_order3; break;
case 4: cinfo->natural_order = jpeg_natural_order4; break;
case 5: cinfo->natural_order = jpeg_natural_order5; break;
case 6: cinfo->natural_order = jpeg_natural_order6; break;
case 7: cinfo->natural_order = jpeg_natural_order7; break;
default: cinfo->natural_order = jpeg_natural_order; break;
}
cinfo->lim_Se = cinfo->block_size < DCTSIZE ?
cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1;
}
@ -229,6 +230,25 @@ initial_setup (j_compress_ptr cinfo, boolean transcode_only)
else
jpeg_calc_jpeg_dimensions(cinfo);
/* Sanity check on block_size */
if (cinfo->block_size < 1 || cinfo->block_size > 16)
ERREXIT2(cinfo, JERR_BAD_DCTSIZE, cinfo->block_size, cinfo->block_size);
/* Derive natural_order from block_size */
switch (cinfo->block_size) {
case 2: cinfo->natural_order = jpeg_natural_order2; break;
case 3: cinfo->natural_order = jpeg_natural_order3; break;
case 4: cinfo->natural_order = jpeg_natural_order4; break;
case 5: cinfo->natural_order = jpeg_natural_order5; break;
case 6: cinfo->natural_order = jpeg_natural_order6; break;
case 7: cinfo->natural_order = jpeg_natural_order7; break;
default: cinfo->natural_order = jpeg_natural_order; break;
}
/* Derive lim_Se from block_size */
cinfo->lim_Se = cinfo->block_size < DCTSIZE ?
cinfo->block_size * cinfo->block_size - 1 : DCTSIZE2-1;
/* Sanity check on image dimensions */
if (cinfo->jpeg_height <= 0 || cinfo->jpeg_width <= 0 ||
cinfo->num_components <= 0 || cinfo->input_components <= 0)

View File

@ -2,7 +2,7 @@
* jpeglib.h
*
* Copyright (C) 1991-1998, Thomas G. Lane.
* Modified 2002-2009 by Guido Vollbeding.
* Modified 2002-2010 by Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -33,11 +33,13 @@ extern "C" {
#endif
#endif
/* Version ID for the JPEG library.
/* Version IDs for the JPEG library.
* Might be useful for tests like "#if JPEG_LIB_VERSION >= 80".
*/
#define JPEG_LIB_VERSION 80 /* Version 8.0 */
#define JPEG_LIB_VERSION 80 /* Compatibility version 8.0 */
#define JPEG_LIB_VERSION_MAJOR 8
#define JPEG_LIB_VERSION_MINOR 3
/* Various constants determining the sizes of things.

View File

@ -1,7 +1,7 @@
/*
* jversion.h
*
* Copyright (C) 1991-2010, Thomas G. Lane, Guido Vollbeding.
* Copyright (C) 1991-2011, Thomas G. Lane, Guido Vollbeding.
* This file is part of the Independent JPEG Group's software.
* For conditions of distribution and use, see the accompanying README file.
*
@ -9,6 +9,6 @@
*/
#define JVERSION "8b 16-May-2010"
#define JVERSION "8c 16-Jan-2011"
#define JCOPYRIGHT "Copyright (C) 2010, Thomas G. Lane, Guido Vollbeding"
#define JCOPYRIGHT "Copyright (C) 2011, Thomas G. Lane, Guido Vollbeding"

View File

@ -1,6 +1,6 @@
USING THE IJG JPEG LIBRARY
Copyright (C) 1994-2009, Thomas G. Lane, Guido Vollbeding.
Copyright (C) 1994-2010, Thomas G. Lane, Guido Vollbeding.
This file is part of the Independent JPEG Group's software.
For conditions of distribution and use, see the accompanying README file.
@ -876,6 +876,18 @@ jpeg_simple_progression (j_compress_ptr cinfo)
Compression parameters (cinfo fields) include:
int block_size
Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality.
An exact DCT stage is possible with 1 or 2.
With the default quality of 75 and default Luminance qtable
the DCT+Quantization stage is lossless for value 1.
Note that values other than 8 require a SmartScale capable decoder,
introduced with IJG JPEG 8. Setting the block_size parameter for
compression works with version 8c and later.
J_DCT_METHOD dct_method
Selects the algorithm used for the DCT step. Choices are:
JDCT_ISLOW: slow but accurate integer algorithm
@ -895,8 +907,10 @@ J_DCT_METHOD dct_method
unsigned int scale_num, scale_denom
Scale the image by the fraction scale_num/scale_denom. Default is
1/1, or no scaling. Currently, the supported scaling ratios are
8/N with all N from 1 to 16. (The library design allows for arbitrary
scaling ratios but this is not likely to be implemented any time soon.)
M/N with all N from 1 to 16, where M is the destination DCT size,
which is 8 by default (see block_size parameter above).
(The library design allows for arbitrary scaling ratios but this
is not likely to be implemented any time soon.)
J_COLOR_SPACE jpeg_color_space
int num_components

File diff suppressed because it is too large Load Diff

View File

@ -87,8 +87,9 @@ The basic command line switches for cjpeg are:
-progressive Create progressive JPEG file (see below).
-scale M/N Scale the output image by a factor M/N. Currently
supported scale factors are 8/N with all N from 1 to
16.
supported scale factors are M/N with all N from 1 to
16, where M is the destination DCT size, which is 8 by
default (see -block N switch below).
-targa Input file is Targa format. Targa files that contain
an "identification" field will not be automatically
@ -150,6 +151,19 @@ file size is about the same --- often a little smaller.
Switches for advanced users:
-block N Set DCT block size. All N from 1 to 16 are possible.
Default is 8 (baseline format).
Larger values produce higher compression,
smaller values produce higher quality
(exact DCT stage possible with 1 or 2; with the
default quality of 75 and default Luminance qtable
the DCT+Quantization stage is lossless for N=1).
CAUTION: An implementation of the JPEG SmartScale
extension is required for this feature. SmartScale
enabled JPEG is not yet widely implemented, so many
decoders will be unable to view a SmartScale extended
JPEG file at all.
-dct int Use integer DCT method (default).
-dct fast Use fast integer DCT (less accurate).
-dct float Use floating-point DCT method.

View File

@ -1,5 +1,5 @@
Libpng 1.4.4 - September 23, 2010
Libpng 1.5.5 - September 22, 2011
This is a public release of libpng, intended for use in production codes.
@ -8,58 +8,84 @@ Files available for download:
Source files with LF line endings (for Unix/Linux) and with a
"configure" script
libpng-1.4.4.tar.xz (LZMA-compressed, recommended)
libpng-1.4.4.tar.gz
libpng-1.4.4.tar.bz2
libpng-1.5.5.tar.xz (LZMA-compressed, recommended)
libpng-1.5.5.tar.gz
libpng-1.5.5.tar.bz2
Source files with CRLF line endings (for Windows), without the
"configure" script
lpng144.zip
lpng144.7z
lpng155.7z (LZMA-compressed, recommended)
lpng155.zip
Other information:
libpng-1.4.4-README.txt
libpng-1.4.4-LICENSE.txt
libpng-1.5.5-README.txt
libpng-1.5.5-LICENSE.txt
Changes since the last public release (1.4.3):
Removed extraneous new_push_process_row.c file.
Revised the "SEE ALSO" style of libpng.3, libpngpf.3, and png.5
Removed some newly-added TAB characters from pngpread.c.
Fixed some indentation in pngpread.c and pngrutil.c
Changed "extern PNG_EXPORT" to "PNG_EXPORT" in png.h (Jan Nijtmans)
Changed "extern" to "PNG_EXTERN" in pngpriv.h (except for the 'extern "C" {')
Put "#ifndef PNG_EXTERN, #endif" around "#define PNG_EXTERN" in pngpriv.h
Added -DNO_PNG_SNPRINTF to CFLAGS in scripts/makefile.dj2
Moved the definition of png_snprintf() outside of the enclosing
#ifdef blocks in pngconf.h
Made a special case "#define PNGAPI" in pngconf.h for WATCOM.
Removed reference to cbuilder5/* from Makefile.in and Makefile.am
Updated the read macros and functions from 1.5.0beta38.
Updated projects/visualc71 so it can find scripts/pnglibconf.h
Removed unused png_mem_* defines from pngconf.h.
Correct use of _WINDOWS_ in pngconf.h
Don't try to use version-script with cygwin/mingw.
Revised contrib/gregbook to work under cygwin/mingw.
Updated prebuilt aclocal.m4 and ltmain.sh
Add .dll.a to the list of extensions to be symlinked by Makefile.am (Yaakov)
Updated CMakelists.txt to use CMAKE_INSTALL_LIBDIR variable; useful for
installing libpng in /usr/lib64 (Funda Wang).
Revised CMakeLists.txt to put the man pages in share/man/man* not man/man*
Revised CMakeLists.txt to make symlinks instead of copies when installing.
Moved "#include pngusr.h" ahead of PNG_USER_PRIVATEBUILD test in pngconf.h
Eliminated a deprecated reference to png_ptr->io_ptr in pngtest.c
Eliminated new unnecessary #if tests regarding the sCAL chunk from pngrutil.c
Updated the xcode project to work with libpng-1.4.x and added iOS targets
for simulator and device (Philippe Hausler).
Revised autogen.sh to recognize and use $AUTOCONF, $AUTOMAKE, $AUTOHEADER,
$AUTOPOINT, $ACLOCAL and $LIBTOOLIZE
Rebuilt configure scripts with automake-1.11.1 instead of automake-1.11.
Removed unused mkinstalldirs file.
Changes since the last public release (1.5.4):
Send comments/corrections/commendations to glennrp at users.sourceforge.net
or to png-mng-implement at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement).
Fixed some typos and made other minor changes in the manual.
Updated contrib/pngminus/makefile.std (Samuli Souminen)
Revised Makefile.am and Makefile.in to look in the right directory for
pnglibconf.h.prebuilt
Enabled compilation with g++ compiler. This compiler does not recognize
the file extension, so it always compiles with C++ rules. Made minor
changes to pngrutil.c to cast results where C++ expects it but C does not.
Minor editing of libpng.3 and libpng-manual.txt.
Revised CMakeLists.txt (Clifford Yapp)
Updated commentary about the png_rgb_to_gray() default coefficients
in the manual and in pngrtran.c
Prevent unexpected API exports from non-libpng DLLs on Windows. The "_DLL"
is removed from the test of whether a DLL is being built (this erroneously
caused the libpng APIs to be marked as DLL exports in static builds under
Microsoft Visual Studio). Almost all of the libpng building configuration
is moved from pngconf.h to pngpriv.h, but PNG_DLL_EXPORT remains in
pngconf.h, though, so that it is colocated with the import definition (it
is no longer used anywhere in the installed headers). The VStudio project
definitions have been cleaned up: "_USRDLL" has been removed from the
static library builds (this was incorrect), and PNG_USE_DLL has been added
to pngvalid to test the functionality (pngtest does not supply it,
deliberately). The spurious "_EXPORTS" has been removed from the
libpng build (all these errors were a result of copy/paste between project
configurations.)
Added new types and internal functions for CIE RGB end point handling to
pngpriv.h (functions yet to be implemented).
Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set in CMakeLists.txt
(Clifford Yap)
Fixes to rgb_to_gray and cHRM XYZ APIs (John Bowler):
The rgb_to_gray code had errors when combined with gamma correction.
Some pixels were treated as true grey when they weren't and such pixels
and true grey ones were not gamma corrected (the original value of the
red component was used instead). APIs to get and set cHRM using color
space end points have been added and the rgb_to_gray code that defaults
based on cHRM, and the divide-by-zero bug in png_handle_cHRM (CERT
VU#477046, CVE-2011-3328, introduced in 1.5.4) have been corrected.
A considerable number of tests has been added to pngvalid for the
rgb_to_gray transform.
Arithmetic errors in rgb_to_gray whereby the calculated gray value was
truncated to the bit depth rather than rounded have been fixed except in
the 8-bit non-gamma-corrected case (where consistency seems more important
than correctness.) The code still has considerable inaccuracies in the
8-bit case because 8-bit linear arithmetic is used.
Added "$(ARCH)" option to makefile.darwin
Added SunOS support to configure.ac and Makefile.am
Changed png_chunk_benign_error() to png_warning() in png.c, in
png_XYZ_from_xy_checked().
Fixed 64-bit compilation errors (gcc). The errors fixed relate
to conditions where types that are 32 bits in the GCC 32-bit
world (uLong and png_size_t) become 64 bits in the 64-bit
world. This produces potential truncation errors that the
compiler correctly flags.
Constant changes for 64-bit compatibility (removal of L suffixes). The
16-bit cases still use "L" as we don't have a 16-bit test system.
Send comments/corrections/commendations to png-mng-implement at lists.sf.net
(subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-implement
to subscribe)
or to glennrp at users.sourceforge.net
Glenn R-P
*/ }
#endif

File diff suppressed because it is too large Load Diff

View File

@ -1,10 +1,24 @@
# CMakeLists.txt
# Copyright (C) 2007-2011 Glenn Randers-Pehrson
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
cmake_minimum_required(VERSION 2.4.4)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS true)
if(UNIX AND NOT DEFINED CMAKE_BUILD_TYPE)
if(CMAKE_MAJOR_VERSION EQUAL 2 AND CMAKE_MINOR_VERSION EQUAL 4)
# workaround CMake 2.4.x bug
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING "Choose the type of build, options are: None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used) Debug Release RelWithDebInfo MinSizeRel.")
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are:
None(CMAKE_CXX_FLAGS or CMAKE_C_FLAGS used)
Debug
Release
RelWithDebInfo
MinSizeRel.")
else()
set(CMAKE_BUILD_TYPE "RelWithDebInfo" CACHE STRING
"Choose the type of build, options are:
@ -19,15 +33,9 @@ endif()
project(libpng C)
enable_testing()
# Copyright (C) 2007-2010 Glenn Randers-Pehrson
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
set(PNGLIB_MAJOR 1)
set(PNGLIB_MINOR 4)
set(PNGLIB_RELEASE 4)
set(PNGLIB_MINOR 5)
set(PNGLIB_RELEASE 5)
set(PNGLIB_NAME libpng${PNGLIB_MAJOR}${PNGLIB_MINOR})
set(PNGLIB_VERSION ${PNGLIB_MAJOR}.${PNGLIB_MINOR}.${PNGLIB_RELEASE})
@ -101,12 +109,23 @@ set(PNG_LIB_NAME png${PNGLIB_MAJOR}${PNGLIB_MINOR})
# to distinguish between debug and release lib
set(CMAKE_DEBUG_POSTFIX "d")
# Use the prebuilt pnglibconf.h file from the scripts folder
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/scripts/pnglibconf.h.prebuilt
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h)
include_directories(${CMAKE_CURRENT_BINARY_DIR})
# OUR SOURCES
set(libpng_sources
set(libpng_public_hdrs
png.h
pngconf.h
${CMAKE_CURRENT_BINARY_DIR}/pnglibconf.h
)
set(libpng_sources
${libpng_public_hdrs}
pngdebug.h
pnginfo.h
pngpriv.h
pngstruct.h
png.c
pngerror.c
pngget.c
@ -130,10 +149,6 @@ set(pngtest_sources
add_definitions(-DPNG_CONFIGURE_LIBPNG)
if(_AIX)
add_definitions(-D_ALL_SOURCE)
endif(_AIX)
if(MSVC)
add_definitions(-DPNG_NO_MODULEDEF -D_CRT_SECURE_NO_DEPRECATE)
endif(MSVC)
@ -143,7 +158,6 @@ if(PNG_SHARED OR NOT MSVC)
add_definitions(-DZLIB_DLL)
endif()
if(PNG_CONSOLE_IO_SUPPORTED)
add_definitions(-DPNG_CONSOLE_IO_SUPPORTED)
endif()
@ -188,7 +202,6 @@ if(PNG_STATIC)
target_link_libraries(${PNG_LIB_NAME_STATIC} ${ZLIB_LIBRARY} ${M_LIBRARY})
endif()
if(PNG_SHARED AND WIN32)
set_target_properties(${PNG_LIB_NAME} PROPERTIES DEFINE_SYMBOL PNG_BUILD_DLL)
endif()
@ -200,52 +213,58 @@ if(PNG_TESTS AND PNG_SHARED)
add_test(pngtest ./pngtest ${CMAKE_CURRENT_SOURCE_DIR}/pngtest.png)
endif()
#
# Ensure the CMAKE_LIBRARY_OUTPUT_DIRECTORY is set
IF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
IF(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "bin")
ELSE(WIN32)
SET(CMAKE_LIBRARY_OUTPUT_DIRECTORY "lib")
ENDIF(WIN32)
ENDIF(NOT CMAKE_LIBRARY_OUTPUT_DIRECTORY)
# Set a variable with CMake code which:
# Creates a symlink from src to dest (if possible) or alternatively
# copies if different.
macro(_png_generate_symlink_code CODE SRC DEST)
macro(CREATE_SYMLINK SRC_FILE DEST_FILE)
FILE(REMOVE ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
if(WIN32 AND NOT CYGWIN)
set(_png_gsc_message "Copying ${SRC} to ${DEST} if needed")
set(_png_gsc_operation "copy_if_different")
else()
set(_png_gsc_message "Symlinking ${SRC} to ${DEST}")
set(_png_gsc_operation "create_symlink")
endif()
set(${CODE} "
message(STATUS \"${_png_gsc_message}\")
execute_process(COMMAND \${CMAKE_COMMAND} -E ${_png_gsc_operation}
\"${SRC}\" \"${DEST}\")
")
ADD_CUSTOM_COMMAND(
OUTPUT ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE}
COMMAND ${CMAKE_COMMAND} -E copy ${CMAKE_CURRENT_BINARY_DIR}/${SRC_FILE} ${CMAKE_CURRENT_BINARY_DIR}/${DEST_FILE}
DEPENDS ${PNG_LIB_NAME} ${PNG_LIB_NAME_STATIC}
)
ADD_CUSTOM_TARGET(${DEST_FILE}_COPY ALL DEPENDS ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE})
else(WIN32 AND NOT CYGWIN)
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${CMAKE_LIBRARY_OUTPUT_DIRECTORY}/${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
execute_process(COMMAND ${CMAKE_COMMAND} -E create_symlink ${SRC_FILE} ${DEST_FILE} WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endif(WIN32 AND NOT CYGWIN)
endmacro()
# CREATE PKGCONFIG FILES
# we use the same files like ./configure, so we have to set its vars
if(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(CMAKE_INSTALL_LIBDIR ${CMAKE_INSTALL_PREFIX}/lib)
set(CMAKE_INSTALL_LIBDIR lib)
endif(NOT DEFINED CMAKE_INSTALL_LIBDIR)
set(prefix ${CMAKE_INSTALL_PREFIX})
set(exec_prefix ${CMAKE_INSTALL_PREFIX})
set(libdir ${CMAKE_INSTALL_LIBDIR})
set(libdir ${CMAKE_INSTALL_PREFIX}/${CMAKE_INSTALL_LIBDIR})
set(includedir ${CMAKE_INSTALL_PREFIX}/include)
set(LIBS "-lz -lm")
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng.pc.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}.pc @ONLY)
_png_generate_symlink_code(PNG_PC_INSTALL_CODE ${PNGLIB_NAME}.pc libpng.pc)
install(CODE ${PNG_PC_INSTALL_CODE})
CREATE_SYMLINK(${PNGLIB_NAME}.pc libpng.pc)
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/libpng-config.in
${CMAKE_CURRENT_BINARY_DIR}/${PNGLIB_NAME}-config @ONLY)
_png_generate_symlink_code(PNG_CONFIG_INSTALL_CODE ${PNGLIB_NAME}-config libpng-config)
install(CODE ${PNG_CONFIG_INSTALL_CODE})
CREATE_SYMLINK(${PNGLIB_NAME}-config libpng-config)
# SET UP LINKS
if(PNG_SHARED)
set_target_properties(${PNG_LIB_NAME} PROPERTIES
# VERSION 14.${PNGLIB_RELEASE}.1.4.4
VERSION 14.${PNGLIB_RELEASE}.0
SOVERSION 14
# VERSION 15.${PNGLIB_RELEASE}.1.5.5
VERSION 15.${PNGLIB_RELEASE}.0
SOVERSION 15
CLEAN_DIRECT_OUTPUT 1)
endif()
if(PNG_STATIC)
@ -277,42 +296,42 @@ if(NOT SKIP_INSTALL_LIBRARIES AND NOT SKIP_INSTALL_ALL )
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
# Create a symlink for libpng.dll.a => libpng14.dll.a on Cygwin
# Create a symlink for libpng.dll.a => libpng15.dll.a on Cygwin
if(CYGWIN)
_png_generate_symlink_code(PNG_SHARED_IMPLIB_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_IMPORT_LIBRARY_SUFFIX}
libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
install(CODE ${PNG_SHARED_IMPLIB_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_IMPORT_LIBRARY_SUFFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_IMPORT_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(CYGWIN)
if(NOT WIN32)
_png_generate_symlink_code(PNG_SHARED_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_SHARED_LIBRARY_SUFFIX}
libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
install(CODE ${PNG_SHARED_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME} LOCATION_${CMAKE_BUILD_TYPE})
get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_SHARED_LIBRARY_SUFFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_SHARED_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(NOT WIN32)
endif(PNG_SHARED)
if(PNG_STATIC)
install(TARGETS ${PNG_LIB_NAME_STATIC}
${PNG_EXPORT_RULE}
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR})
if(NOT WIN32 OR CYGWIN)
_png_generate_symlink_code(PNG_STATIC_INSTALL_CODE
${PNGLIB_NAME}${CMAKE_STATIC_LIBRARY_SUFFIX}
libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
install(CODE ${PNG_STATIC_INSTALL_CODE})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX} DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif()
endif()
get_target_property(BUILD_TARGET_LOCATION ${PNG_LIB_NAME_STATIC} LOCATION_${CMAKE_BUILD_TYPE})
get_filename_component(BUILD_TARGET_FILE ${BUILD_TARGET_LOCATION} NAME)
CREATE_SYMLINK(${BUILD_TARGET_FILE} libpng${CMAKE_STATIC_LIBRARY_SUFFIX})
install(FILES ${CMAKE_CURRENT_BINARY_DIR}/libpng${CMAKE_STATIC_LIBRARY_SUFFIX}
DESTINATION ${CMAKE_INSTALL_LIBDIR})
endif(NOT WIN32 OR CYGWIN)
endif()
endif()
if(NOT SKIP_INSTALL_HEADERS AND NOT SKIP_INSTALL_ALL )
install(FILES png.h pngconf.h DESTINATION include)
install(FILES png.h pngconf.h DESTINATION include/${PNGLIB_NAME})
install(FILES ${libpng_public_hdrs} DESTINATION include)
install(FILES ${libpng_public_hdrs} DESTINATION include/${PNGLIB_NAME})
endif()
if(NOT SKIP_INSTALL_EXECUTABLES AND NOT SKIP_INSTALL_ALL )
install(PROGRAMS ${CMAKE_CURRENT_BINARY_DIR}/libpng-config DESTINATION bin)
@ -343,13 +362,11 @@ if(PNG_EXPORT_RULE AND NOT SKIP_INSTALL_EXPORT AND NOT SKIP_INSTALL_ALL )
install(EXPORT libpng DESTINATION lib/libpng FILE lib${PNG_LIB_NAME}.cmake)
endif()
# what's with libpng.txt and all the extra files?
# what's with libpng-$VER%.txt and all the extra files?
# UNINSTALL
# do we need this?
# DIST
# do we need this?

View File

@ -1,5 +1,5 @@
Installing libpng version 1.4.4 - September 23, 2010
Installing libpng
On Unix/Linux and similar systems, you can simply type
@ -13,10 +13,16 @@ If configure does not work on your system and you have a reasonably
up-to-date set of tools, running ./autogen.sh before running ./configure
may fix the problem. You can also run the individual commands in
autogen.sh with the --force option, if supported by your version of
the tools. If you run 'libtoolize --force', though, this will replace
the distributed, patched, version of ltmain.sh with an unpatched version
and your shared library builds may fail to produce libraries with the
correct version numbers.
the tools. To be really sure that you aren't using any of the included
pre-built scripts, you can do this:
./configure --enable-maintainer-mode
make maintainer-clean
./autogen.sh
./configure [--prefix=/path] [other options]
make
make install
make check
Instead, you can use one of the custom-built makefiles in the
"scripts" directory
@ -46,8 +52,8 @@ to have access to the zlib.h and zconf.h include files that
correspond to the version of zlib that's installed.
You can rename the directories that you downloaded (they
might be called "libpng-1.4.4" or "libpng14" and "zlib-1.2.3"
or "zlib123") so that you have directories called "zlib" and "libpng".
might be called "libpng-x.y.z" or "libpngNN" and "zlib-1.2.5"
or "zlib125") so that you have directories called "zlib" and "libpng".
Your directory structure should look like this:
@ -62,7 +68,7 @@ Your directory structure should look like this:
configure.ac, configure, Makefile.am, Makefile.in,
autogen.sh, config.guess, ltmain.sh, missing, libpng.pc.in,
libpng-config.in, aclocal.m4, config.h.in, config.sub,
depcomp, install-sh, test-pngtest.sh
depcomp, install-sh, mkinstalldirs, test-pngtest.sh
contrib
gregbook
pngminim
@ -70,14 +76,12 @@ Your directory structure should look like this:
pngsuite
visupng
projects
cbuilder5 (Borland)
visualc6 (msvc)
visualc71
vstudio
xcode
scripts
makefile.*
*.def (module definition files)
etc.
pngtest.png
etc.
zlib
@ -108,7 +112,7 @@ scripts directory into this directory, for example
Read the makefile to see if you need to change any source or
target directories to match your preferences.
Then read pngconf.h to see if you want to make any configuration
Then read pnglibconf.dfa to see if you want to make any configuration
changes.
Then just run "make" which will create the libpng library in
@ -126,19 +130,6 @@ do that, run "make install" in the zlib directory first if necessary).
Some also allow you to run "make test-installed" after you have
run "make install".
If you encounter a compiler error message complaining about the
lines
__png.h__ already includes setjmp.h;
__dont__ include it again.;
this means you have compiled another module that includes setjmp.h,
which is hazardous because the two modules might not include exactly
the same setjmp.h. If you are sure that you know what you are doing
and that they are exactly the same, then you can comment out or
delete the two lines. Better yet, use the cexcept interface
instead, as demonstrated in contrib/visupng of the libpng distribution.
Further information can be found in the README and libpng.txt
Further information can be found in the README and libpng-manual.txt
files, in the individual makefiles, in png.h, and the manual pages
libpng.3 and png.5.

View File

@ -10,8 +10,8 @@ this sentence.
This code is released under the libpng license.
libpng versions 1.2.6, August 15, 2004, through 1.4.4, September 23, 2010, are
Copyright (c) 2004, 2006-2010 Glenn Randers-Pehrson, and are
libpng versions 1.2.6, August 15, 2004, through 1.5.5, September 22, 2011, are
Copyright (c) 2004, 2006-2011 Glenn Randers-Pehrson, and are
distributed according to the same disclaimer and license as libpng-1.2.5
with the following individual added to the list of Contributing Authors
@ -108,4 +108,4 @@ certification mark of the Open Source Initiative.
Glenn Randers-Pehrson
glennrp at users.sourceforge.net
September 23, 2010
September 22, 2011

View File

@ -1,4 +1,4 @@
README for libpng version 1.4.4 - September 23, 2010 (shared library 14.0)
README for libpng version 1.5.5 - September 22, 2011 (shared library 15.0)
See the note about version numbers near the top of png.h
See INSTALL for instructions on how to install libpng.
@ -58,7 +58,7 @@ on the PNG-implement mailing list and not on material submitted
privately to Guy, Andreas, or Glenn. They will forward any good
suggestions to the list.
For a detailed description on using libpng, read libpng.txt. For
For a detailed description on using libpng, read libpng-manual.txt. For
examples of libpng in a program, see example.c and pngtest.c. For usage
information and restrictions (what little they are) on libpng, see
png.h. For a description on using zlib (the compression library used by
@ -114,19 +114,16 @@ given in previous versions of this document. He and Andreas will
read mail addressed to the png-implement list, however.
Please do not send general questions about PNG. Send them to
the (png-list at ccrc.wustl.edu, subscription required, write to
majordomo at ccrc.wustl.edu with "subscribe png-list" in your message).
On the other hand,
please do not send libpng questions to that address, send them to me
or to the png-implement list. I'll
get them in the end anyway. If you have a question about something
png-mng-misc at lists.sf.net (subscription required; visit
https://lists.sourceforge.net/lists/listinfo/png-mng-misc to
subscribe). If you have a question about something
in the PNG specification that is related to using libpng, send it
to me. Send me any questions that start with "I was using libpng,
and ...". If in doubt, send questions to me. I'll bounce them
to others, if necessary.
Please do not send suggestions on how to change PNG. We have
been discussing PNG for nine years now, and it is official and
been discussing PNG for sixteen years now, and it is official and
finished. If you have suggestions for libpng, however, I'll
gladly listen. Even if your suggestion is not used immediately,
it may be used later.
@ -141,13 +138,17 @@ Files in this distribution:
TODO => Things not implemented in the current library
Y2KINFO => Statement of Y2K compliance
example.c => Example code for using libpng functions
libpng.3 => manual page for libpng (includes libpng.txt)
libpng.txt => Description of libpng and its functions
libpng.3 => manual page for libpng (includes libpng-manual.txt)
libpng-manual.txt => Description of libpng and its functions
libpngpf.3 => manual page for libpng's private functions
png.5 => manual page for the PNG format
png.c => Basic interface functions common to library
png.h => Library function and interface declarations
pngconf.h => System specific library configuration
png.h => Library function and interface declarations (public)
pngpriv.h => Library function and interface declarations (private)
pngconf.h => System specific library configuration (public)
pngstruct.h => png_struct declaration (private)
pnginfo.h => png_info struct declaration (private)
pngdebug.h => debugging macros (private)
pngerror.c => Error/warning message I/O functions
pngget.c => Functions for retrieving info from struct
pngmem.c => Memory handling functions
@ -176,72 +177,16 @@ Files in this distribution:
visupng => Contains a MSVC workspace for VisualPng
projects => Contains project files and workspaces for
building a DLL
c5builder => Contains a Borland workspace for building
cbuilder5 => Contains a Borland workspace for building
libpng and zlib
visualc6 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
visualc71 => Contains a Microsoft Visual C++ (MSVC)
workspace for building libpng and zlib
xcode => Contains an Apple xcode
workspace for building libpng and zlib
scripts => Directory containing scripts for building libpng:
descrip.mms => VMS makefile for MMS or MMK
makefile.std => Generic UNIX makefile (cc, creates static
libpng.a)
makefile.elf => Linux/ELF makefile symbol versioning,
(gcc, creates libpng14.so.14.1.4.4)
makefile.linux => Linux/ELF makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.gcc => Generic makefile (gcc, creates static libpng.a)
makefile.knr => Archaic UNIX Makefile that converts files with
ansi2knr (Requires ansi2knr.c from
ftp://ftp.cs.wisc.edu/ghost)
makefile.aix => AIX makefile
makefile.cygwin => Cygwin/gcc makefile
makefile.darwin => Darwin makefile
makefile.dec => DEC Alpha UNIX makefile
makefile.freebsd => FreeBSD makefile
makefile.hpgcc => HPUX makefile using gcc
makefile.hpux => HPUX (10.20 and 11.00) makefile
makefile.hp64 => HPUX (10.20 and 11.00) makefile, 64 bit
makefile.ibmc => IBM C/C++ version 3.x for Win32 and OS/2 (static)
makefile.intel => Intel C/C++ version 4.0 and later
makefile.mingw => Mingw/gcc makefile
makefile.netbsd => NetBSD/cc makefile, makes libpng.so.
makefile.ne14bsd => NetBSD/cc makefile, makes
libpng14.so
makefile.openbsd => OpenBSD makefile
makefile.sgi => Silicon Graphics IRIX (cc, creates static lib)
makefile.sggcc => Silicon Graphics
(gcc, creates libpng14.so.14.1.4.4)
makefile.sunos => Sun makefile
makefile.solaris => Solaris 2.X makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.so9 => Solaris 9 makefile
(gcc, creates libpng14.so.14.1.4.4)
makefile.32sunu => Sun Ultra 32-bit makefile
makefile.64sunu => Sun Ultra 64-bit makefile
makefile.sco => For SCO OSr5 ELF and Unixware 7 with Native cc
makefile.mips => MIPS makefile
makefile.acorn => Acorn makefile
makefile.amiga => Amiga makefile
smakefile.ppc => AMIGA smakefile for SAS C V6.58/7.00 PPC
compiler (Requires SCOPTIONS, copied from
scripts/SCOPTIONS.ppc)
makefile.atari => Atari makefile
makefile.beos => BEOS makefile for X86
makefile.bor => Borland makefile (uses bcc)
makefile.bc32 => 32-bit Borland C++ (all modules compiled in C mode)
makefile.tc3 => Turbo C 3.0 makefile
makefile.dj2 => DJGPP 2 makefile
makefile.msc => Microsoft C makefile
makefile.vcwin32 => makefile for Microsoft Visual C++ 4.0 and
later (does not use assembler code)
makefile.os2 => OS/2 Makefile (gcc and emx, requires pngos2.def)
png32ce.def => module definition for makefile.cegccg
pngos2.def => OS/2 module definition file used by
makefile.os2
pngwin.def => module definition file used by
makefile.cygwin and makefile.mingw
makefile.watcom => Watcom 10a+ Makefile, 32-bit flat memory model
makevms.com => VMS build script
SCOPTIONS.ppc => Used with smakefile.ppc
(see scripts/README.txt for the list of scripts)
Good luck, and happy coding.

View File

@ -2,14 +2,12 @@
TODO - list of things to do for libpng:
Final bug fixes.
Improve API by hiding the png_struct and png_info structs.
Finish work on the no-floating-point version (including gamma compensation)
Better C++ wrapper/full C++ implementation?
Fix problem with C++ and EXTERN "C".
cHRM transformation.
Improve setjmp/longjmp usage or remove it in favor of returning error codes.
Remove setjmp/longjmp usage in favor of returning error codes.
Add "grayscale->palette" transformation and "palette->grayscale" detection.
Improved quantizing and dithering.
Improved dithering.
Multi-lingual error and warning message support.
Complete sRGB transformation (presently it simply uses gamma=0.45455).
Man pages for function calls.
@ -18,14 +16,12 @@ Better filter selection
(counting huffman bits/precompression? filter inertia? filter costs?).
Histogram creation.
Text conversion between different code pages (Latin-1 -> Mac and DOS).
Build gamma tables using fixed point (and do away with floating point entirely).
Avoid building gamma tables whenever possible.
Use greater precision when changing to linear gamma for compositing against
background and doing rgb-to-gray transformation.
Investigate pre-incremented loop counters and other loop constructions.
Add interpolated method of handling interlacing.
Provide for conditional compilation of 16-bit support (except for the
initial stripping down to 8-bits when reading a 16-bit PNG datastream).
Switch to the simpler zlib (zlib/libpng) license if legally possible.
Extend pngvalid.c to validate more of the libpng transformations.
*/

View File

@ -1,13 +1,19 @@
#!/bin/sh
echo "
There is no \"configure\" script in this distribution of
libpng-1.4.4.
libpng-1.5.5.
Instead, please copy the appropriate makefile for your system from the
\"scripts\" directory. Read the INSTALL file for more details.
Update, July 2004: you can get a \"configure\" based distribution
from the libpng distribution sites. Download the file
libpng-1.4.4.tar.gz, libpng-1.4.4.tar.xz, or libpng-1.4.4.tar.bz2
libpng-1.5.5.tar.gz, libpng-1.5.5.tar.xz, or libpng-1.5.5.tar.bz2
If the line endings in the files look funny, which is likely to be the
case if you were trying to run \"configure\" on a Linux machine, you may
wish to get the other distribution of libpng. It is available in both
tar.gz/tar.xz (UNIX style line endings) and .7z/.zip (DOS style line
endings) formats.
"

View File

@ -1,12 +1,12 @@
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
GNU GENERAL PUBLIC LICENSE
Version 2, June 1991
Copyright (C) 1989, 1991 Free Software Foundation, Inc.
59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
Everyone is permitted to copy and distribute verbatim copies
of this license document, but changing it is not allowed.
Preamble
Preamble
The licenses for most software are designed to take away your
freedom to share and change it. By contrast, the GNU General Public
@ -56,7 +56,7 @@ patent must be licensed for everyone's free use or not licensed at all.
The precise terms and conditions for copying, distribution and
modification follow.
GNU GENERAL PUBLIC LICENSE
GNU GENERAL PUBLIC LICENSE
TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
0. This License applies to any program or other work which contains
@ -255,7 +255,7 @@ make exceptions for this. Our decision will be guided by the two goals
of preserving the free status of all derivatives of our free software and
of promoting the sharing and reuse of software generally.
NO WARRANTY
NO WARRANTY
11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
@ -277,9 +277,9 @@ YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
POSSIBILITY OF SUCH DAMAGES.
END OF TERMS AND CONDITIONS
END OF TERMS AND CONDITIONS
How to Apply These Terms to Your New Programs
How to Apply These Terms to Your New Programs
If you develop a new program, and you want it to be of the greatest
possible use to the public, the best way to achieve this is to make it

View File

@ -23,9 +23,9 @@
# macros --------------------------------------------------------------------
PNGINC = -I/usr/local/include/libpng14
PNGLIB = -L/usr/local/lib -lpng14 # dynamically linked against libpng
#PNGLIB = /usr/local/lib/libpng14.a # statically linked against libpng
PNGINC = -I/usr/local/include/libpng15
PNGLIB = -L/usr/local/lib -lpng15 # dynamically linked against libpng
#PNGLIB = /usr/local/lib/libpng15.a # statically linked against libpng
# or:
#PNGINC = -I../..
#PNGLIB = -L../.. -lpng

View File

@ -26,14 +26,14 @@
# macros --------------------------------------------------------------------
#PNGDIR = /usr/local/lib
#PNGINC = -I/usr/local/include/libpng14
#PNGLIBd = -L$(PNGDIR) -lpng14 # dynamically linked, installed libpng
#PNGLIBs = $(PNGDIR)/libpng14.a # statically linked, installed libpng
#PNGINC = -I/usr/local/include/libpng15
#PNGLIBd = -L$(PNGDIR) -lpng15 # dynamically linked, installed libpng
#PNGLIBs = $(PNGDIR)/libpng15.a # statically linked, installed libpng
# or:
PNGDIR = ../..# this one is for libpng-x.y.z/contrib/gregbook builds
#PNGDIR = ../libpng
PNGINC = -I$(PNGDIR)
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng14 # dynamically linked
PNGLIBd = -Wl,-rpath,$(PNGDIR) -L$(PNGDIR) -lpng15 # dynamically linked
PNGLIBs = $(PNGDIR)/libpng.a # statically linked, local libpng
ZDIR = /usr/local/lib

View File

@ -18,7 +18,7 @@
# "c:\windows\command.com /e:4096" as the program command line and set the
# working directory to this directory. Then double-click to open the new
# DOS-prompt window with a bigger environment and retry the commands above.
#
#
# This makefile assumes libpng and zlib have already been built or downloaded
# and are in subdirectories at the same level as the current subdirectory
# (as indicated by the PNGPATH and ZPATH macros below). Edit as appropriate.

View File

@ -63,9 +63,9 @@ BUILD INSTRUCTIONS
- Prerequisites (in order of compilation):
- zlib http://zlib.net/
- libpng http://www.libpng.org/pub/png/libpng.html
- pngbook http://www.libpng.org/pub/png/book/sources.html
- zlib http://zlib.net/
- libpng http://www.libpng.org/pub/png/libpng.html
- pngbook http://www.libpng.org/pub/png/book/sources.html
The pngbook demo programs are explicitly designed to demonstrate proper
coding techniques for using the libpng reference library. As a result,
@ -104,7 +104,7 @@ BUILD INSTRUCTIONS
unpacked the source code.
For MSVC, set up the necessary environment variables by invoking
%devstudio%\vc\bin\vcvars32.bat
where where %devstudio% is the installation directory for MSVC /
@ -165,19 +165,19 @@ RUNNING THE PROGRAMS: (VERY) BRIEF INTRO
rpng is a simple PNG viewer that can display transparent PNGs with a
specified background color; for example,
rpng -bgcolor \#ff0000 toucan.png
rpng -bgcolor \#ff0000 toucan.png
would display the image with a red background. rpng2 is a progressive
viewer that simulates a web browser in some respects; it can display
images against either a background color or a dynamically generated
background image. For example:
rpng2 -bgpat 16 toucan.png
rpng2 -bgpat 16 toucan.png
wpng is a purely command-line image converter from binary PBMPLUS/NetPBM
format (.pgm or .ppm) to PNG; for example,
wpng -time < toucan-notrans.ppm > toucan-notrans.png
wpng -time < toucan-notrans.ppm > toucan-notrans.png
would convert the specified PPM file (using redirection) to PNG, auto-
matically setting the PNG modification-time chunk.

View File

@ -20,13 +20,13 @@ $ if zpath .eqs. ""
$ then
$ write sys$output "zlib include not found. Exiting..."
$ exit 2
$ endif
$ endif
$!
$ if pngpath .eqs. ""
$ then
$ write sys$output "libpng include not found. Exiting..."
$ exit 2
$ endif
$ endif
$!
$! Look for the compiler used.
$!

View File

@ -229,8 +229,14 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
png_set_expand(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_expand(png_ptr);
#ifdef PNG_READ_16_TO_8_SUPPORTED
if (bit_depth == 16)
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
# else
png_set_strip_16(png_ptr);
# endif
#endif
if (color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png_ptr);
@ -263,7 +269,8 @@ uch *readpng_get_image(double display_exponent, int *pChannels, ulg *pRowbytes)
return NULL;
}
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n", *pChannels, rowbytes, height));
Trace((stderr, "readpng_get_image: channels = %d, rowbytes = %ld, height = %ld\n",
*pChannels, rowbytes, height));
/* set the individual row_pointers to point at the correct offsets */

View File

@ -55,8 +55,10 @@
#include <stdlib.h> /* for exit() prototype */
#include <setjmp.h>
#include "png.h" /* libpng header; includes zlib.h and setjmp.h */
#include <zlib.h>
#include "png.h" /* libpng header from the local directory */
#include "readpng2.h" /* typedefs, common macros, public prototypes */
@ -216,7 +218,11 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
mainprog_info *mainprog_ptr;
int color_type, bit_depth;
png_uint_32 width, height;
#ifdef PNG_FLOATING_POINT_SUPPORTED
double gamma;
#else
png_fixed_point gamma;
#endif
/* setjmp() doesn't make sense here, because we'd either have to exit(),
@ -305,8 +311,14 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
png_set_expand(png_ptr);
if (png_get_valid(png_ptr, info_ptr, PNG_INFO_tRNS))
png_set_expand(png_ptr);
#ifdef PNG_READ_16_TO_8_SUPPORTED
if (bit_depth == 16)
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
# else
png_set_strip_16(png_ptr);
# endif
#endif
if (color_type == PNG_COLOR_TYPE_GRAY ||
color_type == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png_ptr);
@ -327,11 +339,19 @@ static void readpng2_info_callback(png_structp png_ptr, png_infop info_ptr)
* "gamma" value for the entire display system, i.e., the product of
* LUT_exponent and CRT_exponent. */
#ifdef PNG_FLOATING_POINT_SUPPORTED
if (png_get_gAMA(png_ptr, info_ptr, &gamma))
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, gamma);
else
png_set_gamma(png_ptr, mainprog_ptr->display_exponent, 0.45455);
#else
if (png_get_gAMA_fixed(png_ptr, info_ptr, &gamma))
png_set_gamma_fixed(png_ptr,
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), gamma);
else
png_set_gamma_fixed(png_ptr,
(png_fixed_point)(100000*mainprog_ptr->display_exponent+.5), 45455);
#endif
/* we'll let libpng expand interlaced images, too */
@ -480,5 +500,12 @@ static void readpng2_error_handler(png_structp png_ptr, png_const_charp msg)
exit(99);
}
/* Now we have our data structure we can use the information in it
* to return control to our own higher level code (all the points
* where 'setjmp' is called in this file.) This will work with other
* error handling mechanisms as well - libpng always calls png_error
* when it can proceed no further, thus, so long as the error handler
* is intercepted, application code can do its own error recovery.
*/
longjmp(mainprog_ptr->jmpbuf, 1);
}

View File

@ -81,8 +81,8 @@
#define PROGNAME "rpng-x"
#define LONGNAME "Simple PNG Viewer for X"
#define VERSION "2.01 of 16 March 2008"
#define RESNAME "rpng" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */
#define RESNAME "rpng" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */
#include <stdio.h>
#include <stdlib.h>
@ -252,8 +252,8 @@ int main(int argc, char **argv)
else {
bgstr = *argv;
if (strlen(bgstr) != 7 || bgstr[0] != '#')
++error;
else
++error;
else
have_bg = TRUE;
}
} else {

View File

@ -96,8 +96,8 @@
#define PROGNAME "rpng2-x"
#define LONGNAME "Progressive PNG Viewer for X"
#define VERSION "2.03 of 25 February 2010"
#define RESNAME "rpng2" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */
#define RESNAME "rpng2" /* our X resource application name */
#define RESCLASS "Rpng" /* our X resource class name */
#include <stdio.h>
#include <stdlib.h>
@ -132,7 +132,7 @@
(e.type == KeyPress && /* v--- or 1 for shifted keys */ \
((k = XLookupKeysym(&e.xkey, 0)) == XK_q || k == XK_Escape)))
#define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */
#define NO_24BIT_MASKS /* undef case not fully written--only for redisplay() */
#define rgb1_max bg_freq
#define rgb1_min bg_gray
@ -302,7 +302,7 @@ int main(int argc, char **argv)
int have_bg = FALSE;
#ifdef FEATURE_LOOP
int loop = FALSE;
long loop_interval = -1; /* seconds (100,000 max) */
long loop_interval = -1; /* seconds (100,000 max) */
#endif
double LUT_exponent; /* just the lookup table */
double CRT_exponent = 2.2; /* just the monitor */
@ -485,9 +485,6 @@ int main(int argc, char **argv)
"\nPress Q, Esc or mouse button 1 (within image window, after image\n"
"is displayed) to quit.\n"
"\n", PROGNAME,
#if (defined(__i386__) || defined(_M_IX86) || defined(__x86_64__))
(int)strlen(PROGNAME), " ",
#endif
(int)strlen(PROGNAME), " ", default_display_exponent, num_bgpat-1);
exit(1);
}
@ -784,8 +781,9 @@ static void rpng2_x_init(void)
if (rpng2_x_create_window()) {
/* GRR TEMPORARY HACK: this is fundamentally no different from cases
* above; libpng should longjmp() back to us when png_ptr goes away.
* If we/it segfault instead, seems like a libpng bug... */
* above; libpng should call our error handler to longjmp() back to us
* when png_ptr goes away. If we/it segfault instead, seems like a
* libpng bug... */
/* we're here via libpng callback, so if window fails, clean and bail */
readpng2_cleanup(&rpng2_info);
@ -1279,7 +1277,7 @@ static int rpng2_x_load_bg_image(void)
for (row = 0; row < rpng2_info.height; ++row) {
src = bg_data + row*bg_rowbytes;
dest = ximage->data + row*ximage_rowbytes;
if (bpp == 32) { /* slightly optimized version */
if (bpp == 32) { /* slightly optimized version */
for (i = rpng2_info.width; i > 0; --i) {
red = *src++;
green = *src++;

View File

@ -104,7 +104,8 @@ int writepng_init(mainprog_info *mainprog_ptr)
/* setjmp() must be called in every function that calls a PNG-writing
* libpng function, unless an alternate error handler was installed--
* but compatible error handlers must either use longjmp() themselves
* (as in this program) or exit immediately, so here we go: */
* (as in this program) or some other method to return control to
* application code, so here we go: */
if (setjmp(mainprog_ptr->jmpbuf)) {
png_destroy_write_struct(&png_ptr, &info_ptr);
@ -388,5 +389,12 @@ static void writepng_error_handler(png_structp png_ptr, png_const_charp msg)
exit(99);
}
/* Now we have our data structure we can use the information in it
* to return control to our own higher level code (all the points
* where 'setjmp' is called in this file.) This will work with other
* error handling mechanisms as well - libpng always calls png_error
* when it can proceed no further, thus, so long as the error handler
* is intercepted, application code can do its own error recovery.
*/
longjmp(mainprog_ptr->jmpbuf, 1);
}

View File

@ -1,9 +1,10 @@
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
This demonstrates the use of PNG_USER_CONFIG, pngusr.h and pngusr.dfa
To build a minimal read-only decoder with embedded libpng and zlib, run
The makefile builds a minimal read-only decoder with embedded libpng
and zlib.
gather.sh # to collect needed files from pngminus, libpng, and zlib
make
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
If you prefer to use the shared libraries, go to contrib/pngminus
and build the png2pnm application there.
and build the png2pnm application there.

View File

@ -5,27 +5,82 @@
CC=gcc
LD=$(CC)
RM=rm -f
# If awk fails try
# make AWK=nawk
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
-DdeflateParams\(a,b,c\)=Z_OK -I. -O1
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f
COPY=cp
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. -O1
C=.c
O=.o
L=.a
E=
ZOBJS = adler32$(O) crc32$(O) \
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
trees$(O) uncompr$(O) zutil$(O)
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/pngminus
OBJS = pngm2pnm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS = adler32$(C) crc32$(C) \
inffast$(C) inflate$(C) inftrees$(C) \
zutil$(C)
# Standard headers
ZH = zlib.h crc32.h inffast.h inffixed.h \
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
ZOBJS = adler32$(O) crc32$(O) \
inffast$(O) inflate$(O) inftrees$(O) \
zutil$(O)
# libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
# Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
pngset$(O) pngtrans$(O) $(ZOBJS)
pngset$(O) pngtrans$(O)
PROGSRCS= pngm2pnm$(C)
PROGHDRS=
PROGDOCS=
PROGOBJS= pngm2pnm$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h
# note: dependencies do not work on implicit rule lines
.c$(O):
$(CC) -c $(CFLAGS) $<
# dependencies
@ -34,11 +89,62 @@ all: pngm2pnm$(E)
pngm2pnm$(E): $(OBJS)
$(LD) -o pngm2pnm$(E) $(OBJS)
strip pngm2pnm$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) pngm2pnm$(O)
$(RM) pngm2pnm$(E)
$(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
pngm2pnm.c: $(PROGSRC)/png2pnm.c
$(RM) $@
$(COPY) $(PROGSRC)/png2pnm.c $@
# End of makefile for pngm2pnm

View File

@ -0,0 +1,39 @@
# pngminim/decoder/pngusr.dfa
#
# Copyright (c) 2010-2011 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# All that is required is some read code. This example switches
# on the sequential read code (see ../preader for a progressive
# read example).
option SEQUENTIAL_READ on
# You must choose fixed or floating point arithmetic:
# option FLOATING_POINT on
option FIXED_POINT on
# You must chose the internal fixed point implementation or to
# use the system floating point. The latter is considerably
# smaller (by about 1kbyte on an x86 system):
# option FLOATING_ARITHMETIC on
option FLOATING_ARITHMETIC off
# Your program will probably need other options. The example
# program here, pngm2pnm, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on
option READ_EXPAND on
option READ_STRIP_16_TO_8 on

View File

@ -1,6 +1,6 @@
/* minrdpngconf.h: headers to make a minimal png-read-only library
*
* Copyright (c) 2007, 2009 Glenn Randers-Pehrson
* Copyright (c) 2007, 2010-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -12,64 +12,12 @@
#ifndef MINRDPNGCONF_H
#define MINRDPNGCONF_H
/* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) ""
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_READ_BGR
#define PNG_NO_READ_GAMMA
#define PNG_NO_READ_BACKGROUND
#define PNG_NO_READ_QUANTIZE
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_bKGD
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_gAMA
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_sRGB
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_PROGRESSIVE_READ
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1123
#endif /* MINRDPNGCONF_H */

View File

@ -1,9 +1,10 @@
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
To build a minimal write-only decoder with embedded libpng and zlib, run
The makefile builds a minimal write-only decoder with embedded libpng
and zlib.
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
gather.sh # to collect needed files from pngminus, libpng, and zlib
make
If you prefer to use the shared libraries, go to contrib/pngminus
and build the pnm2png application there.
and build the pnm2png application there.

View File

@ -5,7 +5,14 @@
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f
COPY=cp
CFLAGS=-DPNG_USER_CONFIG -DNO_GZIP -I. -O1
@ -14,16 +21,65 @@ O=.o
L=.a
E=
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/pngminus
# Zlib
ZSRCS = adler32$(C) compress$(C) crc32$(C) deflate$(C) \
trees$(C) zutil$(C)
# Standard headers
#ZH = zlib.h crc32.h deflate.h trees.h zutil.h
ZH = zlib.h crc32.h deflate.h trees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
# compress is not required; it is needed to link the zlib
# code because deflate defines an unused API function deflateBound
# which itself calls compressBound from compress.
ZOBJS = adler32$(O) compress$(O) crc32$(O) deflate$(O) \
trees$(O) zutil$(O)
OBJS = pnm2pngm$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
# libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngset$(C) pngtrans$(C) pngwio$(C) pngwrite$(C) \
pngwtran$(C) pngwutil$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
# Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngset$(O) pngtrans$(O) pngwio$(O) pngwrite$(O) \
pngwtran$(O) pngwutil$(O) $(ZOBJS)
pngwtran$(O) pngwutil$(O)
PROGSRCS= pnm2pngm$(C)
PROGHDRS=
PROGDOCS=
PROGOBJS= pnm2pngm$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h pngusr.h zlib.h
.c$(O):
$(CC) -c $(CFLAGS) $<
# dependencies
@ -32,11 +88,62 @@ all: pnm2pngm$(E)
pnm2pngm$(E): $(OBJS)
$(LD) -o pnm2pngm$(E) $(OBJS)
strip pnm2pngm$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) pnm2pngm$(O)
$(RM) pnm2pngm$(E)
$(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
pnm2pngm.c: $(PROGSRC)/pnm2png.c
$(RM) $@
$(COPY) $(PROGSRC)/pnm2png.c $@
# End of makefile for pnm2pngm

View File

@ -0,0 +1,35 @@
# pngminim/encoder/pngusr.dfa
#
# Copyright (c) 2010-2011 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# Switch on the write code - this makes a minimalist encoder
option WRITE on
# You must choose fixed or floating point arithmetic:
# option FLOATING_POINT on
option FIXED_POINT on
# You must chose the internal fixed point implementation or to
# use the system floating point. The latter is considerably
# smaller (by about 1kbyte on an x86 system):
# option FLOATING_ARITHMETIC on
option FLOATING_ARITHMETIC off
# Your program will probably need other options. The example
# program here, pnm2pngm, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on

View File

@ -1,6 +1,6 @@
/* minwrpngconf.h: headers to make a minimal png-write-only library
*
* Copyright (c) 2007, 2009 Glenn Randers-Pehrson
* Copyright (c) 2007, 2010-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -12,65 +12,12 @@
#ifndef MINWRPNGCONF_H
#define MINWRPNGCONF_H
#define PNG_NO_READ_SUPPORTED
/* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) ""
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_WRITE_BACKGROUND
#define PNG_NO_WRITE_BGR
#define PNG_NO_WRITE_GAMMA
#define PNG_NO_WRITE_QUANTIZE
#define PNG_NO_WRITE_INVERT
#define PNG_NO_WRITE_SHIFT
#define PNG_NO_WRITE_PACK
#define PNG_NO_WRITE_PACKSWAP
#define PNG_NO_WRITE_FILLER
#define PNG_NO_WRITE_SWAP
#define PNG_NO_WRITE_SWAP_ALPHA
#define PNG_NO_WRITE_INVERT_ALPHA
#define PNG_NO_WRITE_RGB_TO_GRAY
#define PNG_NO_WRITE_USER_TRANSFORM
#define PNG_NO_WRITE_bKGD
#define PNG_NO_WRITE_cHRM
#define PNG_NO_WRITE_gAMA
#define PNG_NO_WRITE_hIST
#define PNG_NO_WRITE_iCCP
#define PNG_NO_WRITE_oFFs
#define PNG_NO_WRITE_pCAL
#define PNG_NO_WRITE_pHYs
#define PNG_NO_WRITE_sBIT
#define PNG_NO_WRITE_sCAL
#define PNG_NO_WRITE_sPLT
#define PNG_NO_WRITE_sRGB
#define PNG_NO_WRITE_TEXT
#define PNG_NO_WRITE_tIME
#define PNG_NO_WRITE_UNKNOWN_CHUNKS
#define PNG_NO_WRITE_USER_CHUNKS
#define PNG_NO_WRITE_EMPTY_PLTE
#define PNG_NO_WRITE_OPT_PLTE
#define PNG_NO_WRITE_FILTER
#define PNG_NO_WRITE_WEIGHTED_FILTER
#define PNG_NO_WRITE_INTERLACING_SUPPORTED
#define PNG_NO_WRITE_FLUSH
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1143
#endif /* MINWRPNGCONF_H */

View File

@ -1,14 +1,15 @@
This demonstrates the use of PNG_USER_CONFIG and pngusr.h
To build a minimal read-only progressive decoder embedded libpng and
zlib and with your system's X library, run
The makefile builds a minimal read-only progressive decoder with
embedded libpng, zlib and your system's X library.
gather.sh # to collect needed files from gregbook, libpng, and zlib
Specify the location of the zlib source (1.2.1 or later) as ZLIBSRC
on the make command line.
Edit makefile if required, to find your X library and include files,
then
make
make ZLIBSRC=directory
If you prefer to use the shared libraries, go to contrib/gregbook
and build the rpng2-x application there.
and build the rpng2-x application there.

View File

@ -5,7 +5,14 @@
CC=gcc
LD=$(CC)
# If awk fails try
# make AWK=nawk
# If cpp fails try
# make CPP=/lib/cpp
RM=rm -f
COPY=cp
#XINC = -I/usr/include # old-style, stock X distributions
#XLIB = -L/usr/lib/X11 -lX11 # (including SGI IRIX)
@ -23,38 +30,136 @@ XLIB = -L/usr/X11R6/lib -lX11
#LIBS = $(XLIB)
LIBS = $(XLIB) -lm #platforms that need libm
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP \
-DdeflateParams\(a,b,c\)=Z_OK -I. $(XINC) -O1
CFLAGS=-DPNG_USER_CONFIG -DNO_GZCOMPRESS -DNO_GZIP -I. $(XINC) -O1
C=.c
O=.o
L=.a
E=
ZOBJS = adler32$(O) crc32$(O) \
infback$(O) inffast$(O) inflate$(O) inftrees$(O) \
trees$(O) uncompr$(O) zutil$(O)
# Where to find the source code:
PNGSRC =../../..
ZLIBSRC=$(PNGSRC)/../zlib
PROGSRC=$(PNGSRC)/contrib/gregbook
OBJS = rpng2-x$(O) readpng2$(O) png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
# Zlib (minimal inflate requirements - crc32 is used by libpng)
# zutil can be eliminated if you provide your own zcalloc and zcfree
ZSRCS = adler32$(C) crc32$(C) \
inffast$(C) inflate$(C) inftrees$(C) \
zutil$(C)
# Standard headers
ZH = zlib.h crc32.h inffast.h inffixed.h \
inflate.h inftrees.h zutil.h
# Machine generated headers
ZCONF = zconf.h
# Headers callers use
ZINC = zlib.h $(ZCONF)
# Headers the Zlib source uses
ZHDRS = $(ZH) $(ZCONF)
ZOBJS = adler32$(O) crc32$(O) \
inffast$(O) inflate$(O) inftrees$(O) \
zutil$(O)
# libpng
PNGSRCS=png$(C) pngerror$(C) pngget$(C) pngmem$(C) \
pngpread$(C) pngread$(C) pngrio$(C) pngrtran$(C) pngrutil$(C) \
pngset$(C) pngtrans$(C)
# Standard headers
PNGH =png.h pngconf.h pngdebug.h pnginfo.h pngpriv.h pngstruct.h
# Machine generated headers
PNGCONF=pnglibconf.h
# Headers callers use
PNGINC= png.h pngconf.h pngusr.h $(PNGCONF)
# Headers the PNG library uses
PNGHDRS=$(PNGH) $(PNGCONF) pngusr.h
PNGOBJS=png$(O) pngerror$(O) pngget$(O) pngmem$(O) \
pngpread$(O) pngread$(O) pngrio$(O) pngrtran$(O) pngrutil$(O) \
pngset$(O) pngtrans$(O) $(ZOBJS)
pngset$(O) pngtrans$(O)
PROGSRCS= rpng2-x$(C) readpng2$(C)
PROGHDRS= readpng2.h
PROGDOCS= COPYING LICENSE
PROGOBJS= rpng2-x$(O) readpng2$(O)
OBJS = $(PROGOBJS) $(PNGOBJS) $(ZOBJS)
# implicit make rules -------------------------------------------------------
.c$(O): png.h pngconf.h pngpriv.h readpng2.h pngusr.h zlib.h
.c$(O):
$(CC) -c $(CFLAGS) $<
# dependencies
all: rpng2-x$(E)
all: $(PROGDOCS) rpng2-x$(E)
rpng2-x$(E): $(OBJS)
$(LD) -o rpng2-x$(E) $(OBJS) $(LIBS)
strip rpng2-x$(E)
# The DFA_XTRA setting turns all libpng options off then
# turns on those required for this minimal build.
# The CPP_FLAGS setting causes pngusr.h to be included in
# both the build of pnglibconf.h and, subsequently, when
# building libpng itself.
$(PNGCONF): $(PNGSRC)/scripts/pnglibconf.mak\
$(PNGSRC)/scripts/pnglibconf.dfa \
$(PNGSRC)/scripts/options.awk pngusr.h pngusr.dfa
$(RM) pnglibconf.h pnglibconf.dfn
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) CPPFLAGS="-DPNG_USER_CONFIG"\
DFA_XTRA="pngusr.dfa" $@
clean:
$(MAKE) $(MAKEFLAGS) -f $(PNGSRC)/scripts/pnglibconf.mak\
srcdir=$(PNGSRC) clean
$(RM) rpng2-x$(O)
$(RM) rpng2-x$(E)
$(RM) $(OBJS)
# distclean also removes the copied source and headers
distclean: clean
$(RM) -r scripts # historical reasons
$(RM) $(PNGSRCS) $(PNGH)
$(RM) $(ZSRCS) $(ZH) $(ZCONF)
$(RM) $(PROGSRCS) $(PROGHDRS) $(PROGDOCS)
# Header file dependencies:
$(PROGOBJS): $(PROGHDRS) $(PNGINC) $(ZINC)
$(PNGOBJS): $(PNGHDRS) $(ZINC)
$(ZOBJS): $(ZHDRS)
# Gather the source code from the respective directories
$(PNGSRCS) $(PNGH): $(PNGSRC)/$@
$(RM) $@
$(COPY) $(PNGSRC)/$@ $@
# No dependency on the ZLIBSRC target so that it only needs
# to be specified once.
$(ZSRCS) $(ZH):
$(RM) $@
$(COPY) $(ZLIBSRC)/$@ $@
# The unconfigured zconf.h varies in name according to the
# zlib release
$(ZCONF):
$(RM) $@
@for f in zconf.h.in zconf.in.h zconf.h; do\
test -r $(ZLIBSRC)/$$f &&\
echo $(COPY) $(ZLIBSRC)/$$f $@ &&\
$(COPY) $(ZLIBSRC)/$$f $@ && exit 0;\
done; echo copy: $(ZLIBSRC)/zconf.h not found; exit 1
$(PROGSRCS) $(PROGHDRS) $(PROGDOCS): $(PROGSRC)/$@
$(RM) $@
$(COPY) $(PROGSRC)/$@ $@
# End of makefile for rpng2-x

View File

@ -0,0 +1,40 @@
# pngminim/preader/pngusr.dfa
#
# Copyright (c) 2010-2011 Glenn Randers-Pehrson
#
# This code is released under the libpng license.
# For conditions of distribution and use, see the disclaimer
# and license in png.h
# First all the build options off:
everything = off
# Just switch on the progressive read code
option PROGRESSIVE_READ on
# You may choose fixed or floating point APIs:
# option FLOATING_POINT on
option FIXED_POINT on
# You must chose the internal fixed point implementation or to
# use the system floating point. The latter is considerably
# smaller (by about 1kbyte on an x86 system):
option FLOATING_ARITHMETIC on
# option FLOATING_ARITHMETIC off
# Your program will probably need other options. The example
# program here, rpng2-x, requires the following. Take a look
# at pnglibconf.h to find out the full set of what has to be
# enabled to make the following work.
option SETJMP on
option STDIO on
option READ_bKGD on
option READ_GAMMA on
option READ_EXPAND on
option READ_STRIP_16_TO_8 on
option READ_GRAY_TO_RGB on

View File

@ -1,6 +1,6 @@
/* minrdpngconf.h: headers to make a minimal png-read-only library
*
* Copyright (c) 2009 Glenn Randers-Pehrson
* Copyright (c) 2009, 2010-2011 Glenn Randers-Pehrson
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
@ -12,57 +12,12 @@
#ifndef MINPRDPNGCONF_H
#define MINPRDPNGCONF_H
/* To include pngusr.h set -DPNG_USER_CONFIG in CPPFLAGS */
/* List options to turn off features of the build that do not
* affect the API (so are not recorded in pnglibconf.h)
*/
#define PNG_NO_WARNINGS
#define png_warning(s1,s2) ""
#define png_chunk_warning(s1,s2) ""
#define PNG_NO_ERROR_TEXT
#define png_error(s1,s2) png_err(s1)
#define png_chunk_error(s1,s2) png_err(s1)
#define PNG_NO_READ_BGR
#define PNG_NO_READ_DITHER
#define PNG_NO_READ_INVERT
#define PNG_NO_READ_SHIFT
#define PNG_NO_READ_PACK
#define PNG_NO_READ_PACKSWAP
#define PNG_NO_READ_FILLER
#define PNG_NO_READ_SWAP
#define PNG_NO_READ_SWAP_ALPHA
#define PNG_NO_READ_INVERT_ALPHA
#define PNG_NO_READ_RGB_TO_GRAY
#define PNG_NO_READ_USER_TRANSFORM
#define PNG_NO_READ_cHRM
#define PNG_NO_READ_hIST
#define PNG_NO_READ_iCCP
#define PNG_NO_READ_pCAL
#define PNG_NO_READ_pHYs
#define PNG_NO_READ_sBIT
#define PNG_NO_READ_sCAL
#define PNG_NO_READ_sPLT
#define PNG_NO_READ_TEXT
#define PNG_NO_READ_tIME
#define PNG_NO_READ_UNKNOWN_CHUNKS
#define PNG_NO_READ_USER_CHUNKS
#define PNG_NO_READ_EMPTY_PLTE
#define PNG_NO_READ_OPT_PLTE
#define PNG_NO_READ_STRIP_ALPHA
#define PNG_NO_READ_oFFs
#define PNG_NO_WRITE_SUPPORTED
#define PNG_NO_INFO_IMAGE
#define PNG_NO_IO_STATE
#define PNG_NO_USER_MEM
#define PNG_NO_FIXED_POINT_SUPPORTED
#define PNG_NO_MNG_FEATURES
#define PNG_NO_USER_TRANSFORM_PTR
#define PNG_NO_HANDLE_AS_UNKNOWN
#define PNG_NO_CONSOLE_IO
#define PNG_NO_ZALLOC_ZERO
#define PNG_NO_ERROR_NUMBERS
#define PNG_NO_EASY_ACCESS
#define PNG_NO_USER_LIMITS
#define PNG_NO_SET_USER_LIMITS
#define PNG_NO_TIME_RFC1143
#endif /* MINPRDPNGCONF_H */

View File

@ -8,9 +8,9 @@ LD=$(CC)
RM=rm -f
#PNGPATH = /usr/local
#PNGINC = -I$(PNGPATH)/include/libpng12
#PNGLIB = -L$(PNGPATH)/lib -lpng12
#PNGLIBS = $(PNGPATH)/lib/libpng12.a
#PNGINC = -I$(PNGPATH)/include/libpng15
#PNGLIB = -L$(PNGPATH)/lib -lpng15
#PNGLIBS = $(PNGPATH)/lib/libpng15.a
PNGINC = -I../..
PNGLIB = -L../.. -lpng
PNGLIBS = ../../libpng.a
@ -23,9 +23,9 @@ ZINC = -I../../../zlib
ZLIB = -L../../../zlib -lz
ZLIBS = ../../../zlib/libz.a
CFLAGS=-O3 $(PNGINC) $(ZINC)
LDFLAGS=$(PNGLIB) $(ZLIB)
LDFLAGSS=$(PNGLIBS) $(ZLIBS)
CFLAGS=$(PNGINC) $(ZINC)
LDLIBS=$(PNGLIB) $(ZLIB)
LDLIBSS=$(PNGLIBS) $(ZLIBS)
C=.c
O=.o
L=.a
@ -40,19 +40,19 @@ png2pnm$(O): png2pnm$(C)
$(CC) -c $(CFLAGS) png2pnm$(C)
png2pnm$(E): png2pnm$(O)
$(LD) -o png2pnm$(E) png2pnm$(O) $(LDFLAGS) -lm
$(LD) $(LDFLAGS) -o png2pnm$(E) png2pnm$(O) $(LDLIBS) -lm
png2pnm-static$(E): png2pnm$(O)
$(LD) -o png2pnm-static$(E) png2pnm$(O) $(LDFLAGSS) -lm
$(LD) $(LDFLAGS) -o png2pnm-static$(E) png2pnm$(O) $(LDLIBSS) -lm
pnm2png$(O): pnm2png$(C)
$(CC) -c $(CFLAGS) pnm2png$(C)
pnm2png$(E): pnm2png$(O)
$(LD) -o pnm2png$(E) pnm2png$(O) $(LDFLAGS) -lm
$(LD) $(LDFLAGS) -o pnm2png$(E) pnm2png$(O) $(LDLIBS) -lm
pnm2png-static$(E): pnm2png$(O)
$(LD) -o pnm2png-static$(E) pnm2png$(O) $(LDFLAGSS) -lm
$(LD) $(LDFLAGS) -o pnm2png-static$(E) pnm2png$(O) $(LDLIBSS) -lm
clean:
$(RM) png2pnm$(O)

View File

@ -144,7 +144,7 @@ int main(int argc, char *argv[])
if (png2pnm (fp_rd, fp_wr, fp_al, raw, alpha) == FALSE)
{
fprintf (stderr, "PNG2PNM\n");
fprintf (stderr, "Error: unsuccessful convertion of PNG-image\n");
fprintf (stderr, "Error: unsuccessful conversion of PNG-image\n");
exit(1);
}
@ -188,7 +188,7 @@ void usage()
BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL alpha)
{
png_struct *png_ptr = NULL;
png_info *info_ptr = NULL;
png_info *info_ptr = NULL;
png_byte buf[8];
png_byte *png_pixels = NULL;
png_byte **row_pointers = NULL;
@ -381,7 +381,7 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
fputc ((int) *pix_ptr++ , pnm_file);
else
if (bit_depth == 16){
dep_16 = (long) *pix_ptr++;
dep_16 = (long) *pix_ptr++;
fprintf (pnm_file, "%ld ", (dep_16 << 8) + ((long) *pix_ptr++));
}
else
@ -401,9 +401,9 @@ BOOL png2pnm (FILE *png_file, FILE *pnm_file, FILE *alpha_file, BOOL raw, BOOL a
fputc ((int) *pix_ptr++ , alpha_file);
else
if (bit_depth == 16){
dep_16 = (long) *pix_ptr++;
dep_16 = (long) *pix_ptr++;
fprintf (alpha_file, "%ld ", (dep_16 << 8) + (long) *pix_ptr++);
}
}
else
fprintf (alpha_file, "%ld ", (long) *pix_ptr++);
}

View File

@ -1,12 +1,13 @@
//-------------------------------------
// PNGFILE.C -- Image File Functions
//-------------------------------------
// Copyright 2000, Willem van Schaik.
//
// This code is released under the libpng license.
// For conditions of distribution and use, see the disclaimer
// and license in png.h
/*-------------------------------------
* PNGFILE.C -- Image File Functions
*-------------------------------------
*
* Copyright 2000, Willem van Schaik.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
#include <windows.h>
#include <commdlg.h>
@ -28,7 +29,7 @@ static png_structp png_ptr = NULL;
static png_infop info_ptr = NULL;
// cexcept interface
/* cexcept interface */
static void
png_cexcept_error(png_structp png_ptr, png_const_charp msg)
@ -43,7 +44,7 @@ png_cexcept_error(png_structp png_ptr, png_const_charp msg)
}
}
// Windows open-file functions
/* Windows open-file functions */
void PngFileInitialize (HWND hwnd)
{
@ -57,13 +58,13 @@ void PngFileInitialize (HWND hwnd)
ofn.lpstrCustomFilter = NULL;
ofn.nMaxCustFilter = 0;
ofn.nFilterIndex = 0;
ofn.lpstrFile = NULL; // Set in Open and Close functions
ofn.lpstrFile = NULL; /* Set in Open and Close functions */
ofn.nMaxFile = MAX_PATH;
ofn.lpstrFileTitle = NULL; // Set in Open and Close functions
ofn.lpstrFileTitle = NULL; /* Set in Open and Close functions */
ofn.nMaxFileTitle = MAX_PATH;
ofn.lpstrInitialDir = NULL;
ofn.lpstrTitle = NULL;
ofn.Flags = 0; // Set in Open and Close functions
ofn.Flags = 0; /* Set in Open and Close functions */
ofn.nFileOffset = 0;
ofn.nFileExtension = 0;
ofn.lpstrDefExt = TEXT ("png");
@ -92,7 +93,7 @@ BOOL PngFileSaveDlg (HWND hwnd, PTSTR pstrFileName, PTSTR pstrTitleName)
return GetSaveFileName (&ofn);
}
// PNG image handler functions
/* PNG image handler functions */
BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
int *piWidth, int *piHeight, int *piChannels, png_color *pBkgColor)
@ -109,7 +110,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
static png_byte **ppbRowPointers = NULL;
int i;
// open the PNG input file
/* open the PNG input file */
if (!pstrFileName)
{
@ -123,7 +124,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
return FALSE;
}
// first check the eight byte PNG signature
/* first check the eight byte PNG signature */
fread(pbSig, 1, 8, pfFile);
if (png_sig_cmp(pbSig, 0, 8))
@ -132,7 +133,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
return FALSE;
}
// create the two png(-info) structures
/* create the two png(-info) structures */
png_ptr = png_create_read_struct(PNG_LIBPNG_VER_STRING, NULL,
(png_error_ptr)png_cexcept_error, (png_error_ptr)NULL);
@ -152,31 +153,37 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
Try
{
// initialize the png structure
/* initialize the png structure */
#ifdef PNG_STDIO_SUPPORTED
png_init_io(png_ptr, pfFile);
#else
png_set_read_fn(png_ptr, (png_voidp)pfFile, png_read_data);
#endif
png_set_sig_bytes(png_ptr, 8);
// read all PNG info up to image data
/* read all PNG info up to image data */
png_read_info(png_ptr, info_ptr);
// get width, height, bit-depth and color-type
/* get width, height, bit-depth and color-type */
png_get_IHDR(png_ptr, info_ptr, piWidth, piHeight, &iBitDepth,
&iColorType, NULL, NULL, NULL);
// expand images of all color-type and bit-depth to 3x8 bit RGB images
// let the library process things like alpha, transparency, background
if (iBitDepth == 16)
png_set_strip_16(png_ptr);
/* expand images of all color-type and bit-depth to 3x8-bit RGB */
/* let the library process alpha, transparency, background, etc. */
#ifdef PNG_READ_16_TO_8_SUPPORTED
if (iBitDepth == 16)
# ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
# else
png_set_strip_16(png_ptr);
# endif
#endif
if (iColorType == PNG_COLOR_TYPE_PALETTE)
png_set_expand(png_ptr);
if (iBitDepth < 8)
@ -186,8 +193,8 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
if (iColorType == PNG_COLOR_TYPE_GRAY ||
iColorType == PNG_COLOR_TYPE_GRAY_ALPHA)
png_set_gray_to_rgb(png_ptr);
// set the background color to draw transparent and alpha images over.
/* set the background color to draw transparent and alpha images over */
if (png_get_bKGD(png_ptr, info_ptr, &pBackground))
{
png_set_background(png_ptr, pBackground, PNG_BACKGROUND_GAMMA_FILE, 1, 1.0);
@ -199,30 +206,30 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
{
pBkgColor = NULL;
}
// if required set gamma conversion
/* if required set gamma conversion */
if (png_get_gAMA(png_ptr, info_ptr, &dGamma))
png_set_gamma(png_ptr, (double) 2.2, dGamma);
// after the transformations have been registered update info_ptr data
/* after the transformations are registered, update info_ptr data */
png_read_update_info(png_ptr, info_ptr);
// get again width, height and the new bit-depth and color-type
/* get again width, height and the new bit-depth and color-type */
png_get_IHDR(png_ptr, info_ptr, piWidth, piHeight, &iBitDepth,
&iColorType, NULL, NULL, NULL);
// row_bytes is the width x number of channels
/* row_bytes is the width x number of channels */
ulRowBytes = png_get_rowbytes(png_ptr, info_ptr);
ulChannels = png_get_channels(png_ptr, info_ptr);
*piChannels = ulChannels;
// now we can allocate memory to store the image
/* now we can allocate memory to store the image */
if (pbImageData)
{
free (pbImageData);
@ -234,34 +241,34 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
png_error(png_ptr, "Visual PNG: out of memory");
}
*ppbImageData = pbImageData;
// and allocate memory for an array of row-pointers
/* and allocate memory for an array of row-pointers */
if ((ppbRowPointers = (png_bytepp) malloc((*piHeight)
* sizeof(png_bytep))) == NULL)
{
png_error(png_ptr, "Visual PNG: out of memory");
}
// set the individual row-pointers to point at the correct offsets
/* set the individual row-pointers to point at the correct offsets */
for (i = 0; i < (*piHeight); i++)
ppbRowPointers[i] = pbImageData + i * ulRowBytes;
// now we can go ahead and just read the whole image
/* now we can go ahead and just read the whole image */
png_read_image(png_ptr, ppbRowPointers);
// read the additional chunks in the PNG file (not really needed)
/* read the additional chunks in the PNG file (not really needed) */
png_read_end(png_ptr, NULL);
// and we're done
/* and we're done */
free (ppbRowPointers);
ppbRowPointers = NULL;
// yepp, done
/* yepp, done */
}
Catch (msg)
@ -269,7 +276,7 @@ BOOL PngLoadImage (PTSTR pstrFileName, png_byte **ppbImageData,
png_destroy_read_struct(&png_ptr, &info_ptr, NULL);
*ppbImageData = pbImageData = NULL;
if(ppbRowPointers)
free (ppbRowPointers);
@ -295,7 +302,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
static png_byte **ppbRowPointers = NULL;
int i;
// open the PNG output file
/* open the PNG output file */
if (!pstrFileName)
return FALSE;
@ -303,7 +310,7 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
if (!(pfFile = fopen(pstrFileName, "wb")))
return FALSE;
// prepare the standard PNG structures
/* prepare the standard PNG structures */
png_ptr = png_create_write_struct(PNG_LIBPNG_VER_STRING, NULL,
(png_error_ptr)png_cexcept_error, (png_error_ptr)NULL);
@ -322,60 +329,60 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
Try
{
// initialize the png structure
/* initialize the png structure */
#ifdef PNG_STDIO_SUPPORTED
png_init_io(png_ptr, pfFile);
#else
png_set_write_fn(png_ptr, (png_voidp)pfFile, png_write_data, png_flush);
#endif
// we're going to write a very simple 3x8 bit RGB image
/* we're going to write a very simple 3x8-bit RGB image */
png_set_IHDR(png_ptr, info_ptr, iWidth, iHeight, ciBitDepth,
PNG_COLOR_TYPE_RGB, PNG_INTERLACE_NONE, PNG_COMPRESSION_TYPE_BASE,
PNG_FILTER_TYPE_BASE);
// write the file header information
/* write the file header information */
png_write_info(png_ptr, info_ptr);
// swap the BGR pixels in the DiData structure to RGB
/* swap the BGR pixels in the DiData structure to RGB */
png_set_bgr(png_ptr);
// row_bytes is the width x number of channels
/* row_bytes is the width x number of channels */
ulRowBytes = iWidth * ciChannels;
// we can allocate memory for an array of row-pointers
/* we can allocate memory for an array of row-pointers */
if ((ppbRowPointers = (png_bytepp) malloc(iHeight * sizeof(png_bytep))) == NULL)
Throw "Visualpng: Out of memory";
// set the individual row-pointers to point at the correct offsets
/* set the individual row-pointers to point at the correct offsets */
for (i = 0; i < iHeight; i++)
ppbRowPointers[i] = pDiData + i * (((ulRowBytes + 3) >> 2) << 2);
// write out the entire image data in one call
/* write out the entire image data in one call */
png_write_image (png_ptr, ppbRowPointers);
// write the additional chunks to the PNG file (not really needed)
/* write the additional chunks to the PNG file (not really needed) */
png_write_end(png_ptr, info_ptr);
// and we're done
/* and we're done */
free (ppbRowPointers);
ppbRowPointers = NULL;
// clean up after the write, and free any memory allocated
/* clean up after the write, and free any memory allocated */
png_destroy_write_struct(&png_ptr, (png_infopp) NULL);
// yepp, done
/* yepp, done */
}
Catch (msg)
@ -389,9 +396,9 @@ BOOL PngSaveImage (PTSTR pstrFileName, png_byte *pDiData,
return FALSE;
}
fclose (pfFile);
return TRUE;
}
@ -437,6 +444,7 @@ png_flush(png_structp png_ptr)
#endif
//-----------------
// end of source
//-----------------
/*-----------------
* end of source
*-----------------
*/

View File

@ -1,12 +1,12 @@
//------------------------------------------
// PNGFILE.H -- Header File for pngfile.c
//------------------------------------------
/*------------------------------------------*/
/* PNGFILE.H -- Header File for pngfile.c*/
/*------------------------------------------*/
// Copyright 2000, Willem van Schaik.
/* Copyright 2000, Willem van Schaik.*/
// This code is released under the libpng license.
// For conditions of distribution and use, see the disclaimer
// and license in png.h
/* This code is released under the libpng license.*/
/* For conditions of distribution and use, see the disclaimer*/
/* and license in png.h*/
#include <stdio.h>
#include <stdlib.h>

View File

@ -8,8 +8,8 @@ For conditions of distribution and use, see the disclaimer
and license in png.h
As a PNG .dll demo VisualPng is finished. More features would only hinder
the program's objective. However, further extensions (like support for other
graphics formats) are in development. To get these, or for pre-compiled
the program's objective. However, further extensions (like support for other
graphics formats) are in development. To get these, or for pre-compiled
binaries, go to "http://www.schaik.com/png/visualpng.html".
------------------------------------------------------------------------

View File

@ -1,41 +1,42 @@
//------------------------------------
// VisualPng.C -- Shows a PNG image
//------------------------------------
/*------------------------------------
* VisualPng.C -- Shows a PNG image
*------------------------------------
*
* Copyright 2000, Willem van Schaik.
*
* This code is released under the libpng license.
* For conditions of distribution and use, see the disclaimer
* and license in png.h
*/
// Copyright 2000, Willem van Schaik.
/* switches */
// This code is released under the libpng license.
// For conditions of distribution and use, see the disclaimer
// and license in png.h
// switches
// defines
/* defines */
#define PROGNAME "VisualPng"
#define LONGNAME "Win32 Viewer for PNG-files"
#define VERSION "1.0 of 2000 June 07"
// constants
/* constants */
#define MARGIN 8
// standard includes
/* standard includes */
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <windows.h>
// application includes
/* application includes */
#include "png.h"
#include "pngfile.h"
#include "resource.h"
// macros
/* macros */
// function prototypes
/* function prototypes */
LRESULT CALLBACK WndProc (HWND, UINT, WPARAM, LPARAM);
BOOL CALLBACK AboutDlgProc (HWND, UINT, WPARAM, LPARAM) ;
@ -65,14 +66,14 @@ BOOL FillBitmap (
BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels,
BOOL bStretched);
// a few global variables
/* a few global variables */
static char *szProgName = PROGNAME;
static char *szAppName = LONGNAME;
static char *szIconName = PROGNAME;
static char szCmdFileName [MAX_PATH];
// MAIN routine
/* MAIN routine */
int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
PSTR szCmdLine, int iCmdShow)
@ -90,7 +91,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
wndclass.hInstance = hInstance;
wndclass.hIcon = LoadIcon (hInstance, szIconName) ;
wndclass.hCursor = LoadCursor (NULL, IDC_ARROW);
wndclass.hbrBackground = NULL; // (HBRUSH) GetStockObject (GRAY_BRUSH);
wndclass.hbrBackground = NULL; /* (HBRUSH) GetStockObject (GRAY_BRUSH); */
wndclass.lpszMenuName = szProgName;
wndclass.lpszClassName = szProgName;
@ -101,7 +102,7 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
return 0;
}
// if filename given on commandline, store it
/* if filename given on commandline, store it */
if ((szCmdLine != NULL) && (*szCmdLine != '\0'))
if (szCmdLine[0] == '"')
strncpy (szCmdFileName, szCmdLine + 1, strlen(szCmdLine) - 2);
@ -110,20 +111,20 @@ int WINAPI WinMain (HINSTANCE hInstance, HINSTANCE hPrevInstance,
else
strcpy (szCmdFileName, "");
// calculate size of window-borders
/* calculate size of window-borders */
ixBorders = 2 * (GetSystemMetrics (SM_CXBORDER) +
GetSystemMetrics (SM_CXDLGFRAME));
iyBorders = 2 * (GetSystemMetrics (SM_CYBORDER) +
GetSystemMetrics (SM_CYDLGFRAME)) +
GetSystemMetrics (SM_CYCAPTION) +
GetSystemMetrics (SM_CYMENUSIZE) +
1; /* WvS: don't ask me why? */
1; /* WvS: don't ask me why? */
hwnd = CreateWindow (szProgName, szAppName,
WS_OVERLAPPEDWINDOW,
CW_USEDEFAULT, CW_USEDEFAULT,
512 + 2 * MARGIN + ixBorders, 384 + 2 * MARGIN + iyBorders,
// CW_USEDEFAULT, CW_USEDEFAULT,
/* CW_USEDEFAULT, CW_USEDEFAULT, */
NULL, NULL, hInstance, NULL);
ShowWindow (hwnd, iCmdShow);
@ -180,29 +181,29 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
strcpy (szImgPathName, "");
// in case we process file given on command-line
/* in case we process file given on command-line */
if (szCmdFileName[0] != '\0')
{
strcpy (szImgPathName, szCmdFileName);
// read the other png-files in the directory for later
// next/previous commands
/* read the other png-files in the directory for later */
/* next/previous commands */
BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount,
&iPngFileIndex);
// load the image from file
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName,
&pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
@ -214,11 +215,11 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
cxWinSize = LOWORD (lParam);
cyWinSize = HIWORD (lParam);
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
@ -242,28 +243,28 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
{
case IDM_FILE_OPEN:
// show the File Open dialog box
/* show the File Open dialog box */
if (!PngFileOpenDlg (hwnd, szImgPathName, szTitleName))
return 0;
// read the other png-files in the directory for later
// next/previous commands
/* read the other png-files in the directory for later */
/* next/previous commands */
BuildPngList (szImgPathName, &pPngFileList, &iPngFileCount,
&iPngFileIndex);
// load the image from file
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName,
&pbImage, &cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
@ -272,12 +273,12 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
case IDM_FILE_SAVE:
// show the File Save dialog box
/* show the File Save dialog box */
if (!PngFileSaveDlg (hwnd, szImgPathName, szTitleName))
return 0;
// save the PNG to a disk file
/* save the PNG to a disk file */
SetCursor (LoadCursor (NULL, IDC_WAIT));
ShowCursor (TRUE);
@ -295,55 +296,55 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
case IDM_FILE_NEXT:
// read next entry in the directory
/* read next entry in the directory */
if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex,
NULL, szImgPathName))
{
if (strcmp (szImgPathName, "") == 0)
return 0;
// load the image from file
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName, &pbImage,
&cxImgSize, &cyImgSize, &cImgChannels, &bkgColor))
return 0;
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
}
return 0;
case IDM_FILE_PREVIOUS:
// read previous entry in the directory
/* read previous entry in the directory */
if (SearchPngList (pPngFileList, iPngFileCount, &iPngFileIndex,
szImgPathName, NULL))
{
if (strcmp (szImgPathName, "") == 0)
return 0;
// load the image from file
/* load the image from file */
if (!LoadImageFile (hwnd, szImgPathName, &pbImage, &cxImgSize,
&cyImgSize, &cImgChannels, &bkgColor))
return 0;
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
}
@ -352,9 +353,9 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
case IDM_FILE_EXIT:
// more cleanup needed...
/* more cleanup needed... */
// free image buffer
/* free image buffer */
if (pDib != NULL)
{
@ -362,7 +363,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
pDib = NULL;
}
// free file-list
/* free file-list */
if (pPngFileList != NULL)
{
@ -370,7 +371,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
pPngFileList = NULL;
}
// let's go ...
/* let's go ... */
exit (0);
@ -383,11 +384,11 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
else
CheckMenuItem (hMenu, IDM_OPTIONS_STRETCH, MF_UNCHECKED);
// invalidate the client area for later update
/* invalidate the client area for later update */
InvalidateRect (hwnd, NULL, TRUE);
// display the PNG into the DIBitmap
/* display the PNG into the DIBitmap */
DisplayImage (hwnd, &pDib, &pDiData, cxWinSize, cyWinSize,
pbImage, cxImgSize, cyImgSize, cImgChannels, bStretched);
@ -398,7 +399,7 @@ LRESULT CALLBACK WndProc (HWND hwnd, UINT message, WPARAM wParam,
DialogBox (hInstance, TEXT ("AboutBox"), hwnd, AboutDlgProc) ;
return 0;
} // end switch
} /* end switch */
break;
@ -450,10 +451,10 @@ BOOL CALLBACK AboutDlgProc (HWND hDlg, UINT message,
return FALSE ;
}
//---------------
// CenterAbout
//---------------
/*---------------
* CenterAbout
*---------------
*/
BOOL CenterAbout (HWND hwndChild, HWND hwndParent)
{
RECT rChild, rParent, rWorkArea;
@ -461,19 +462,19 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent)
int xNew, yNew;
BOOL bResult;
// Get the Height and Width of the child window
/* Get the Height and Width of the child window */
GetWindowRect (hwndChild, &rChild);
wChild = rChild.right - rChild.left;
hChild = rChild.bottom - rChild.top;
// Get the Height and Width of the parent window
/* Get the Height and Width of the parent window */
GetWindowRect (hwndParent, &rParent);
wParent = rParent.right - rParent.left;
hParent = rParent.bottom - rParent.top;
// Get the limits of the 'workarea'
/* Get the limits of the 'workarea' */
bResult = SystemParametersInfo(
SPI_GETWORKAREA, // system parameter to query or set
SPI_GETWORKAREA, /* system parameter to query or set */
sizeof(RECT),
&rWorkArea,
0);
@ -483,7 +484,7 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent)
rWorkArea.bottom = GetSystemMetrics(SM_CYSCREEN);
}
// Calculate new X position, then adjust for workarea
/* Calculate new X position, then adjust for workarea */
xNew = rParent.left + ((wParent - wChild) /2);
if (xNew < rWorkArea.left) {
xNew = rWorkArea.left;
@ -491,7 +492,7 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent)
xNew = rWorkArea.right - wChild;
}
// Calculate new Y position, then adjust for workarea
/* Calculate new Y position, then adjust for workarea */
yNew = rParent.top + ((hParent - hChild) /2);
if (yNew < rWorkArea.top) {
yNew = rWorkArea.top;
@ -499,15 +500,15 @@ BOOL CenterAbout (HWND hwndChild, HWND hwndParent)
yNew = rWorkArea.bottom - hChild;
}
// Set it, and return
/* Set it, and return */
return SetWindowPos (hwndChild, NULL, xNew, yNew, 0, 0, SWP_NOSIZE |
SWP_NOZORDER);
}
//----------------
// BuildPngList
//----------------
/*----------------
* BuildPngList
*----------------
*/
BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
int *pFileIndex)
{
@ -523,7 +524,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
int i, ii;
int j, jj;
// free previous file-list
/* free previous file-list */
if (*ppFileList != NULL)
{
@ -531,7 +532,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
*ppFileList = NULL;
}
// extract foldername, filename and search-name
/* extract foldername, filename and search-name */
strcpy (szImgPathName, pstrPathName);
strcpy (szImgFileName, strrchr (pstrPathName, '\\') + 1);
@ -540,7 +541,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
*(strrchr (szImgFindName, '\\') + 1) = '\0';
strcat (szImgFindName, "*.png");
// first cycle: count number of files in directory for memory allocation
/* first cycle: count number of files in directory for memory allocation */
*pFileCount = 0;
@ -554,11 +555,11 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
}
FindClose(hFind);
// allocation memory for file-list
/* allocation memory for file-list */
*ppFileList = (TCHAR *) malloc (*pFileCount * MAX_PATH);
// second cycle: read directory and store filenames in file-list
/* second cycle: read directory and store filenames in file-list */
hFind = FindFirstFile(szImgFindName, &finddata);
bOk = (hFind != (HANDLE) -1);
@ -580,7 +581,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
}
FindClose(hFind);
// finally we must sort the file-list
/* finally we must sort the file-list */
for (i = 0; i < *pFileCount - 1; i++)
{
@ -594,7 +595,7 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
strcpy (*ppFileList + jj, *ppFileList + ii);
strcpy (*ppFileList + ii, szTmp);
// check if this was the current image that we moved
/* check if this was the current image that we moved */
if (*pFileIndex == i)
*pFileIndex = j;
@ -608,9 +609,10 @@ BOOL BuildPngList (PTSTR pstrPathName, TCHAR **ppFileList, int *pFileCount,
return TRUE;
}
//----------------
// SearchPngList
//----------------
/*----------------
* SearchPngList
*----------------
*/
BOOL SearchPngList (
TCHAR *pFileList, int FileCount, int *pFileIndex,
@ -618,30 +620,30 @@ BOOL SearchPngList (
{
if (FileCount > 0)
{
// get previous entry
/* get previous entry */
if (pstrPrevName != NULL)
{
if (*pFileIndex > 0)
*pFileIndex -= 1;
else
*pFileIndex = FileCount - 1;
strcpy (pstrPrevName, pFileList + (*pFileIndex * MAX_PATH));
}
// get next entry
/* get next entry */
if (pstrNextName != NULL)
{
if (*pFileIndex < FileCount - 1)
*pFileIndex += 1;
else
*pFileIndex = 0;
strcpy (pstrNextName, pFileList + (*pFileIndex * MAX_PATH));
}
return TRUE;
}
else
@ -650,9 +652,10 @@ BOOL SearchPngList (
}
}
//-----------------
// LoadImageFile
//-----------------
/*-----------------
* LoadImageFile
*-----------------
*/
BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName,
png_byte **ppbImage, int *pxImgSize, int *pyImgSize,
@ -660,7 +663,7 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName,
{
static TCHAR szTmp [MAX_PATH];
// if there's an existing PNG, free the memory
/* if there's an existing PNG, free the memory */
if (*ppbImage)
{
@ -668,7 +671,7 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName,
*ppbImage = NULL;
}
// Load the entire PNG into memory
/* Load the entire PNG into memory */
SetCursor (LoadCursor (NULL, IDC_WAIT));
ShowCursor (TRUE);
@ -694,10 +697,10 @@ BOOL LoadImageFile (HWND hwnd, PTSTR pstrPathName,
return TRUE;
}
//----------------
// DisplayImage
//----------------
/*----------------
* DisplayImage
*----------------
*/
BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
BYTE **ppDiData, int cxWinSize, int cyWinSize,
BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels,
@ -705,14 +708,14 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
{
BYTE *pDib = *ppDib;
BYTE *pDiData = *ppDiData;
// BITMAPFILEHEADER *pbmfh;
/* BITMAPFILEHEADER *pbmfh; */
BITMAPINFOHEADER *pbmih;
WORD wDIRowBytes;
png_color bkgBlack = {0, 0, 0};
png_color bkgGray = {127, 127, 127};
png_color bkgWhite = {255, 255, 255};
// allocate memory for the Device Independant bitmap
/* allocate memory for the Device Independant bitmap */
wDIRowBytes = (WORD) ((3 * cxWinSize + 3L) >> 2) << 2;
@ -733,7 +736,7 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
*ppDib = pDib;
memset (pDib, 0, sizeof(BITMAPINFOHEADER));
// initialize the dib-structure
/* initialize the dib-structure */
pbmih = (BITMAPINFOHEADER *) pDib;
pbmih->biSize = sizeof(BITMAPINFOHEADER);
@ -745,11 +748,11 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
pDiData = pDib + sizeof(BITMAPINFOHEADER);
*ppDiData = pDiData;
// first fill bitmap with gray and image border
/* first fill bitmap with gray and image border */
InitBitmap (pDiData, cxWinSize, cyWinSize);
// then fill bitmap with image
/* then fill bitmap with image */
if (pbImage)
{
@ -762,16 +765,16 @@ BOOL DisplayImage (HWND hwnd, BYTE **ppDib,
return TRUE;
}
//--------------
// InitBitmap
//--------------
/*--------------
* InitBitmap
*--------------
*/
BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize)
{
BYTE *dst;
int x, y, col;
// initialize the background with gray
/* initialize the background with gray */
dst = pDiData;
for (y = 0; y < cyWinSize; y++)
@ -779,13 +782,13 @@ BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize)
col = 0;
for (x = 0; x < cxWinSize; x++)
{
// fill with GRAY
/* fill with GRAY */
*dst++ = 127;
*dst++ = 127;
*dst++ = 127;
col += 3;
}
// rows start on 4 byte boundaries
/* rows start on 4 byte boundaries */
while ((col % 4) != 0)
{
dst++;
@ -796,10 +799,10 @@ BOOL InitBitmap (BYTE *pDiData, int cxWinSize, int cyWinSize)
return TRUE;
}
//--------------
// FillBitmap
//--------------
/*--------------
* FillBitmap
*--------------
*/
BOOL FillBitmap (
BYTE *pDiData, int cxWinSize, int cyWinSize,
BYTE *pbImage, int cxImgSize, int cyImgSize, int cImgChannels,
@ -824,11 +827,12 @@ BOOL FillBitmap (
cxNewSize = cxWinSize - 2 * MARGIN;
cyNewSize = cyWinSize - 2 * MARGIN;
// stretch the image to it's window determined size
/* stretch the image to it's window determined size */
// the following two are the same, but the first has side-effects
// because of rounding
// if ((cyNewSize / cxNewSize) > (cyImgSize / cxImgSize))
/* the following two are mathematically the same, but the first
* has side-effects because of rounding
*/
/* if ((cyNewSize / cxNewSize) > (cyImgSize / cxImgSize)) */
if ((cyNewSize * cxImgSize) > (cyImgSize * cxNewSize))
{
cyNewSize = cxNewSize * cyImgSize / cxImgSize;
@ -867,12 +871,12 @@ BOOL FillBitmap (
}
}
// calculate row-bytes
/* calculate row-bytes */
wImgRowBytes = cImgChannels * cxNewSize;
wDIRowBytes = (WORD) ((cDIChannels * cxWinSize + 3L) >> 2) << 2;
// copy image to screen
/* copy image to screen */
for (yImg = 0, yWin = cyImgPos; yImg < cyNewSize; yImg++, yWin++)
{
@ -888,7 +892,7 @@ BOOL FillBitmap (
r = *src++;
g = *src++;
b = *src++;
*dst++ = b; /* note the reverse order */
*dst++ = b; /* note the reverse order */
*dst++ = g;
*dst++ = r;
if (cImgChannels == 4)
@ -898,7 +902,7 @@ BOOL FillBitmap (
}
}
// free memory
/* free memory */
if (pStretchedImage != NULL)
{
@ -908,28 +912,28 @@ BOOL FillBitmap (
}
// process the image not-stretched
/* process the image not-stretched */
else
{
// calculate the central position
/* calculate the central position */
cxImgPos = (cxWinSize - cxImgSize) / 2;
cyImgPos = (cyWinSize - cyImgSize) / 2;
// check for image larger than window
/* check for image larger than window */
if (cxImgPos < MARGIN)
cxImgPos = MARGIN;
if (cyImgPos < MARGIN)
cyImgPos = MARGIN;
// calculate both row-bytes
/* calculate both row-bytes */
wImgRowBytes = cImgChannels * cxImgSize;
wDIRowBytes = (WORD) ((cDIChannels * cxWinSize + 3L) >> 2) << 2;
// copy image to screen
/* copy image to screen */
for (yImg = 0, yWin = cyImgPos; yImg < cyImgSize; yImg++, yWin++)
{
@ -945,7 +949,7 @@ BOOL FillBitmap (
r = *src++;
g = *src++;
b = *src++;
*dst++ = b; /* note the reverse order */
*dst++ = b; /* note the reverse order */
*dst++ = g;
*dst++ = r;
if (cImgChannels == 4)
@ -959,6 +963,7 @@ BOOL FillBitmap (
return TRUE;
}
//-----------------
// end of source
//-----------------
/*-----------------
* end of source
*-----------------
*/

View File

@ -12,7 +12,7 @@
#define IDM_HELP_ABOUT 40008
// Next default values for new objects
//
//
#ifdef APSTUDIO_INVOKED
#ifndef APSTUDIO_READONLY_SYMBOLS
#define _APS_NEXT_RESOURCE_VALUE 113

View File

@ -2,15 +2,15 @@
#if 0 /* in case someone actually tries to compile this */
/* example.c - an example of using libpng
* Last changed in libpng 1.4.2 [May 6, 2010]
* Last changed in libpng 1.5.4 [July 7, 2011]
* This file has been placed in the public domain by the authors.
* Maintained 1998-2010 Glenn Randers-Pehrson
* Maintained 1998-2011 Glenn Randers-Pehrson
* Maintained 1996, 1997 Andreas Dilger)
* Written 1995, 1996 Guy Eric Schalnat, Group 42, Inc.)
*/
/* This is an example of how to use libpng to read and write PNG files.
* The file libpng.txt is much more verbose then this. If you have not
* The file libpng-manual.txt is much more verbose then this. If you have not
* read it, do so first. This was designed to be a starting point of an
* implementation. This is not officially part of libpng, is hereby placed
* in the public domain, and therefore does not require a copyright notice.
@ -22,6 +22,10 @@
* see also the programs in the contrib directory.
*/
#define _POSIX_SOURCE 1 /* libpng and zlib are POSIX-compliant. You may
* change this if your application uses non-POSIX
* extensions. */
#include "png.h"
/* The png_jmpbuf() macro, used in error handling, became available in
@ -31,7 +35,7 @@
*/
#ifndef png_jmpbuf
# define png_jmpbuf(png_ptr) ((png_ptr)->jmpbuf)
# define png_jmpbuf(png_ptr) ((png_ptr)->png_jmpbuf)
#endif
/* Check to see if a file is a PNG file using png_sig_cmp(). png_sig_cmp()
@ -183,8 +187,15 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
* are mutually exclusive.
*/
/* Tell libpng to strip 16 bit/color files down to 8 bits/color */
/* Tell libpng to strip 16 bit/color files down to 8 bits/color.
* Use accurate scaling if it's available, otherwise just chop off the
* low byte.
*/
#ifdef PNG_READ_SCALE_16_TO_8_SUPPORTED
png_set_scale_16(png_ptr);
#else
png_set_strip_16(png_ptr);
#endif
/* Strip alpha bytes from the input data without combining with the
* background (not recommended).
@ -286,7 +297,6 @@ void read_png(FILE *fp, unsigned int sig_read) /* File is already open */
/* An array of colors to which the image should be quantized */
png_color std_color_cube[MAX_SCREEN_COLORS];
/* Prior to libpng-1.4.2, this was png_set_dither(). */
png_set_quantize(png_ptr, std_color_cube, MAX_SCREEN_COLORS,
MAX_SCREEN_COLORS, NULL, 0);
}
@ -656,14 +666,18 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Optional significant bit (sBIT) chunk */
png_color_8 sig_bit;
/* If we are dealing with a grayscale image then */
sig_bit.gray = true_bit_depth;
/* Otherwise, if we are dealing with a color image then */
sig_bit.red = true_red_bit_depth;
sig_bit.green = true_green_bit_depth;
sig_bit.blue = true_blue_bit_depth;
/* If the image has an alpha channel then */
sig_bit.alpha = true_alpha_bit_depth;
png_set_sBIT(png_ptr, info_ptr, &sig_bit);
@ -676,20 +690,21 @@ void write_png(char *file_name /* , ... other image information ... */)
text_ptr[0].key = "Title";
text_ptr[0].text = "Mona Lisa";
text_ptr[0].compression = PNG_TEXT_COMPRESSION_NONE;
text_ptr[0].itxt_length = 0;
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
text_ptr[1].key = "Author";
text_ptr[1].text = "Leonardo DaVinci";
text_ptr[1].compression = PNG_TEXT_COMPRESSION_NONE;
text_ptr[1].itxt_length = 0;
text_ptr[1].lang = NULL;
text_ptr[1].lang_key = NULL;
text_ptr[2].key = "Description";
text_ptr[2].text = "<long text>";
text_ptr[2].compression = PNG_TEXT_COMPRESSION_zTXt;
#ifdef PNG_iTXt_SUPPORTED
text_ptr[0].lang = NULL;
text_ptr[0].lang_key = NULL;
text_ptr[1].lang = NULL;
text_ptr[1].lang_key = NULL;
text_ptr[2].itxt_length = 0;
text_ptr[2].lang = NULL;
text_ptr[2].lang_key = NULL;
#endif
png_set_text(png_ptr, info_ptr, text_ptr, 3);
/* Other optional chunks like cHRM, bKGD, tRNS, tIME, oFFs, pHYs */
@ -754,6 +769,7 @@ void write_png(char *file_name /* , ... other image information ... */)
/* Turn on interlace handling if you are not using png_write_image() */
if (interlacing)
number_passes = png_set_interlace_handling(png_ptr);
else
number_passes = 1;

View File

@ -104,8 +104,8 @@ while test $# -gt 0; do
;;
--ldopts)
echo ${ldopts}
;;
echo ${ldopts}
;;
--ldflags)
echo ${ldopts} ${L_opts} ${R_opts} ${libs}
@ -113,7 +113,7 @@ while test $# -gt 0; do
--static)
R_opts=""
libs=${all_libs}
libs=${all_libs}
;;
*)

File diff suppressed because it is too large Load Diff

View File

@ -1,806 +1,26 @@
.TH LIBPNGPF 3 "September 23, 2010"
.TH LIBPNGPF 3 "September 22, 2011"
.SH NAME
libpng \- Portable Network Graphics (PNG) Reference Library 1.4.4
libpng \- Portable Network Graphics (PNG) Reference Library 1.5.5
(private functions)
.SH SYNOPSIS
\fB#include <png.h>\fP
\fB#include \fI"pngpriv.h"
\fI\fB
\fBvoid png_64bit_product (long \fP\fIv1\fP\fB, long \fP\fIv2\fP\fB, unsigned long \fI*hi_product,
\fBAs of libpng version \fP\fI1.5.1\fP\fB, this section is no longer \fP\fImaintained\fP\fB, now \fIthat
\fBunsigned long \fI*lo_product\fP\fB);\fP
\fBthe private function prototypes are hidden in pngpriv.h and not \fIaccessible
\fI\fB
\fBto applications. Look in pngpriv.h for the prototypes and a short \fIdescription
\fBvoid png_build_gamma_table (png_structp \fP\fIpng_ptr\fP\fB, png_byte \fIbit_depth\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_build_grayscale_palette (int \fP\fIbit_depth\fP\fB, png_colorp \fIpalette\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_calculate_crc (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIptr\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_check_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_fixed_point \fP\fIint_white_x\fP\fB, png_fixed_point \fP\fIint_white_y\fP\fB, png_fixed_point \fP\fIint_red_x\fP\fB, png_fixed_point \fP\fIint_red_y\fP\fB, png_fixed_point \fP\fIint_green_x\fP\fB, png_fixed_point \fP\fIint_green_y\fP\fB, png_fixed_point \fP\fIint_blue_x\fP\fB, png_fixed_point \fIint_blue_y\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_check_chunk_name (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIchunk_name\fP\fB);\fP
\fI\fB
\fI\fB
\fBpng_size_t png_check_keyword (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charpp \fInew_key\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_check_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIinterlace_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fIfilter_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_combine_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fImask\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_correct_palette (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, int \fInum_palette\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_crc_error (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_crc_finish (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIskip\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_crc_read (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuf\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBpng_voidp png_create_struct (int \fItype\fP\fB);\fP
\fI\fB
\fI\fB
\fBpng_voidp png_create_struct_2 (int \fP\fItype\fP\fB, png_malloc_ptr \fP\fImalloc_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_debug(int \fP\fIlevel\fP\fB, png_const_charp \fImessage\fP\fB);\fP
\fI\fB
\fBint png_debug1(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fIp1\fP\fB);\fP
\fI\fB
\fBint png_debug2(int \fP\fIlevel\fP\fB, png_const_charp \fP\fImessage\fP\fB, \fP\fIp1\fP\fB, \fIp2\fP\fB);\fP
\fI\fB
\fBvoid png_decompress_chunk (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcomp_type\fP\fB, png_size_t \fP\fIchunklength\fP\fB, png_size_t \fP\fIprefix_length\fP\fB, png_size_t \fI*data_length\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_destroy_struct (png_voidp \fIstruct_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_destroy_struct_2 (png_voidp \fP\fIstruct_ptr\fP\fB, png_free_ptr \fP\fIfree_fn\fP\fB, png_voidp \fImem_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_background (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fP\fItrans_color\fP\fB, png_color_16p \fP\fIbackground\fP\fB, png_color_16p \fP\fIbackground_1\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_bytep \fP\fIgamma_from_1\fP\fB, png_bytep \fP\fIgamma_to_1\fP\fB, png_uint_16pp \fP\fIgamma_16\fP\fB, png_uint_16pp \fP\fIgamma_16_from_1\fP\fB, png_uint_16pp \fP\fIgamma_16_to_1\fP\fB, int \fIgamma_shift\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_bgr (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_chop (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fBvoid png_do_expand (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_16p \fItrans_value\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_expand_palette (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_bytep \fP\fItrans\fP\fB, int \fInum_trans\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_gamma (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIgamma_table\fP\fB, png_uint_16pp \fP\fIgamma_16_table\fP\fB, int \fIgamma_shift\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_gray_to_rgb (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_invert (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_pack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIbit_depth\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_packswap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_quantize (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIpalette_lookup\fP\fB, png_bytep \fIquantize_lookup\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_read_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fP\fIfiller\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_read_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fP\fIpass\fP\fB, png_uint_32 \fItransformations\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_read_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fBvoid png_do_read_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_do_rgb_to_gray (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_shift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIbit_depth\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_strip_filler (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_uint_32 \fIflags\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_swap (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_unpack (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_unshift (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_color_8p \fIsig_bits\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_write_interlace (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, int \fIpass\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_write_invert_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_write_swap_alpha (png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_do_write_transformations (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid *png_far_to_near (png_structp png_ptr,png_voidp \fP\fIptr\fP\fB, int \fIcheck\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_flush (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_bKGD (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_cHRM (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_gAMA (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_IEND (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_iTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_sRGB (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_info_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_init_mmx_flags (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_init_read_transformations (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_process_IDAT_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_process_some_data (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_check_crc (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_crc_finish (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_crc_skip (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_fill_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_handle_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_handle_unknown (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_handle_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_uint_32 \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_have_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_have_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_have_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIrow\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_process_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_chunk (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_end (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_IDAT (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_sig (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_read_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_restore_buffer (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIbuffer\fP\fB, png_size_t \fIbuffer_length\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_push_save_buffer (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_read_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fBvoid png_read_destroy (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_infop \fIend_info_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_read_filter_row (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fP\fIrow_info\fP\fB, png_bytep \fP\fIrow\fP\fB, png_bytep \fP\fIprev_row\fP\fB, int \fIfilter\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_read_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_read_push_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_read_start_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_read_transform_info (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fIinfo_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_reset_crc (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBint png_set_text_2 (png_structp \fP\fIpng_ptr\fP\fB, png_infop \fP\fIinfo_ptr\fP\fB, png_textp \fP\fItext_ptr\fP\fB, int \fInum_text\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_cHRM (png_structp \fP\fIpng_ptr\fP\fB, double \fP\fIwhite_x\fP\fB, double \fP\fIwhite_y\fP\fB, double \fP\fIred_x\fP\fB, double \fP\fIred_y\fP\fB, double \fP\fIgreen_x\fP\fB, double \fP\fIgreen_y\fP\fB, double \fP\fIblue_x\fP\fB, double \fIblue_y\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_cHRM_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwhite_x\fP\fB, png_uint_32 \fP\fIwhite_y\fP\fB, png_uint_32 \fP\fIred_x\fP\fB, png_uint_32 \fP\fIred_y\fP\fB, png_uint_32 \fP\fIgreen_x\fP\fB, png_uint_32 \fP\fIgreen_y\fP\fB, png_uint_32 \fP\fIblue_x\fP\fB, png_uint_32 \fIblue_y\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_data (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fBvoid png_write_destroy (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fBvoid png_write_filtered_row (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fIfiltered_row\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_find_filter (png_structp \fP\fIpng_ptr\fP\fB, png_row_infop \fIrow_info\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_finish_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_gAMA (png_structp \fP\fIpng_ptr\fP\fB, double \fIfile_gamma\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_gAMA_fixed (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fIint_file_gamma\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_hIST (png_structp \fP\fIpng_ptr\fP\fB, png_uint_16p \fP\fIhist\fP\fB, int \fInum_hist\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_iCCP (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIname\fP\fB, int \fP\fIcompression_type\fP\fB, png_charp \fP\fIprofile\fP\fB, int \fIproflen\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_IDAT (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fIdata\fP\fB, png_size_t \fIlength\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_IEND (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_IHDR (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIwidth\fP\fB, png_uint_32 \fP\fIheight\fP\fB, int \fP\fIbit_depth\fP\fB, int \fP\fIcolor_type\fP\fB, int \fP\fIcompression_type\fP\fB, int \fP\fIfilter_type\fP\fB, int \fIinterlace_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_iTXt (png_structp \fP\fIpng_ptr\fP\fB, int \fP\fIcompression\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fIlang\fP\fB, png_charp \fP\fItranslated_key\fP\fB, png_charp \fItext\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_oFFs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_offset\fP\fB, png_uint_32 \fP\fIy_offset\fP\fB, int \fIunit_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_pCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIpurpose\fP\fB, png_int_32 \fP\fIX0\fP\fB, png_int_32 \fP\fIX1\fP\fB, int \fP\fItype\fP\fB, int \fP\fInparams\fP\fB, png_charp \fP\fIunits\fP\fB, png_charpp \fIparams\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_pHYs (png_structp \fP\fIpng_ptr\fP\fB, png_uint_32 \fP\fIx_pixels_per_unit\fP\fB, png_uint_32 \fP\fIy_pixels_per_unit\fP\fB, int \fIunit_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_PLTE (png_structp \fP\fIpng_ptr\fP\fB, png_colorp \fP\fIpalette\fP\fB, png_uint_32 \fInum_pal\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_sBIT (png_structp \fP\fIpng_ptr\fP\fB, png_color_8p \fP\fIsbit\fP\fB, int \fIcolor_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_sCAL (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, double \fP\fIwidth\fP\fB, double \fIheight\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_sCAL_s (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIunit\fP\fB, png_charp \fP\fIwidth\fP\fB, png_charp \fIheight\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_sRGB (png_structp \fP\fIpng_ptr\fP\fB, int \fIintent\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_sPLT (png_structp \fP\fIpng_ptr\fP\fB, png_spalette_p \fIpalette\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_start_row (png_structp \fIpng_ptr\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_tEXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fItext_len\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_tIME (png_structp \fP\fIpng_ptr\fP\fB, png_timep \fImod_time\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_tRNS (png_structp \fP\fIpng_ptr\fP\fB, png_bytep \fP\fItrans\fP\fB, png_color_16p \fP\fIvalues\fP\fB, int \fP\fInumber\fP\fB, int \fIcolor_type\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_write_zTXt (png_structp \fP\fIpng_ptr\fP\fB, png_charp \fP\fIkey\fP\fB, png_charp \fP\fItext\fP\fB, png_size_t \fP\fItext_len\fP\fB, int \fIcompression\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoidpf png_zalloc (voidpf \fP\fIpng_ptr\fP\fB, uInt \fP\fIitems\fP\fB, uInt \fIsize\fP\fB);\fP
\fI\fB
\fI\fB
\fBvoid png_zfree (voidpf \fP\fIpng_ptr\fP\fB, voidpf \fIptr\fP\fB);\fP
\fI\fB
\fBof each \fIfunction.
\fI\fB
.SH DESCRIPTION
The functions listed above are used privately by libpng
The functions previously listed here are used privately by libpng
and are not recommended for use by applications. They are
not "exported" to applications using shared libraries. They
are listed alphabetically here as an aid to libpng maintainers.
See png.h for more information on these functions.
not "exported" to applications using shared libraries.
.SH SEE ALSO
.BR "png"(5), " libpng"(3), " zlib"(3), " deflate"(5), " " and " zlib"(5)

View File

@ -1,4 +1,4 @@
.TH PNG 5 "September 23, 2010"
.TH PNG 5 "September 22, 2011"
.SH NAME
png \- Portable Network Graphics (PNG) format
.SH DESCRIPTION

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

Some files were not shown because too many files have changed in this diff Show More