Click here to Skip to main content
6,306,412 members and growing! (20,260 online)
Email Password   helpLost your password?
Multimedia » General Graphics » General     Intermediate

Classes to read and write BMP, JPEG and JPEG 2000

By Tony Lin

Classes to read and write BMP, JPEG and JPEG 2000
VC6Win2K, WinXP, MFC, Dev
Posted:1 Feb 2003
Views:239,342
Bookmarked:60 times
Announcements
Loading...
 
Search    
Advanced Search
printPrint   Broken Article?Report       add Share
  Discuss Discuss   Recommend Article Email
51 votes for this article.
Popularity: 6.95 Rating: 4.07 out of 5
3 votes, 5.9%
1
2 votes, 3.9%
2
4 votes, 7.8%
3
8 votes, 15.7%
4
34 votes, 66.7%
5

Introduction

This sample is an MFC application using the document/view architecture that can load, display and transcode files such as BMP (bitmap), JPEG, JPP (my private format using jpeg algorithm but with fewer overheads), jpc (jpeg 2000 code stream) and jp2 (jpeg 2000 format). It shows:

  1. Two classes, CMiniJpegEncoder and CMiniJpegDecoder, to support .jpp format. JPP is my private format using jpeg algorithm but with few overheads. These two classes are made in 2001 for one application that compress, transmit, and decompress PC screen image. Someone might ask, we have a jpeg format, so what is the JPP format for? The answer is, the jpeg format is a little complex and may have a 600-byte fileheader. So I made a 6-byte header format called .jpp. Also, no FF markers are needed for .jpp. With simple format of .jpp, you could clearly watch the jpeg algorithm, that would be useful to someone learning jpeg.
  2. Two classes, CTonyJpegEncoder and CTonyJpegDecoder, to support baseline jpeg format. I have no time to support other formats such as progressive + Huffman coding. It works for almost jpeg files, just with one-thousand-line codes! But if you want powerful functionality, please use IJG code. In this demo, you could choose the jpeg codec.
  3. To show the capability of JPEG-2000, by Jasper implementation.

Contact

If you have any question, or any comments, please contact me: lintong@cis.pku.edu.cn.

History

  • 1 Feb, 2003 - First revision.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here

About the Author

Tony Lin


Member
Dr. Tony Lin, received his PhD degree from Peking University, Beijing, China, in 2001. His interests are in Pattern Recognition, Wavelets, and Programming.
Occupation: Web Developer
Location: China China

Other popular General Graphics articles:

  • A flexible charting library for .NET
    Looking for a way to draw 2D line graphs with C#? Here's yet another charting class library with a high degree of configurability, that is also easy to use.
  • CxImage
    CxImage is a C++ class to load, save, display, transform BMP, JPEG, GIF, PNG, TIFF, MNG, ICO, PCX, TGA, WMF, WBMP, JBG, J2K images.
  • 3D Pie Chart
    A class library for drawing 3D pie charts.
  • Really cool visual FX
    A set of classes for doing stunning visual effects, including water, plasma and fire.
  • ImageStone
    An article on a library for image manipulation.
Article Top
You must Sign In to use this message board.
FAQ FAQ 
 
Noise Tolerance  Layout  Per page   
 Msgs 1 to 25 of 68 (Total in Forum: 68) (Refresh)FirstPrevNext
GeneralHow to run the program Pinmemberfayefu17:01 26 Jun '09  
Generalthank you Pinmemberfuturejo20:32 5 Jan '09  
GeneralGreat Code, Crap Article! PinmemberSteve_pqr1:35 24 Nov '08  
GeneralSimply Incredible Pinmembersoftware_chotmail1:09 27 Sep '08  
GeneralHow to run the program PinmemberMember 46578056:48 29 May '08  
GeneralJpg decoder PinmemberNIkhilesh Reddy2:22 15 Apr '08  
GeneralThe Lib fails to decode some images PinmemberSilvio Reis Jr2:17 24 Jan '08  
QuestionImageTranscode Pinmemberdejavu21:31 13 Dec '07  
Questionhow to reduce memory usage while loading background image in MFC Application? PinmemberKhathar21:45 8 Aug '07  
GeneralBad quality on Jpeg image Pinmemberdavidlks23:35 11 Jul '07  
Questiontroubles with CminiJpegEncoder/decoder Pinmemberpatkarbo9:41 20 Jun '07  
Generaljpeg progressive Pinmemberedatul muliana22:06 20 May '07  
GeneralMotion PinmemberMrPMorris6:49 6 Mar '07  
GeneralFixed marker problem PinmemberLukeMulder3:30 2 Oct '06  
General16 bits color cannot encoder Pinmembermba61:35 6 Sep '06  
Generalcontrast tiff PinmemberHoangManh17:08 3 Jun '06  
GeneralImageTranscode PinmemberAdi DEDIC1:02 23 May '06  
GeneralNeed JPEG Decoder Pinmemberkiran_siva20:00 13 Mar '06  
GeneralRe: Need JPEG Decoder PinmemberBilloKhan21:38 22 Apr '06  
GeneralCTonyJpegDecoder has a bug: does not work with pictures that have non-even dimensions! Pinmemberherculon3:29 27 Jan '06  
GeneralDemo app encodes 24bpp BMPs only PinmemberVYu21:41 25 Dec '05  
Questionbmp Pinmemberbbiondo0:58 30 Aug '05  
Generalhow about 24-bits CPU PinmemberMike033112:49 3 Jul '05  
GeneralExcellent article PinmemberDuncan1234522:43 15 Feb '05  
Generalj2kdemo PinmemberImageResearcher0:41 31 Jul '04  

General General    News News    Question Question    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

PermaLink | Privacy | Terms of Use
Last Updated: 1 Feb 2003
Editor: Barry Lapthorn
Copyright 2003 by Tony Lin
Everything else Copyright © CodeProject, 1999-2009
Web11 | Advertise on the Code Project