~ubuntu-branches/ubuntu/trusty/openscenegraph/trusty

« back to all changes in this revision

Viewing changes to OpenSceneGraph/src/osgPlugins/jp2/ReaderWriterJP2.cpp

  • Committer: Bazaar Package Importer
  • Author(s): Cyril Brulebois
  • Date: 2008-07-29 04:34:38 UTC
  • mfrom: (1.1.6 upstream) (2.1.3 lenny)
  • Revision ID: james.westby@ubuntu.com-20080729043438-no1h9h0dpsrlzp1y
* Non-maintainer upload.
* No longer try to detect (using /proc/cpuinfo when available) how many
  CPUs are available, fixing the FTBFS (due to -j0) on various platforms
  (Closes: #477353). The right way to do it is to support parallel=n in
  DEB_BUILD_OPTIONS (see Debian Policy §4.9.1), and adequate support has
  been implemented.
* Add patch to fix FTBFS due to the build system now refusing to handle
  whitespaces (Policy CMP0004 say the logs), thanks to Andreas Putzo who
  provided it (Closes: #482239):
   - debian/patches/fix-cmp0004-build-failure.dpatch
* Remove myself from Uploaders, as requested a while ago, done by Luk in
  his 2.2.0-2.1 NMU, which was never acknowledged.

Show diffs side-by-side

added added

removed removed

Lines of Context:
170
170
class ReaderWriterJP2 : public osgDB::ReaderWriter
171
171
{
172
172
    public:
 
173
 
 
174
 
 
175
        ReaderWriterJP2()
 
176
        {
 
177
            // little dance here to get around warnings created by jas_image_strtofmt use of char* rather than const char*
 
178
            // as a parameted and modern compilers deprecating "jp2" string being treated as char*.
 
179
            char* jp2 = strdup("jp2");
 
180
            _fmt_jp2 = jas_image_strtofmt(jp2);
 
181
            free(jp2);
 
182
        }
 
183
 
173
184
        virtual const char* className() const { return "RGB Image Reader/Writer"; }
174
185
        
175
186
        virtual bool acceptsExtension(const std::string& extension) const
411
422
                opt = new char[options->getOptionString().size() + 1];
412
423
                strcpy(opt, options->getOptionString().c_str());
413
424
            }
414
 
            jas_image_encode(jimage, out, jas_image_strtofmt("jp2"),  opt);
 
425
            jas_image_encode(jimage, out, _fmt_jp2,  opt);
415
426
            if(opt) delete[] opt;
416
427
 
417
428
            jas_stream_flush(out);
491
502
                opt = new char[options->getOptionString().size() + 1];
492
503
                strcpy(opt, options->getOptionString().c_str());
493
504
            }
494
 
            jas_image_encode(jimage, out, jas_image_strtofmt("jp2"),  opt);
 
505
            
 
506
            jas_image_encode(jimage, out, _fmt_jp2,  opt);
495
507
            if(opt) delete[] opt;
496
508
 
497
509
            jas_stream_flush(out);
511
523
            return WriteResult::FILE_SAVED;
512
524
        }
513
525
 
 
526
 
 
527
        int _fmt_jp2;
514
528
};
515
529
 
516
530
// now register with Registry to instantiate the above