help-octave
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: how to create uint8 matrix in C++


From: Jaroslav Hajek
Subject: Re: how to create uint8 matrix in C++
Date: Tue, 5 Oct 2010 05:02:04 +0200

On Tue, Oct 5, 2010 at 1:04 AM, Martijn <address@hidden> wrote:
> Hi,
> I am trying to write an octave extension for reading of (especially)
> 16-bits TIFF images. I would like to store the image data in a matrix
> of 16 bits integers. The data are accessed by pointer to a uint16
> buffer. I am looking for a constructor for an octave uint16 matrix with
> a suitable constructor: i.g. octave_uint16_matrix(p, nx, ny) with p the
> pointer and nx and ny the dimensions of the matrix.
> I have found the octave_base_int_matrix class but it does not seem to
> have suitable constructor. How to proceed?
>
> bye,
>


octave_base_value subclasses are not normally used directly.

Use

a = uint16NDArray (dim_vector (nx, ny));
std::copy (p, p + nx*ny, a.fortran_vec ());

hth


> Martijn
> _______________________________________________
> Help-octave mailing list
> address@hidden
> https://www-old.cae.wisc.edu/mailman/listinfo/help-octave
>


reply via email to

[Prev in Thread] Current Thread [Next in Thread]