comp.lang.ada
 help / color / mirror / Atom feed
From: Austin Obyrne <austin.obyrne@hotmail.com>
Subject: Re: Question: re Image Files.
Date: Fri, 31 Aug 2012 01:58:04 -0700 (PDT)
Date: 2012-08-31T01:58:04-07:00	[thread overview]
Message-ID: <a6792644-8e33-456d-a95c-e3e9bdc35e61@googlegroups.com> (raw)
In-Reply-To: <50406532$0$10734$5b6aafb4@news.zen.co.uk>

On Friday, August 31, 2012 8:18:11 AM UTC+1, Mark Murray wrote:
> On 30/08/2012 23:33, Austin Obyrne wrote: > Question: Is there any way by which I can reading in from an image file and operate on the individual pixels in a similar arithmetical way. Yes, but you have to handle each individual image format (GIF, JPEG, BMP etc) separately. This is a LOT of work to write a general program. Either pick one type that you are going to use, or look at what you are really doing and see if ther is not a way to generalise. > If not how are image files handled in Ada is there any transformation process? Would I be correct in guessing that you are planning in reading these files with the intention of encrypting the contents? If so, then you can save yourself a MASSIVE amount of work by ignoring the structure of the files, and simply reading them byte-by-byte. That way you get a stream of numbers, all in the range 0-255, and as long as the decryption process returns the numbers to exactly what the original number was without missing or adding any, you can encrypt any file you like. There is demo code to do this here: http://people.freebsd.org/~markm/raw_io.adb (Disclaimer: I've not been using Ada for long; this program is likely not particularly idiomatic use of the language; suggestions for improvement gratefully accepted). M -- Mark "No Nickname" Murray Notable nebbish, extreme generalist.

<If so, then you can save yourself a MASSIVE amount of work by ignoring 
<the structure of the files, and simply reading them byte-by-byte. That 
<way you get a stream of numbers, all in the range 0-255, and as long 
<as the decryption process returns the numbers to exactly what the 
<original number was without missing or adding any, you can encrypt any 
<file you like. 

That is precisely what I want to do - I have no other interest in the image file apart from using the alpha + pixels dat as the operands of encryption transformations.

Can I do explicitly and print out the bytes as they are read in with this link ?

Many thanks - adacrypt




  reply	other threads:[~2012-08-31  8:58 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-30 22:33 Question: re Image Files Austin Obyrne
2012-08-30 22:55 ` Adam Beneschan
2012-08-31  1:35 ` tmoran
2012-08-31  7:16 ` Dmitry A. Kazakov
2012-08-31  7:18 ` Mark Murray
2012-08-31  8:58   ` Austin Obyrne [this message]
2012-08-31  9:25     ` Ludovic Brenta
2012-08-31  9:41       ` Dmitry A. Kazakov
2012-08-31  9:14   ` Austin Obyrne
2012-08-31 17:09     ` Mark Murray
2012-08-31 17:36       ` Austin Obyrne
2012-08-31 22:09         ` Shark8
2012-09-04 10:05         ` Antti Louko
2012-08-31 21:12   ` gautier_niouzes
2012-09-01  6:58     ` Austin Obyrne
2012-09-03  6:02   ` Anatoly Chernyshev
2012-09-03  7:27     ` Mark Murray
2012-08-31  8:41 ` Brian Drummond
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox