0

so im writing some video/image editing software and im stumped... not about the code so much cuz what im doing works fine .. im not convinced it is the most efficient use of my computer but it works.

first my code...

#include <iostream>
#include <fstream>

using namespace std;
                         
int main()
{
     fstream obj ("sample.jpg", ios::in | ios::binary);
     fstream obj2("sample2.jpg, ios::out | ios::binary);
     int x, length;
     obj.seekg(0, ios::end);
     length = obj.tellg();
     char array[length];

      obj.seekg(0, ios::beg);
      while(!obj.eof())
      {

          array[x] = obj.get();
          obj2.put(array[x]);          
          x++;

       };

    obj.close();
    obj2.close();
}

okay so my question is im not sure how jpg's or .mov's any image or movie extension is packed a way... i realize that it is a combination of 3 bytes.... so for black 3 characters would all have ffffff..


my question is where do i go to learn how these bits are packed away so i can manipulate them... any standard that would be published... (preferrably something simple but unlikely)

thank you

Edited by therstonsplace: im retarded

2
Contributors
1
Reply
2
Views
7 Years
Discussion Span
Last Post by NicAx64
This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.