/// <summary> /// The plane height of a YUV image plane with the given parameters. /// </summary> /// <param name="componentID"> /// ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr). /// </param> /// <param name="height"> /// Height (in pixels) of the YUV image. /// </param> /// <param name="subsamp"> /// Level of chrominance subsampling in the image. /// </param> /// <returns> /// The plane height of a YUV image plane with the given parameters, or /// -1 if the arguments are out of bounds. /// </returns> public int PlaneHeight(TJPlane componentID, int height, int subsamp) => TurboJpegImport.TjPlaneHeight(componentID, height, subsamp);
/// <summary> /// The plane width of a YUV image plane with the given parameters. /// </summary> /// <param name="componentID"> /// ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr). /// </param> /// <param name="width"> /// width (in pixels) of the YUV image. /// </param> /// <param name="subsamp"> /// level of chrominance subsampling in the image. /// </param> /// <returns> /// The plane width of a YUV image plane with the given parameters, or /// -1 if the arguments are out of bounds. /// </returns> public int PlaneWidth(TJPlane componentID, int width, int subsamp) => TurboJpegImport.TjPlaneWidth(componentID, width, subsamp);
/// <summary> /// The size of the buffer (in bytes) required to hold a YUV image plane with /// the given parameters. /// </summary> /// <param name="componentID"> /// ID number of the image plane (0 = Y, 1 = U/Cb, 2 = V/Cr). /// </param> /// <param name="width"> /// width (in pixels) of the YUV image. NOTE: this is the width of /// the whole image, not the plane width. /// </param> /// <param name="stride"> /// bytes per line in the image plane. Setting this to 0 is the /// equivalent of setting it to the plane width. /// </param> /// <param name="height"> /// height (in pixels) of the YUV image. NOTE: this is the height /// of the whole image, not the plane height. /// </param> /// <param name="subsamp"> /// level of chrominance subsampling in the image. /// </param> /// <returns> /// the size of the buffer (in bytes) required to hold the YUV image /// plane, or -1 if the arguments are out of bounds. /// </returns> public nuint PlaneSizeYUV(TJPlane componentID, int width, int stride, int height, int subsamp) => TurboJpegImport.TjPlaneSizeYUV(componentID, width, stride, height, subsamp);
public static extern int TjPlaneHeight(TJPlane componentID, int height, int subsamp);
public static extern int TjPlaneWidth(TJPlane componentID, int width, int subsamp);
public static extern nuint TjPlaneSizeYUV(TJPlane componentID, int width, int stride, int height, int subsamp);