Hello Thomas,
if you are working with the raw image pixel data, the most convenient way to
do contrast and brightness transformations on the data is through a lookup
table. Filling a LUT for a specific contrast and brightness is a simple
calculation ("C" code sample):
UINT8 Lut[256];
// fContrast - range [0.0-1.0], 1.0 = "normal"
// fBrightness - range [0.0-1.0], 1.0 = "normal"
for(int i = 0; i < 256; i++) {
IEEE4 v = (i - 127.5f) * fContrast + 127.5f + (fBrightness -
1.0f) *
255.0f;
Lut[i] = MAX(0, MIN(v, 255));
}
Then use your RGB pixel component values as indices into the lookup table to
determine the final pixel component values.
If you are using Java there are some useful things in the various imaging
APIs to do this sort of thing (hopefully platform optimised).
FYI the next major C/C++/ActiveX SDK updates, along with Image Web Server
1.8, include support for lookup tables and histograms.
regards
--
Simon
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
^^^^^^^^
Simon Cope, : e-mail:
[EMAIL PROTECTED]
Chief Software Architect : WWW:
http://www.ermapper.com
: Int'l Phone: +61 8 9388 2900
Earth Resource Mapping Pty Ltd, : Int'l Fax: +61 8 9388 2901
Level 2, 87 Colin St, West Perth. : Australia Phone: (08) 9388 2900
Western Australia 6005 : Australia Fax: (08) 9388 2901
Q: 1.2TB (1,200GB) Image over the Internet?
A: Image Web Server!
http://www.earthetc.com
> -----Original Message-----
> From: [EMAIL PROTECTED]
> [mailto:ermapper-l-owner@;ermapper.com]On Behalf Of Thomas M. Andersen
> Sent: Friday, 8 November 2002 10:58 PM
> To: [EMAIL PROTECTED]
> Subject: ECW and Java
>
>
> Hi,
>
> I'm looking at a project where ecwsdk is used widely. Before I go any
> further I'm trying to find out how easy it would be to manipulate
> ECW-images. First of all I need to tone down images (make them brighter)
> on the fly. Does anyone have a recipe for that?
>
> Thanks in advance.
>
> Best regards,
> Thomas M. Andersen
>
> -----------------------------------------------------------
>
> To make changes to your subscription, please visit our website,
> http://www.ermapper.com/technicl/ermapperl/index.htm
>
>
-----------------------------------------------------------
To make changes to your subscription, please visit our website,
http://www.ermapper.com/technicl/ermapperl/index.htm