Git Product home page Git Product logo

toojpeg's People

Contributors

stbrumme avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toojpeg's Issues

How to use it in class.

How to do it if I want to write it in class variable? There is conflict with class member and WRITE_ONE_BYTE.

[Suggestio] Add CMake support

It would be nice to add a CMakeLists to the library in order to simplify the use of this lib with bigger projects.

Confused with usage with my input image

Hello,
Please I need to use your repo and use lena.PNG as input image, so I read the image in this way, but this not correct how can read the image in correct way?

ifstream im;
im.open("lena.PNG",std::ios_base::binary);
if (im.is_open())
{
cout<< "function success\n";
}
else
{
cout<< "unable to open file";
}
//get length of file:
im.seekg(0, im.end);
int n = im.tellg();
im.seekg (0, im.beg);
//allocate memory:
///char* image = new char[n];
const auto width  = 512;
const auto height = 512;
  // RGB: one byte each for red, green, blue
const auto bytesPerPixel = 3;
  // allocate memory
  auto image = new  char[width * height * bytesPerPixel];
//read data as a block:
im.read( (image), n);

Structure to represent colors

why not use some thing like

struct color_rgb {
    uint8_t r, g, b;
};

It would ease effort, as algorithms like std::fill and std::generate can be used.

Writer is fine, missing reader ?

I found your library searching for in memory compression/decompression.
But toojpeg only supports writing the image, not the other way round.
Is there any plan to add the read method to the library ?

Line by line

Feature idea: allowing the image to be written line by line, so we don't need to allocate a large chunk of memory first.

Reversing the process or just reconstruct the RGB from the compressed data?

Thanks for the project. I like its cleanliness.
Is there a way to reverse the result from TooJpeg::writeJpeg?
E.g.

char org = [100*100*3];  //The input raw image
...
std::vector<char> enc;
//fputc() is the set byte function set to enc
...
auto ok = TooJpeg::writeJpeg(fputc, org, 100, 100, true, 95, true);
...
char recon = [100*100*3]; //The reconstructed image
TooJpeg::readJpeg(enc, ...) //???

Confused with usage

I'm not that literate with c++.

Would you be able to supply a sample program showing how to save a simple file? I would like to use your library.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.