Logo Search packages:      
Sourcecode: linux-fsl-imx51 version File versions  Download package

int opl_vmirror_u16 ( const u8 *  src,
int  src_line_stride,
int  width,
int  height,
u8 *  dst,
int  dst_line_stride 

Mirror a 16bpp buffer vertically.

src Pointer to the input buffer
src_line_stride Length in bytes of a raster line of the input buffer
width Width in pixels of the region in the input buffer
height Height in pixels of the region in the input buffer
dst Pointer to the output buffer
dst_line_stride Length in bytes of a raster line of the output buffer
Standard OPL error code. See enumeration for possible result codes.

Definition at line 18 of file vmirror_u16.c.

References opl_vmirror_u16().

Referenced by opl_vmirror_u16(), and rotation().

      const u8 *src_row_addr;
      u8 *dst_row_addr;
      int i;

      if (!src || !dst)
            return OPLERR_NULL_PTR;

      if (width == 0 || height == 0 || src_line_stride == 0
          || dst_line_stride == 0)
            return OPLERR_BAD_ARG;

      src_row_addr = src;
      dst_row_addr = dst + (height - 1) * dst_line_stride;

      /* Loop over all rows */
      for (i = 0; i < height; i++) {
            /* memcpy each row */
            memcpy(dst_row_addr, src_row_addr, BYTES_PER_PIXEL * width);
            src_row_addr += src_line_stride;
            dst_row_addr -= dst_line_stride;

      return OPLERR_SUCCESS;

Generated by  Doxygen 1.6.0   Back to index