IRC Logs

Log of #ghostscript at irc.freenode.net.

Search:
 <<<Back 1 day (to 2013/01/19)2013/01/20 
Robin_Watts deleet: ping18:10.12 
  deleet: The recycle stuff is causing crashes in the android app, I think18:10.34 
mvrhel_laptop Robin_Watts: are you around18:40.18 
Robin_Watts I am18:40.26 
  Just footling with the android mupdf app.18:40.42 
mvrhel_laptop cool18:41.04 
Robin_Watts tor8: Hey. The recent recycle bitmap calls added to the android app have caused it to crash all over the place.18:41.05 
mvrhel_laptop I finally have my windows app displaying rendered pdf18:41.20 
  but I do have an issue with windowsRT18:41.35 
Robin_Watts ok...18:41.45 
mvrhel_laptop to display an pixmap to the xaml I have to wrap it up in an image stream18:42.09 
  which windoze then decodes18:42.28 
  two things18:42.37 
tor8 Robin_Watts: that's...unfortunate18:42.40 
Robin_Watts xaml? Is that the windows display system?18:42.54 
mvrhel_laptop xaml is the UI stuff18:43.01 
Robin_Watts right.18:43.05 
mvrhel_laptop so question 118:43.17 
  is it possible to get BGR output without an alpha channel in the fitz pixmap18:43.33 
  or question 218:43.40 
Robin_Watts 1) No, not currently.18:44.01 
mvrhel_laptop is it possible to get a memory buffer of a ready to go image format 18:44.02 
tor8 mvrhel_laptop: that seems... unusual. there must be some way to draw raw images?18:44.32 
mvrhel_laptop tor8 : believe me I know18:44.42 
Robin_Watts Can you not create an RGBA bitmap (8 bit per pixel) in memory?18:44.46 
mvrhel_laptop I was up until 1am not believing this18:44.57 
  Robin_Watts: currently I do get a RGBA image back from mupdf18:45.28 
Robin_Watts mvrhel_laptop: Right, but what we do on other systems (like say android) is to create an android bitmap in RGBA format.18:46.05 
mvrhel_laptop and I have to wrap a bmp header around that so the I can associate the UI object with this memory stream18:46.08 
tor8 mvrhel_laptop: wrap it in a BMP header?18:46.14 
mvrhel_laptop I mean add a header for a file format that windoze understands18:46.33 
Robin_Watts Then we get a pointer to the bits for that, and make an fz_pixmap where the data points to the data in that android bitmap.18:46.37 
tor8 mvrhel_laptop: we can output BGR, but we always pad with the alpha18:46.41 
mvrhel_laptop tor8 the alpha is fine18:46.51 
Robin_Watts then we draw to that pixmap.18:46.53 
mvrhel_laptop as I can do BGRA 18:47.05 
tor8 mvrhel_laptop: just use fz_device_bgr to render18:47.10 
mvrhel_laptop ok18:47.14 
Robin_Watts Right. We can do BGRA.18:47.16 
  we just can't do BGR.18:47.24 
mvrhel_laptop ok 18:47.28 
  so in winRT they have made it hard to do raw pixel display but very easy to take image streams and do things18:48.02 
Robin_Watts Presumably winRT support BMP format?18:48.25 
mvrhel_laptop oh yes18:48.31 
  with BGRA18:48.37 
Robin_Watts so, create a BMP with BGRA of the required size in memory.18:48.48 
mvrhel_laptop that is what I am currently doing but I was geting RGBA back from mupdf18:49.08 
Robin_Watts OK, where you call mupdf to render, you must be passing in fz_device_rgb, right?18:49.35 
mvrhel_laptop and then I was having put the header and the image data in a memory streatm18:49.46 
  stream18:49.48 
  and then associate it with the xaml ui object18:49.57 
Robin_Watts Right.18:50.12 
  So to call mupdf to render a page, you must pass in an fz_pixmap, right? With the data for that pixmap pointing at your BMPs data ?18:50.53 
mvrhel_laptop I was using dev = fz_new_draw_device(ctx, pix);18:50.53 
Robin_Watts OK, where do you get pix from ?18:51.04 
mvrhel_laptop pix = fz_new_pixmap_with_bbox(ctx, fz_device_rgb, bbox);18:51.16 
  can I pass it a buffer to fill?18:51.27 
Robin_Watts OK. Use fz_device_bgr instead.18:51.28 
  mvrhel_laptop: Yes.18:51.36 
mvrhel_laptop oh that would be even better18:51.43 
Robin_Watts Just a tick and I'll find the function.18:51.45 
  fz_pixmap *fz_new_pixmap_with_data(fz_context *ctx, fz_colorspace *colorspace, int w, int h, unsigned char *samples);18:52.22 
mvrhel_laptop oh very good18:52.34 
Robin_Watts pix = fz_new_pixmap_with_data(ctx, fz_device_bgr, bmp->width, bmp->height, bmp->samples)18:53.01 
mvrhel_laptop right18:53.05 
Robin_Watts or something like that.18:53.06 
mvrhel_laptop that will be great18:53.08 
  I have to run now as we are off to the store. but I will fix my code for this and then see if I can add in some ui for showing more than just the first page :)18:53.51 
Robin_Watts cool.18:54.00 
mvrhel_laptop Alden say hi18:54.25 
  s/say/says/18:54.33 
Robin_Watts Hi alden!18:57.19 
  mvrhel_laptop: Are you bringing family to Miami?18:57.28 
mvrhel_laptop Robin_Watts: no. they all want to go but it is not going to work out19:02.56 
  kids have a piano recital/judging on saturday19:03.59 
Robin_Watts ah, shame.19:04.26 
mvrhel_laptop bbiaw19:07.22 
 Forward 1 day (to 2013/01/21)>>> 
ghostscript.com
Search: