Rev 485 | Rev 492 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed
Rev 485 | Rev 486 | ||
---|---|---|---|
Line 102... | Line 102... | ||
102 | preview_pmask.maskDescription = kSimplePSMask; |
102 | preview_pmask.maskDescription = kSimplePSMask; |
103 | preview_pmap.masks = &preview_pmask; |
103 | preview_pmap.masks = &preview_pmask; |
104 | }else |
104 | }else |
105 | preview_pmap.masks = NULL; |
105 | preview_pmap.masks = NULL; |
106 | 106 | ||
107 | preview_handle = newBuffer((long)preview_h * preview_pmap.rowBytes); |
107 | newBuffer(&preview_handle, (long)preview_h * preview_pmap.rowBytes); |
108 | }else |
108 | }else |
109 | preview_handle.signature = BUFVERSION_NULL; |
109 | preview_handle.signature = BUFVERSION_NULL; |
110 | return preview_handle.signature != BUFVERSION_NULL; |
110 | return preview_handle.signature != BUFVERSION_NULL; |
111 | 111 | ||
112 | //--------------------------------------------------------------------------- |
112 | //--------------------------------------------------------------------------- |
Line 273... | Line 273... | ||
273 | SETRECT(MASK_RECT(pb), 0, 0, 0, 0); |
273 | SETRECT(MASK_RECT(pb), 0, 0, 0, 0); |
274 | pb->inLoPlane = pb->outLoPlane = 0; |
274 | pb->inLoPlane = pb->outLoPlane = 0; |
275 | pb->inHiPlane = pb->outHiPlane = nplanes - 1; |
275 | pb->inHiPlane = pb->outHiPlane = nplanes - 1; |
276 | 276 | ||
277 | if (!needinput || !(e = pb->advanceState())) { |
277 | if (!needinput || !(e = pb->advanceState())) { |
278 | Ptr outptr = lockBuffer(preview_handle); |
278 | Ptr outptr = lockBuffer(&preview_handle); |
279 | int blankrows = (preview_h - imgh) / 2, |
279 | int blankrows = (preview_h - imgh) / 2, |
280 | blankcols = (preview_w - imgw) / 2, |
280 | blankcols = (preview_w - imgw) / 2, |
281 | pmrb = preview_pmap.rowBytes; |
281 | pmrb = preview_pmap.rowBytes; |
282 | 282 | ||
283 | evalinit(); |
283 | evalinit(); |
Line 329... | Line 329... | ||
329 | SetPort(saveport); |
329 | SetPort(saveport); |
330 | } |
330 | } |
331 | #endif |
331 | #endif |
332 | } |
332 | } |
333 | 333 | ||
334 | unlockBuffer(preview_handle); |
334 | unlockBuffer(&preview_handle); |
335 | } |
335 | } |
336 | 336 | ||
337 | if (e && !previewerr) { |
337 | if (e && !previewerr) { |
338 | alertuser((TCHAR*)TEXT("Could not build preview at chosen zoom level."), |
338 | alertuser((TCHAR*)TEXT("Could not build preview at chosen zoom level."), |
339 | e == memFullErr && !needall ? (TCHAR*)TEXT("The image is too large for available memory. Try zooming in.\nIf that does not help, cancel and retry the filter.") : (TCHAR*)TEXT("")); |
339 | e == memFullErr && !needall ? (TCHAR*)TEXT("The image is too large for available memory. Try zooming in.\nIf that does not help, cancel and retry the filter.") : (TCHAR*)TEXT("")); |
Line 408... | Line 408... | ||
408 | SETRECT(BIGDOC_MASK_RECT(pb), 0, 0, 0, 0); |
408 | SETRECT(BIGDOC_MASK_RECT(pb), 0, 0, 0, 0); |
409 | pb->inLoPlane = pb->outLoPlane = 0; |
409 | pb->inLoPlane = pb->outLoPlane = 0; |
410 | pb->inHiPlane = pb->outHiPlane = nplanes - 1; |
410 | pb->inHiPlane = pb->outHiPlane = nplanes - 1; |
411 | 411 | ||
412 | if (!needinput || !(e = pb->advanceState())) { |
412 | if (!needinput || !(e = pb->advanceState())) { |
413 | Ptr outptr = lockBuffer(preview_handle); |
413 | Ptr outptr = lockBuffer(&preview_handle); |
414 | int blankrows = (preview_h - imgh) / 2, |
414 | int blankrows = (preview_h - imgh) / 2, |
415 | blankcols = (preview_w - imgw) / 2, |
415 | blankcols = (preview_w - imgw) / 2, |
416 | pmrb = preview_pmap.rowBytes; |
416 | pmrb = preview_pmap.rowBytes; |
417 | 417 | ||
418 | evalinit(); |
418 | evalinit(); |
Line 464... | Line 464... | ||
464 | SetPort(saveport); |
464 | SetPort(saveport); |
465 | } |
465 | } |
466 | #endif |
466 | #endif |
467 | } |
467 | } |
468 | 468 | ||
469 | unlockBuffer(preview_handle); |
469 | unlockBuffer(&preview_handle); |
470 | } |
470 | } |
471 | 471 | ||
472 | if (e && !previewerr) { |
472 | if (e && !previewerr) { |
473 | alertuser((TCHAR*)TEXT("Could not build preview at chosen zoom level."), |
473 | alertuser((TCHAR*)TEXT("Could not build preview at chosen zoom level."), |
474 | e == memFullErr && !needall ? (TCHAR*)TEXT("The image is too large for available memory. Try zooming in.\nIf that does not help, cancel and retry the filter.") : (TCHAR*)TEXT("")); |
474 | e == memFullErr && !needall ? (TCHAR*)TEXT("The image is too large for available memory. Try zooming in.\nIf that does not help, cancel and retry the filter.") : (TCHAR*)TEXT("")); |