From Farshid Lashkari, "I've updated the dds, png, and jpeg plugins to support writing images with the GL_DEPTH_COMPONENT pixel format. They will simply treat it the same as the GL_LUMINANCE pixel format."
This commit is contained in:
@@ -1147,6 +1147,7 @@ bool WriteDDSFile(const osg::Image *img, std::ostream& fout, bool autoFlipDDSWri
|
||||
}
|
||||
break;
|
||||
case GL_LUMINANCE:
|
||||
case GL_DEPTH_COMPONENT:
|
||||
{
|
||||
ddpf.dwRBitMask = 0x000000ff;
|
||||
PF_flags |= DDPF_LUMINANCE;
|
||||
|
||||
@@ -665,6 +665,7 @@ class ReaderWriterJPEG : public osgDB::ReaderWriter
|
||||
int image_components = 3;
|
||||
// Only cater for gray, alpha and RGB for now
|
||||
switch(img.getPixelFormat()) {
|
||||
case(GL_DEPTH_COMPONENT):
|
||||
case(GL_LUMINANCE):
|
||||
case(GL_ALPHA): {
|
||||
image_color_space = JCS_GRAYSCALE;
|
||||
|
||||
@@ -114,6 +114,7 @@ class ReaderWriterPNG : public osgDB::ReaderWriter
|
||||
|
||||
int bit_depth = img.getPixelSizeInBits();
|
||||
switch(img.getPixelFormat()) {
|
||||
case(GL_DEPTH_COMPONENT): color = PNG_COLOR_TYPE_GRAY; break;
|
||||
case(GL_LUMINANCE): color = PNG_COLOR_TYPE_GRAY; break;
|
||||
case(GL_ALPHA): color = PNG_COLOR_TYPE_GRAY; break; //Couldn't find a color type for pure alpha, using gray instead
|
||||
case(GL_LUMINANCE_ALPHA): color = PNG_COLOR_TYPE_GRAY_ALPHA ; bit_depth /= 2; break;
|
||||
|
||||
Reference in New Issue
Block a user