ImageEn for Delphi and C++ Builder ImageEn for Delphi and C++ Builder

 

ImageEn Forum
Profile    Join    Active Topics    Forum FAQ    Search this forumSearch
 All Forums
 ImageEn Library for Delphi, C++ and .Net
 ImageEn and IEvolution Support Forum
 fragmented memory

Note: You must be registered in order to post a reply.
To register, click here. Registration is FREE!

View 
UserName:
Password:
Format  Bold Italicized Underline  Align Left Centered Align Right  Horizontal Rule  Insert Hyperlink   Browse for an image to attach to your post Browse for a zip to attach to your post Insert Code  Insert Quote Insert List
   
Message 

 

Emoji
Smile [:)] Big Smile [:D] Cool [8D] Blush [:I]
Tongue [:P] Evil [):] Wink [;)] Black Eye [B)]
Frown [:(] Shocked [:0] Angry [:(!] Sleepy [|)]
Kisses [:X] Approve [^] Disapprove [V] Question [?]

 
Check here to subscribe to this topic.
   

T O P I C    R E V I E W
davenovo Posted - Jan 18 2014 : 15:39:52
Is there a way to ensure that ieMemory will store all the picture data as a single block all the time. The reason being I am going to be passing the memory block to other DLLS for processing and these DLLS need the memory to be in a contiguous block. I know I can go through the scanlines and copy them to a contiguous block, but I would rather just have imageEn keep it contiguous.
2   L A T E S T    R E P L I E S    (Newest First)
davenovo Posted - Jan 30 2014 : 14:25:41
Hi Nigel,

It seems there are some options there, i.e. IEGlobalSettings().AutoFragmentBitmap and it does seem like it at least TIEBitmap.AllocateImage tries to allocate a while block first and only does fragments if that fails.

Are you sure that there is no way to do this. Looking further, it seems allocating as a block is the default behavior.
quantuz Posted - Jan 28 2014 : 15:31:01
Hi!

I have had the same problem needed all data in the same memory block, and Fabrizio had a solution for us som yease ago, sending a copy of what Fabrizio replied

--------------------------------------------------
Let me analyze with attention every email I received (from you and from Christer) about this problem, so pardon me if it will take some time.
First of all, I see:

TRGB48 * ie48ptr =
(TRGB48*)bitmap->iEBitmapPtr_->ScanLine[bitmap->height_-1];
TRGB48 val48;
for (y=0; y<bitmap->height_; y++)
for (x=0; x<bitmap->width_; x++)
val48 = ie48ptr[y*bitmap->stepBytes_/6+x]; //CG protest here
}

that code supposes that Scanline[height-1] returns a continuous block of memory: it is not always true!
If there isn't enough continue free space, ImageEn will allocate the image in chunks.

To avoid this behavior, I have to introduce another public field (like the other iegAutoLocateOnDisk), which disables this "feature". This time it is named "iegAutoFragmentBitmap".
So, for your necessities you have to set:

iegAutoFragmentBitmap = false;
iegAutoLocateOnDisk = false;

That must be done before allocate or use TIEBitmap objects.

Please accept my apologies if I done error or if I don't understood what you actually mean.

Regards,
Fabrizio

---------------------------------
Hi,
sorry I cannot understand this question:

> How can we decide if a memory-located bitmap is segmented ?

do you mean "How can we know..."?

In this case there isn't a property to know it.
In the attached version I added TIEBitmap.FragmentsCount property: if it is >1 then the image is fragmented.

Hope this helps.

Regards,
Fabrizio
--------------------

Best regards,
//Christer