Resize

This module implements resizing an image between two resolutions. Typical example below (dm6467 resizing from a 720P buffer to a D1 sized buffer):. More...

Data Structures

struct  Resize_Attrs
 Attributes used to create a Resize job. More...

Typedefs

typedef struct Resize_Object * Resize_Handle
 Handle through which to reference a Resize job.

Enumerations

enum  Resize_WindowType {
  Resize_WindowType_HANN = 0,
  Resize_WindowType_BLACKMAN,
  Resize_WindowType_TRIANGULAR,
  Resize_WindowType_RECTANGULAR
}
 The window types supported for coefficient calculation. More...
enum  Resize_FilterType {
  Resize_FilterType_BILINEAR = 0,
  Resize_FilterType_BICUBIC,
  Resize_FilterType_LOWPASS
}
 The filter types supported for coefficient calculation. More...

Functions

Resize_Handle Resize_create (Resize_Attrs *attrs)
 Creates a Resize job.
Int Resize_config (Resize_Handle hResize, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Configure a Resize job.
Int Resize_execute (Resize_Handle hResize, Buffer_Handle hSrcBuf, Buffer_Handle hDstBuf)
 Execute a Resize job.
Int Resize_delete (Resize_Handle hResize)
 Deletes a Resize job.

Variables

const Resize_Attrs Resize_Attrs_DEFAULT
 Default attributes for a Resize job.

Detailed Description

This module implements resizing an image between two resolutions. Typical example below (dm6467 resizing from a 720P buffer to a D1 sized buffer):.

Remarks:
Following resizer functions are not supported in DM365. The resizer is chained with capture device always and not available for single shot mode. Following functions requires resizer to be in single shot mode. To use the resizer in single_shot_mode, change captureChainMode = FALSE in Capture.c.
   #include <xdc/std.h>
   #include <ti/sdo/dmai/Dmai.h>
   #include <ti/sdo/dmai/Resize.h>
   #include <ti/sdo/dmai/BufferGfx.h>

   BufferGfx_Attrs gfxAttrs = BufferGfx_Attrs_DEFAULT;
   Resize_Attrs rszAttrs = Resize_Attrs_DEFAULT;
   Buffer_Handle inBuf, outBuf;
   Capture_Handle hCap;
   Resize_Handle hResize;
   Int32 bufSize;

   Dmai_init();
   bufSize = BufferGfx_calcSize(VideoStd_D1_NTSC,
                                ColorSpace_420P);
   BufferGfx_calcDimensions(VideoStd_D1_NTSC,
                            ColorSpace_420P, &gfxAttrs.dim);
   gfxAttrs.colorSpace = ColorSpace_420P;
   outBuf = Buffer_create(bufSize, Buffer_getBufferAttrs(&gfxAttrs));

   bufSize = BufferGfx_calcSize(VideoStd_720P,
                                ColorSpace_420P);
   BufferGfx_calcDimensions(VideoStd_720P,
                            ColorSpace_420P, &gfxAttrs.dim);
   gfxAttrs.colorSpace = ColorSpace_420P;
   inBuf = Buffer_create(bufSize, Buffer_getBufferAttrs(&gfxAttrs));

   Resize_create(&rszAttrs);
   Resize_config(hInBuf, hOutBuf);
   // Fill hInBuf with video data
   Resize_execute(hResize, inBuf, outBuf);

   Buffer_delete(inBuf);
   Buffer_delete(outBuf);
   Resize_delete(hResize);

Typedef Documentation

typedef struct Resize_Object* Resize_Handle

Handle through which to reference a Resize job.


Enumeration Type Documentation

The window types supported for coefficient calculation.

Remarks:
Only applicable on dm6446 linux.
Enumerator:
Resize_WindowType_HANN 
Resize_WindowType_BLACKMAN 
Resize_WindowType_TRIANGULAR 
Resize_WindowType_RECTANGULAR 

The filter types supported for coefficient calculation.

Remarks:
Only applicable on dm6446 linux.
Enumerator:
Resize_FilterType_BILINEAR 
Resize_FilterType_BICUBIC 
Resize_FilterType_LOWPASS 


Function Documentation

Resize_Handle Resize_create ( Resize_Attrs attrs  ) 

Creates a Resize job.

Parameters:
[in] attrs Resize_Attrs to use for creating the Resize job.
Return values:
Handle for use in subsequent operations (see Resize_Handle).
NULL for failure.

Int Resize_config ( Resize_Handle  hResize,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Configure a Resize job.

Parameters:
[in] hResize The Resize_Handle of the job to configure.
[in] hSrcBuf The source buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
[in] hDstBuf The destination buffer to configure for. Note that only the buffer properties are accessed, the pointers are not used.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Resize_create must be called before this function.

Int Resize_execute ( Resize_Handle  hResize,
Buffer_Handle  hSrcBuf,
Buffer_Handle  hDstBuf 
)

Execute a Resize job.

Parameters:
[in] hResize The Resize_Handle of the job to execute.
[in] hSrcBuf The Buffer_Handle of the source buffer to copy from.
[in] hDstBuf The Buffer_Handle of the destination buffer to copy to.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Resize_create must be called before this function.

Resize_config must be called before this function.

Int Resize_delete ( Resize_Handle  hResize  ) 

Deletes a Resize job.

Parameters:
[in] hResize The Resize_Handle of the job to delete.
Return values:
Dmai_EOK for success.
Negative value for failure, see Dmai.h.
Remarks:
Resize_create must be called before this function.


Variable Documentation

Default attributes for a Resize job.

 hWindowType      = Resize_WindowType_BLACKMAN,
 vWindowType      = Resize_WindowType_BLACKMAN,
 hFilterType      = Resize_FilterType_LOWPASS,
 vFilterType      = Resize_FilterType_LOWPASS,
 rszRate          = 0xe


Copyright 2011, Texas Instruments Incorporated