Click here to Skip to main content
11,480,626 members (64,974 online)
Click here to Skip to main content

Classes to read and write BMP, JPEG and JPEG 2000

, 1 Feb 2003 474.9K 19.9K 88
Rate this:
Please Sign up or sign in to vote.
Classes to read and write BMP, JPEG and JPEG 2000
<!-- Download Links --> <!-- Add the rest of your HTML here -->

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

Share

About the Author

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

Comments and Discussions

 
Question你能发给我一份技术规范文档吗 Pin
surenyufu14-May-13 15:59
membersurenyufu14-May-13 15:59 
QuestionHow to build the program ? Pin
vhmau31-Aug-12 0:32
membervhmau31-Aug-12 0:32 
AnswerRe: How to build the program ? Pin
surenyufu12-May-13 0:24
membersurenyufu12-May-13 0:24 
GeneralMy vote of 5 Pin
hoummass10-Mar-11 13:20
memberhoummass10-Mar-11 13:20 
QuestionWhere "J2kDll.dll" comes from? Pin
ZexinDing15-Sep-09 18:30
memberZexinDing15-Sep-09 18:30 
QuestionHow to run the program Pin
fayefu26-Jun-09 17:01
memberfayefu26-Jun-09 17:01 
Generalthank you Pin
futurejo5-Jan-09 20:32
memberfuturejo5-Jan-09 20:32 
GeneralGreat Code, Crap Article! Pin
Steve_pqr24-Nov-08 1:35
memberSteve_pqr24-Nov-08 1:35 
GeneralSimply Incredible Pin
software_chotmail27-Sep-08 1:09
membersoftware_chotmail27-Sep-08 1:09 
QuestionHow to run the program Pin
Member 465780529-May-08 6:48
memberMember 465780529-May-08 6:48 
GeneralJpg decoder Pin
NIkhilesh Reddy15-Apr-08 2:22
memberNIkhilesh Reddy15-Apr-08 2:22 
GeneralThe Lib fails to decode some images Pin
Silvio Reis Jr24-Jan-08 2:17
memberSilvio Reis Jr24-Jan-08 2:17 
QuestionImageTranscode Pin
dejavu13-Dec-07 21:31
memberdejavu13-Dec-07 21:31 
Questionhow to reduce memory usage while loading background image in MFC Application? Pin
Khathar8-Aug-07 21:45
memberKhathar8-Aug-07 21:45 
GeneralBad quality on Jpeg image Pin
davidlks11-Jul-07 23:35
memberdavidlks11-Jul-07 23:35 
Questiontroubles with CminiJpegEncoder/decoder Pin
patkarbo20-Jun-07 9:41
memberpatkarbo20-Jun-07 9:41 
Generaljpeg progressive Pin
edatul muliana20-May-07 22:06
memberedatul muliana20-May-07 22:06 
GeneralMotion Pin
MrPMorris6-Mar-07 6:49
memberMrPMorris6-Mar-07 6:49 
GeneralFixed marker problem Pin
LukeMulder2-Oct-06 3:30
memberLukeMulder2-Oct-06 3:30 
General16 bits color cannot encoder Pin
mba66-Sep-06 1:35
membermba66-Sep-06 1:35 
Generalcontrast tiff Pin
HoangManh3-Jun-06 17:08
memberHoangManh3-Jun-06 17:08 
GeneralImageTranscode Pin
Adi DEDIC23-May-06 1:02
memberAdi DEDIC23-May-06 1:02 
GeneralNeed JPEG Decoder Pin
kiran_siva13-Mar-06 20:00
memberkiran_siva13-Mar-06 20:00 
GeneralRe: Need JPEG Decoder Pin
BilloKhan22-Apr-06 21:38
memberBilloKhan22-Apr-06 21:38 
GeneralCTonyJpegDecoder has a bug: does not work with pictures that have non-even dimensions! Pin
herculon27-Jan-06 3:29
memberherculon27-Jan-06 3:29 
GeneralDemo app encodes 24bpp BMPs only Pin
VYu25-Dec-05 21:41
memberVYu25-Dec-05 21:41 
Questionbmp Pin
bbiondo30-Aug-05 0:58
memberbbiondo30-Aug-05 0:58 
Questionhow about 24-bits CPU Pin
Mike03313-Jul-05 12:49
memberMike03313-Jul-05 12:49 
GeneralExcellent article Pin
Duncan1234515-Feb-05 22:43
memberDuncan1234515-Feb-05 22:43 
Generalj2kdemo Pin
ImageResearcher31-Jul-04 0:41
memberImageResearcher31-Jul-04 0:41 
GeneralAbout DCT coefficient Pin
Black:R31-Mar-04 2:16
memberBlack:R31-Mar-04 2:16 
Generalnice code Pin
lonic22-Feb-04 20:15
memberlonic22-Feb-04 20:15 
GeneralFile name error in ImageTranscode API Pin
edwm20-Feb-04 18:55
memberedwm20-Feb-04 18:55 
GeneralAA&amp;N Pin
ptgeorge10-Jan-04 8:26
memberptgeorge10-Jan-04 8:26 
GeneralJpeg 2000 Pin
Debasish Nath6-Jan-04 2:52
memberDebasish Nath6-Jan-04 2:52 
GeneralRe: Jpeg 2000 Pin
Anonymous22-Sep-05 1:54
sussAnonymous22-Sep-05 1:54 
GeneralJPEG2000 Pin
ligs200111-Nov-03 19:22
memberligs200111-Nov-03 19:22 
GeneralRe: JPEG2000 Pin
edwm19-Feb-04 17:34
memberedwm19-Feb-04 17:34 
Questionjpeg2000? Pin
nicebruce4-Oct-03 18:17
membernicebruce4-Oct-03 18:17 
AnswerRe: jpeg2000? Pin
Tony Lin6-Oct-03 4:04
memberTony Lin6-Oct-03 4:04 
GeneralRe: jpeg2000? Pin
nicebruce8-Oct-03 17:16
membernicebruce8-Oct-03 17:16 
QuestionHow to skip the error JPEG frame? Pin
James.Newman3-Aug-03 16:17
memberJames.Newman3-Aug-03 16:17 
GeneralJPEG2000 decoding in memory Pin
otbfm26-Jun-03 5:21
sussotbfm26-Jun-03 5:21 
GeneralRe: JPEG2000 decoding in memory Pin
Tony Lin26-Jun-03 21:21
memberTony Lin26-Jun-03 21:21 
GeneralJpeg-2000 Pin
Yuli Kaplunovsky20-Jun-03 0:16
sussYuli Kaplunovsky20-Jun-03 0:16 
GeneralRe: Jpeg-2000 Pin
Tony Lin20-Jun-03 19:48
memberTony Lin20-Jun-03 19:48 
GeneralA question Pin
JaneQian5-Jun-03 18:59
memberJaneQian5-Jun-03 18:59 
GeneralA question. Pin
JaneQian5-Jun-03 18:43
memberJaneQian5-Jun-03 18:43 
Generalthe quality of the out put jpeg file is poor Pin
Heway5-Jun-03 3:43
memberHeway5-Jun-03 3:43 
GeneralRe: the quality of the out put jpeg file is poor Pin
Tony Lin20-Jun-03 19:43
memberTony Lin20-Jun-03 19:43 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

| Advertise | Privacy | Terms of Use | Mobile
Web03 | 2.8.150520.1 | Last Updated 2 Feb 2003
Article Copyright 2003 by Tony Lin
Everything else Copyright © CodeProject, 1999-2015
Layout: fixed | fluid