get region of interest in fast way

Questions and postings pertaining to the usage of ImageMagick regardless of the interface. This includes the command-line utilities, as well as the C and C++ APIs. Usage questions are like "How do I use ImageMagick to create drop shadows?".
Post Reply
nicolas1

get region of interest in fast way

Post by nicolas1 »

Hello,

I am new to imagemagick, much api.

How is it possible to get region of interest (defined as, for example, src_left, src_top, src_right, src_bottom) from source image to destination buffer (imagemagick buffer?) (defined as dst_width, dst_height) in format which can be passed to display device (for example, 24 bit BGR) with ability to control subsampling algorithm in the fastest way (no need to save buffer to file)? Is it possible to re-use output buffer (to avoid allocation of same-sized buffer)? This routine intended to be used during custom image rendering with transaformation. (C++)

Final goal is to display several images (and some other own graphics) in one window (refered as device context) with ability, for example, to rotate images (not to rotate whole source buffers).

Thanks.
User avatar
fmw42
Posts: 25562
Joined: 2007-07-02T17:14:51-07:00
Authentication code: 1152
Location: Sunnyvale, California, USA

Re: get region of interest in fast way

Post by fmw42 »

I am not quite sure what you are trying to do, but IM display function in command line mode has the ability to rotate, crop, and other transformations.

If you want to look at multiple images, you can display them alternately with a delay in a script by Anthony Thyssen called flicker_cmp (it is a blink comparitor)
nicolas1

Re: get region of interest in fast way

Post by nicolas1 »

Goal is to use imagemagick in some kind of vector display program. There are some types of drawables (line, image..). Drawables overlay each other.
I need to overlay several images in defined order and display them in the same time (one over other). No need in slide-show.

IM display's rotate command allocates new buffer of size equals to boundaries of transformed source image dimensions and recalculates whole source image buffer to it. This is not what I need.

Partially found what I need.

This is the sequence of calls:
1) "TransformImage"
2) "AcquireImagePixels"

What sub-sampling algorithm is used during scaling in "TransformImage" function? Possible to control this option?
Post Reply