PostGIS  2.1.10dev-r@@SVN_REVISION@@
rt_raster rt_raster_new ( uint32_t  width,
uint32_t  height 

Construct a raster with given dimensions.

Transform will be set to identity. Will contain no bands.

width: number of pixel columns
height: number of pixel rows
an rt_raster or NULL if out of memory

Definition at line 5353 of file rt_api.c.

References rt_raster_t::bands, rt_raster_t::height, rt_raster_t::ipX, rt_raster_t::ipY, rt_raster_t::numBands, RASTER_DEBUGF, rt_raster_destroy(), rtalloc(), rterror(), rt_raster_t::scaleX, rt_raster_t::scaleY, rt_raster_t::skewX, rt_raster_t::skewY, rt_raster_t::srid, SRID_UNKNOWN, and rt_raster_t::width.

Referenced by convert_raster(), diff_rastinfo(), fillRasterToPolygonize(), RASTER_addBandOutDB(), RASTER_asRaster(), RASTER_clip(), RASTER_makeEmpty(), RASTER_mapAlgebra2(), RASTER_mapAlgebraExpr(), RASTER_mapAlgebraFct(), RASTER_mapAlgebraFctNgb(), RASTER_nMapAlgebra(), RASTER_nMapAlgebraExpr(), RASTER_tile(), rt_band_load_offline_data(), rt_raster_clone(), rt_raster_compute_skewed_raster(), rt_raster_from_band(), rt_raster_from_gdal_dataset(), rt_raster_from_two_rasters(), rt_raster_gdal_rasterize(), rt_raster_gdal_warp(), rt_raster_iterator(), test_band_get_nearest_pixel(), test_band_get_pixel_line(), test_band_get_pixel_of_value(), test_band_metadata(), test_band_reclass(), test_band_stats(), test_band_value_count(), test_gdal_to_raster(), test_gdal_warp(), test_raster_cell_to_geopoint(), test_raster_clone(), test_raster_colormap(), test_raster_convex_hull(), test_raster_empty(), test_raster_from_band(), test_raster_from_two_rasters(), test_raster_fully_within_distance(), test_raster_geopoint_to_cell(), test_raster_geos_contains(), test_raster_geos_contains_properly(), test_raster_geos_covered_by(), test_raster_geos_covers(), test_raster_geos_overlaps(), test_raster_geos_touches(), test_raster_intersects(), test_raster_iterator(), test_raster_metadata(), test_raster_new(), test_raster_perimeter(), test_raster_pixel_as_polygon(), test_raster_replace_band(), test_raster_same_alignment(), test_raster_surface(), test_raster_to_gdal(), and test_raster_within_distance().

5353  {
5354  rt_raster ret = NULL;
5356  ret = (rt_raster) rtalloc(sizeof (struct rt_raster_t));
5357  if (!ret) {
5358  rterror("rt_raster_new: Out of virtual memory creating an rt_raster");
5359  return NULL;
5360  }
5362  RASTER_DEBUGF(3, "Created rt_raster @ %p", ret);
5364  if (width > 65535 || height > 65535) {
5365  rterror("rt_raster_new: Dimensions requested exceed the maximum (65535 x 65535) permitted for a raster");
5366  rt_raster_destroy(ret);
5367  return NULL;
5368  }
5370  ret->width = width;
5371  ret->height = height;
5372  ret->scaleX = 1;
5373  ret->scaleY = -1;
5374  ret->ipX = 0.0;
5375  ret->ipY = 0.0;
5376  ret->skewX = 0.0;
5377  ret->skewY = 0.0;
5378  ret->srid = SRID_UNKNOWN;
5380  ret->numBands = 0;
5381  ret->bands = NULL;
5383  return ret;
5384 }
double skewY
Definition: rt_api.h:2223
int32_t srid
Definition: rt_api.h:2225
void rt_raster_destroy(rt_raster raster)
Release memory associated to a raster.
Definition: rt_api.c:5387
struct rt_raster_t * rt_raster
Types definitions.
Definition: rt_api.h:133
uint16_t numBands
Definition: rt_api.h:2215
double ipY
Definition: rt_api.h:2221
uint16_t height
Definition: rt_api.h:2227
#define RASTER_DEBUGF(level, msg,...)
Definition: rt_api.h:285
uint16_t width
Definition: rt_api.h:2226
Unknown SRID value.
Definition: liblwgeom.h:154
double skewX
Definition: rt_api.h:2222
void * rtalloc(size_t size)
Raster core memory management functions.
Definition: rt_api.c:867
void rterror(const char *fmt,...)
Raster core error and info handlers.
Definition: rt_api.c:895
rt_band * bands
Definition: rt_api.h:2228
double ipX
Definition: rt_api.h:2220
double scaleX
Definition: rt_api.h:2218
double scaleY
Definition: rt_api.h:2219

Here is the call graph for this function: