• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

How to allocate > 4GB in a plug-in

New Here ,
Nov 21, 2009 Nov 21, 2009

Copy link to clipboard

Copied

Hi,

I'm working on a filter plug-in which someone wants to use to process really large 32-bit files (e.g. 550+ megapixels).  Apparently they can load these info Photoshop 64-bit (I'd like to have enough RAM to be able to try this).  But the plug-in needs to allocate scratch buffers for processing, equal to more than twice the image size, and for images this size, this means allocating more than 4GB in the plug-in, and more than 2GB in one hit.

The way I'm currently doing this doesn't work for images of this size for two reasons:

1. I seem to have to set the bufferSpace field in the FilterRecord structure to the amount of buffer I want to allocate, when allocating large amounts, or calls to allocateProc fail.  However bufferSpace seems to be an int32 (typedef for long, which is 32 bits even on a 64-bit machine apparently).  How can I indicate to Photoshop that my plug-in will be asking for more than 4GB of RAM?  (Given that int32 is signed, I'm not sure I can tell it I'll be asking for more than 2GB in fact.)

2. I want to allocate, say 2.2GB using allocateProc, but it also takes a signed int32 as a parameter, suggesting that 2GB would be the maximum amount I could allocate in one go, and certainly 4GB even if it treated it as unsigned internally.

So I'd like to know if there are 64-bit friendly versions of bufferSpace and allocateProc that I can use when memory requirements are large?  If the int32 versions are all there are, it would seem like a serious limitation on the way 64-bit plug-ins can use RAM.

Thanks

                -Matthew

TOPICS
SDK

Views

804

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Adobe
Nov 23, 2009 Nov 23, 2009

Copy link to clipboard

Copied

If you think you need to allocate the whole image at one time, much less multiple copies of the whole image -- you're doing it wrong.

Rethink the problem so you can work in strips or tiles.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Participant ,
Jul 01, 2016 Jul 01, 2016

Copy link to clipboard

Copied

LATEST

Hi,

Did you manage to do so?

It seems my Plug In becomes "Grayed Out" on large images and I don't know why.

Thank You.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines