graphics - Large images with Direct2D -


currently developing application windows store real time-image processing using direct2d. must support various sizes of images. first problem have faced how handle situations when image larger maximum supported texture size. after research , documentation reading found virtualsurfaceimagesource solution. idea load image iwicbitmap create render target createwicbitmaprendertarget (which far know not hardware accelerated). after drawing operations wanted display result screen invalidating corresponding region in virtualsurfaceimage source or when needupdate callback fires. supposed possible creating id2d1bitmap (hardware accelerated) , call copyfromrendertarget render target created createwicbitmaprendertarget , invalidated region bounds, method returns d2derr_wrong_resource_domain result. reason using iwicbitmap 1 of algorithms involved in application must have access update pixels of image.

the question why logic doesn't work? right way achieve goal using direct2d? far render target created createwicbitmaprendertarget not hardware accelerated if want image processing on gpu images larger maximum allowed texture size best solution?

thank in advance.

you correct images larger texture limit must handled in software.

however, question ask whether or not need entire image every time render.

you can use hardware accel render portion of large image loaded in software target.

for example,

  • use id2d1rendertarget::createsharedbitmap make bitmap can used different resources.
  • then create id2d1bitmaprendertarget , render large bitmap that. (making sure begindraw, clear, drawbitmap, enddraw). both bitmap , render target can cached use successive calls.
  • then copy render target regular id2d1bitmap portion fit texture memory using id2d1bitmap::copyfromrendertarget method.
  • finally draw real render target, prt->drawbitmap

Comments

Popular posts from this blog

linux - Does gcc have any options to add version info in ELF binary file? -

android - send complex objects as post php java -

charts - What graph/dashboard product is facebook using in Dashboard: PUE & WUE -