Unit 'CYBERGRAPHICS' Package
[Overview][Constants][Types][Procedures and functions][Variables][Index] [#morphunits]

ScalePixelArray

Scale the colors values of a rectangular array (V41)

Declaration

Source position: cybergraphics.pas line 315

function ScalePixelArray(

  srcRect: POINTER;

  SrcW: Word;

  SrcH: Word;

  SrcMod: Word;

  a1arg: PRastPort;

  DestX: Word;

  DestY: Word;

  DestW: Word;

  DestH: Word;

  SrcFormat: Byte

):LongInt;

Arguments

srcRect

  

Pointer to an array of pixels from which to fetch the pixel data. The pixel format is specified in SrcFormat

SrcW

  

Width of the source rectangle

SrcH

  

Height of the source rectangle

SrcMod

  

The number of bytes per row in the source rectangle.

a1arg

  

pointer to a RastPort structure

DestX

  

starting x point in the RastPort

DestY

  

starting y point in the RastPort

DestW

  

Width of the destination area

DestH

  

Height of the destination area

SrcFormat

  

pixel format in the source rectangle. Currently supported formats are: RECTFMT_RGB, RECTFMT_RGBA, RECTFMT_ARGB, RECTFMT_LUT8, RECTFMT_GREY8

Function result

number of pixels plotted

Description

Scale the colors values of a rectangular array of pixels starting at a specified x,y location and continuing through to another x,y location within a certain RastPort

For each pixel in a rectangular region, scale the color values from a linear array of color values into the bitmap used to describe a particular rastport.

Attention

Up to v40, this function only worked on screens depths > 8 bits. You may specify RECTFMT_LUT8 on 8bit screens, too now if v41 is available

Errors

Very early v40 revision did not support RECTFMT_LUT8 and RECTFMT_GREY8. Scaling is not very accurate. If you need high quality, use graphics.library/BitMapScale() instead or custom code. The count value returned is totally wrong.

See also

BitMapScale()

  

Perform raster scaling on a bit map.


Documentation generated on: 2021-07-30