Overview
Examples
Screenshots
Comparisons
Applications
Download
Documentation
Tutorials
Bazaar
Status & Roadmap
FAQ
Authors & License
Forums
Funding Ultimate++
Search on this site
Search in forums












SourceForge.net Logo
Home » Extra libraries, Code snippets, applications etc. » U++ users applications in progress and useful code snippets, including reference examples! » Drawing raw data to an Image / Draw object?
Re: Drawing raw data to an Image / Draw object? [message #18572 is a reply to message #18569] Thu, 09 October 2008 14:35 Go to previous message
mrjt is currently offline  mrjt
Messages: 705
Registered: March 2007
Location: London
Contributor
As far as I know there is no Image support for greater the 32-bit depths, since that is the effective limit of consumer display equipment.

But I believe your problem is that the conversion is wrong. I think it should be:
byte quantumToByte(m::Quantum q)
{
    // Equivalent to: 
    // return (q * 255) / 65535);
    // or
    // return iscale(q, 255, 65535)
    return (q  >> 8);
}

For correctness I believe you should replace the 8 with '(QuantumDepth - 8 )', but that's really just a guess from the ducumentation.

Alternatively you can #define QuantumDepth to 8 yourself to tell the library to use 32-bit and avoid the conversion. If you're only planning on drawing to the screen this seems like a wise move to also reduce memory consumption.

 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Trouble iterrating over VectorMap<String, String> - general StoreIniFile
Next Topic: DirectoryUp doesn't seem to work.
Goto Forum:
  


Current Time: Tue May 14 18:26:14 CEST 2024

Total time taken to generate the page: 0.01508 seconds