• Welcome to Vampyre Imaging Library Forum. Please login or sign up.
 

converting TImgaingBitmap to CMBitmap

Started by jus2, 8 June 2011, 12:07:26

Previous topic - Next topic

jus2

8 June 2011, 12:07:26 Last Edit: 28 July 2011, 15:19:34 by Galfar
Hi,

  I'm using Lazarus (Mac OSX) and the Vampyre library. I'm trying to find out how to use the colorsync for color conversion with icc profiles.  :'( The mac colorsync API function "CWMatchBitmap" needs CMBitmap. Does Vampyre provides a function for converting TImagingBitmap/TImageData to CMBitmap? if not how can do the conversion to CMBitmap?

The structure/record of CMBitmap is definded in Lazarus as following:
Code (pascal) Select

CMBitmap = record
image: CStringPtr;
width: size_t;
height: size_t;
rowBytes: size_t;
pixelSize: size_t;
space: CMBitmapColorSpace;
user1: UInt32;
user2: UInt32;


Thanks!  :)

jus 

 

Galfar

Hi, it should be quite easy to convert TImageData to CMBitmap:

CMBitmap.image is TImageData.Bits
Width and Height is easy
CMBitmap.pixelSize is 8 * Fmt.BytesPerPixel (use GetImageFormatInfo function to get this)
CMBitmap.rowBytes is Width * CMBitmap.pixelSize

Then you need to set CmBitmap.space according to TImageData.Format,
mostly cmRGB24Space or cmRGBA32Space is used.


jus

Hi Galfar,

  thank you so much for the prompt reply. I'll try to implement.  :)

Best regards,
jus

Quick Reply

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Name:
Email:

Shortcuts: ALT+S save/post or ALT+P preview

SMF spam blocked by CleanTalk