53 lines
1.4 KiB
C++
53 lines
1.4 KiB
C++
/**
|
|
* @file llimagej2cnv.cpp
|
|
* @brief This is an implementation of JPEG2000 encode/decode using nvJPEG2000.
|
|
*/
|
|
|
|
#include "linden_common.h"
|
|
#include "llimagej2cnv.h"
|
|
|
|
#include <cuda_runtime_api.h>
|
|
#include <nvjpeg2k.h>
|
|
|
|
// Factory function: see declaration in llimagej2c.cpp
|
|
LLImageJ2CImpl* fallbackCreateLLImageJ2CImpl() {
|
|
return new LLImageJ2CNV();
|
|
}
|
|
|
|
std::string LLImageJ2CNV::getEngineInfo() const {
|
|
cudaDeviceProp props;
|
|
int dev = 0;
|
|
cudaGetDevice(&dev);
|
|
cudaGetDeviceProperties(&props, dev);
|
|
return llformat("nvJPEG2000, GPU: %s, CC: %i.%i", props.name, props.major, props.minor);
|
|
}
|
|
|
|
LLImageJ2CNV::LLImageJ2CNV() : LLImageJ2CImpl() {}
|
|
|
|
LLImageJ2CNV::~LLImageJ2CNV() {}
|
|
|
|
bool LLImageJ2CNV::initEncode(LLImageJ2C &base, LLImageRaw &raw_image, int blocks_size = -1, int precincts_size = -1, int levels = 0) {
|
|
// TODO: impl
|
|
return false;
|
|
}
|
|
|
|
bool LLImageJ2CNV::initDecode(LLImageJ2C &base, LLImageRaw &raw_image, int discard_level = -1, int* region = NULL) {
|
|
// TODO: impl
|
|
return false;
|
|
}
|
|
|
|
bool LLImageJ2CNV::encodeImpl(LLImageJ2C &base, const LLImageRaw &raw_image, const char* comment_text, F32 encode_time=0.0, bool reversible = false) {
|
|
// TODO: impl
|
|
return false;
|
|
}
|
|
|
|
bool LLImageJ2CNV::decodeImpl(LLImageJ2C &base, LLImageRaw &raw_image, F32 decode_time, S32 first_channel, S32 max_channel_count) {
|
|
// TODO: impl
|
|
return false;
|
|
}
|
|
|
|
bool LLImageJ2CNV::getMetadata(LLImageJ2C &base) {
|
|
// TODO: impl
|
|
return false;
|
|
}
|